quick question
#1

i'm doing zombie server and i want after zombie hit you will be infected after 10 secs, so what how to set timer to 10 sec?

this is 10 secs?

Код:
SetTimer("TurningToInfected",100,0);
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer

Код:
(funcname[], interval, repeating)
 funcname[]	Name of the function to call as a string. Needs to be a public!
 interval	Interval in milliseconds.
 repeating	Boolean if the timer should occur repeatedly or only once
Reply
#3

You would need the SetTimerEx.
Reply
#4

It is in miliseconds. So 10000.
Reply
#5

thanks.
Reply
#6

Under OnGameModeInit
Код:
SetTimer("healthchecker", 500, true);
Above OnGameModeInit
Код:
new ivebeenzombied[MAX_PLAYERS];
somewhere in the script (for example last lines):
Код:
forward healthchecker();
public healthchecker()
{
      for(new i = 0; i < MAX_PLAYERS; i++)
      {
            if(IsPlayerConnected(i))
            {
                   new Float: health;
                   GetPlayerHealth(playerid, health);
                   if(ivebeenzombied[i] == 1) return 1;//to stop the code, otherwise it will repeat all the time
                   if(health < 100) //checks if the player has less health than 100.
                   {
                          code...
                          ivebeenzombied[i] = 1;
                   }
            }
      }
      return 1;
}

Hope it will help you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)