[HELP] Timers not working
#1

2 of my timers are not working-

Код:
public spawnkill(playerid)
{
SetPlayerHealth(playerid,100);
return 1;
}
public checkup(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 256.9511,1802.0492,7.5494))
  {
SetPlayerPos(playerid,2543.2554,-1306.0792,1025.0703 );
SetPlayerInterior(playerid, 2);
}
return 1;
}
public gate(playerid)
{
MoveObject(fronthqgate, 213.8026,1876.0151,13.1406, 2.00);
return 1;
}//214.2012,1875.1792,13.7000
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (HOLDING(KEY_CROUCH))
	{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 213.8026,1876.0151,13.1406))
  {
MoveObject(fronthqgate, 226.2012,1875.1792,13.8000, 2.00);
	}
	return 1;
}
if (RELEASED(KEY_CROUCH))
{
MoveObject(fronthqgate, 214.2012,1875.1792,13.8000, 2.00);
	}
	return 1;
}
this starts them; (im wondering maybe cus i dont kill the timer?)
Код:
public OnGameModeInit()
{
 ("checkup",100,true);
 SetTimer("lol",100,true);
///===================================/
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 161.4116,-83.2514,1001.8047, 1.0);
SetPlayerHealth(playerid,100000);
SetTimer("spawnkill",5000,false);
Reply
#2

You have to give between the ""'s the name of the public.

Example:
SetTimer("Checkup", 100, true);
Reply
#3

Quote:
Originally Posted by » RэРиR «
You have to give between the ""'s the name of the public.

Example:
SetTimer("Checkup", 100, true);
what do you mean, thats what i did?
Reply
#4

You need to loop through all players

pawn Код:
public checkup()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 1.0, 256.9511,1802.0492,7.5494))
        {
            SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
            SetPlayerInterior(i, 2);
        }
    }
    return 1;
}
and

pawn Код:
SetTimer("checkup",1000,true);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)