Author Topic: Time in heal  (Read 6584 times)

0 Members and 1 Guest are viewing this topic.

Offline DEVIL

  • Street Thug
  • *
  • Posts: 7
  • Be the 1 and beleive in 1
    • View Profile
    • Death Server
Time in heal
« on: October 25, 2011, 11:55:00 am »
how can i add heal time in heal?

Offline Nadeem

  • Made Man
  • ***
  • Posts: 117
    • View Profile
    • The Zetz
Re: Time in heal
« Reply #1 on: October 25, 2011, 04:21:00 pm »
open ur gamemodes and Search for heal .And put these lines after ur heal cmd
[pawn]else {
             SetTimer("SetHPTime",8000,0);
              pInfo[playerid][TimeHeal] = 1;
              MessagePM(playerid, GREEN,"Wait(put ur time here)5to prevent death evade...");
              }[/pawn]

yazeen

  • Guest
Re: Time in heal
« Reply #2 on: October 25, 2011, 04:28:02 pm »
open ur gamemodes and Search for heal .And put these lines after ur heal cmd
[pawn]else {
             SetTimer("SetHPTime",8000,0);
              pInfo[playerid][TimeHeal] = 1;
              MessagePM(playerid, GREEN,"Wait(put ur time here)5to prevent death evade...");
              }[/pawn]

Epic Failzor! wheres the SetHPTime function?
and MessagePM is madara.inc

Offline Nadeem

  • Made Man
  • ***
  • Posts: 117
    • View Profile
    • The Zetz
Re: Time in heal
« Reply #3 on: October 25, 2011, 04:39:38 pm »
Bro u didnt seen this ?[pawn]SetTimer("SetHPTime",8000,0);[/pawn]
Hp Time 8000 mean 8 sec

yazeen

  • Guest
Re: Time in heal
« Reply #4 on: October 25, 2011, 04:54:29 pm »
Bro u didnt seen this ?[pawn]SetTimer("SetHPTime",8000,0);[/pawn]
Hp Time 8000 mean 8 sec

Search for SetHpTime in the script and you will find it and copy and paste that in here and help him
This mean after 8 seconds that script will be started..
srsly learn scripting hard and then post
Good Luck :)  ;)

Offline DEVIL

  • Street Thug
  • *
  • Posts: 7
  • Be the 1 and beleive in 1
    • View Profile
    • Death Server
Re: Time in heal
« Reply #5 on: October 26, 2011, 02:00:06 pm »
open ur gamemodes and Search for heal .And put these lines after ur heal cmd
[pawn]else {
             SetTimer("SetHPTime",8000,0);
              pInfo[playerid][TimeHeal] = 1;
              MessagePM(playerid, GREEN,"Wait(put ur time here)5to prevent death evade...");
              }[/pawn]
this is not working i got Madara error.

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Time in heal
« Reply #6 on: October 26, 2011, 07:25:17 pm »
[madbro]OK BRO!? U MAD TO GET TIMEHEAL!? IF YOU MAD THEN !

ON TOPE OF SCRITPE !!!
[pawn]enum pINFE{
TIMEHEAL
};

new UMAD[MAX_PLAYERS][pINFE];[/pawn]

K BRO!?! MORE MADNEESEE!!!? HEREEEE!

[pawn]
if(strcmp(cmdtext, "heal", true) == 0)
{
    SetTimer("MADBRO",5000,0);
    UMAD[playerid][TIMEHEAL] = 1;
    SendClientMessage(playerid,0x0000ff, "UMADBRO?! U WANT HEAL COME FAST? GO /kill YOURSELF OR WAIT 5 SECONDS!");
    return 1;
}[/pawn]


THIS IS MADNESSSSSSSSSSSSSSS!!!

[pawn]
forward MADBRO();
public MADBRO()
{
   new madbros = 0;
   for(madbros < MAX_PLAYERS, madbros++) {
   // UMADBRO!?HEAL FAST ?!?!?!?!?!?!?!?!?!?
   // OKAY! HERE U FUCKIN GO!!!
   if(IsPlayerConnected(madbros)) {
   // MORE MADNESS?!?! BRO U SO MAD :O
   if(UMAD[madbros][TIMEHEAL] == 1)
   {
   // MADBRO!? U RECEIVE 100HP!? UBROMAD!
   SetPlayerHealth(madbros,100);
   SendClientMessage(madbros,0x00000ff,"EAT SHIT AND DIE !!! MAD BRO!? WHY DONT YOU /q!");
   UMAD[madbros][TIMEHEAL] = 0; // GO **** YOURSELF !
   }
   }
   }
   return 1;
   }[/pawn]

THIS IS MADBRO LESSON[/madbro]

 Not tested, dunno if it works. Dinner break nutzers. xOxO ( NO HOMO! )

[joke][madbro] UBRO POST HERE IF WORKS OR NOT! /me WILL FIX IT FOR UR BIG $$$[/madbro][/joke]
« Last Edit: October 26, 2011, 07:30:43 pm by heekz.shadow »
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Time in heal
« Reply #7 on: October 27, 2011, 05:27:27 am »
lol.. shadow. cool down mate
I'm beginning to feel like a Lag God, Lag God

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: Time in heal
« Reply #8 on: October 27, 2011, 04:10:45 pm »
That script won't even work... you'll have a million and one timers setting everyones health to 100% if they did !heal so some people could get healed instantly whilst others are waiting just 2 seconds, then the other people waiting 5 seconds.

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Time in heal
« Reply #9 on: October 27, 2011, 06:11:50 pm »
Bro.. This is what he wanted... You cannot sync timers so good, [ Due to lack of developing and PAWN features (talking about pawn scripts) ]


 And what you say? It won't work? Mate, it's a special function for everyone. 6 guys at a time can do the !heal thing, and it won't be bug... Why are you so mean? I tried to explain a script in a funny way... Now go and blame Stormeus for too much knowledge about C++ ...

 Oh, and by the way. The timer gets killed when the function is done... So...

Now, please

Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: Time in heal
« Reply #10 on: October 27, 2011, 07:06:16 pm »
Bro.. This is what he wanted... You cannot sync timers so good, [ Due to lack of developing and PAWN features (talking about pawn scripts) ]

And what you say? It won't work? Mate, it's a special function for everyone. 6 guys at a time can do the !heal thing, and it won't be bug... Why are you so mean? I tried to explain a script in a funny way... Now go and blame Stormeus for too much knowledge about C++ ...

Oh, and by the way. The timer gets killed when the function is done... So...

It will work just not as intended, say PlayerA did !heal, this would set the 5 second timer, then PlayerB did !heal with 1 second left on the timer. This would mean that when the 5 seconds are up PlayerA would get healed, and PlayerB would also get healed.

Therefore PlayerB has an unfair advantage over PlayerA since he will get healed in a shorter amount of time.

Being mean? I'm telling it how it is, I have far more knowledge than you in scripting so I think it's time you used a proper language rather than this shitty PAWN thing, and yes I have used PAWN for SA:MP and that is a pile of wank, and it works properly.
« Last Edit: October 27, 2011, 11:40:36 pm by Force »

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Time in heal
« Reply #11 on: October 27, 2011, 10:10:14 pm »
go and blame Stormeus for too much knowledge about C++ ...
Where do I come into any of this? Ah well, might as well get involved now.

VC:MP Pawn does not support parameters in timers. What you'd have to do is set a timer to go off every second (which will cause srs lag). It would be a better idea to have that timer handle anything that involves timers with parameters.

PlayerInfo[playerid][TimeHeal] would not be set to one. You would use PlayerInfo[playerid][TimeHeal] = time(); Then you'd change your UMAD function to look something like this:

[pawn]
public MADBRO()
{
   new madbros = 0;
   for(madbros < MAX_PLAYERS, madbros++)
   {
      if(IsPlayerConnected(madbros))
      {
         if(UMAD[madbros][TIMEHEAL] != 0 && (time() - UMAD[madbros][TIMEHEAL]) >= 5)
         {
            SetPlayerHealth(madbros,100);
            SendClientMessage(madbros,0x00000ff,"Healed");
            UMAD[madbros][TIMEHEAL] = 0;
         }
      }
   }

   return 1;
}
// lol why u mad tho
[/pawn]

Aside from deleting all those umad comments, a conditional line was changed:
if(UMAD[madbros][TIMEHEAL] > 0 && (time() - UMAD[madbros][TIMEHEAL]) >= 5)

This checks if they're waiting to be healed. Then it sees if the timestamp of when they used the command, taken from the current timestamp (number of seconds since the Unix Epoch. Google it) is at least 5 if something lags or bugs out.

Then it heals them.

Also, you'd have to use SetTimer("MADBRO", 1000, 1); in OnScriptLoad instead of calling the timer every time the command is used, because Force has a point -- your server will have shitloads of timers going off to run the same timer because you used 0 for the number of iterations. Eventually, it'll get to a point where you're healed instantly.

tl;dr
There I fixed it.
« Last Edit: October 27, 2011, 10:13:16 pm by stormeus »
Do not PM me for support.




Offline Morphine

  • Made Man
  • ***
  • Posts: 109
    • View Profile
Re: Time in heal
« Reply #12 on: October 28, 2011, 11:25:45 am »
Blame this legend ^ for owning Shadow.

Offline DEVIL

  • Street Thug
  • *
  • Posts: 7
  • Be the 1 and beleive in 1
    • View Profile
    • Death Server
Re: Time in heal
« Reply #13 on: October 30, 2011, 01:16:50 pm »
i can't get it guys plz give me correct one.

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Time in heal
« Reply #14 on: October 31, 2011, 07:21:33 pm »
Also, you'd have to use SetTimer("MADBRO", 1000, 1); in OnScriptLoad instead of calling the timer every time the command is used, because Force has a point -- your server will have shitloads of timers going off to run the same timer because you used 0 for the number of iterations. Eventually, it'll get to a point where you're healed instantly.

Too much squirrel ?

 public OnGameModeInit()

 Also, post here the issues / errors and the lines that gave you the errors, please, we are not brain readers...
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players