Timer - Help (Noob Moment)
#1

Hello Everyone and thanks to everyone who replies to this topic with helpful information.

I am having difficulties with a Timer in sa-mp script. It is ment to delay a players spawn so they spawn a few seconds later to avoid falling through my objects.

Heres the code:
Код:
SetTimer("SpawnTimer", 3000, 1);
I just want to make it so it FREEZES the player when they spawn, then three seconds later unfreezes them. (I know how to unfreeze them in Public SpawnTimer, Its just I do not know how to freeze them once the timer starts)
Reply
#2


pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, 0);
SetTimer("Freeze", 3000, true);
return 1;
}
pawn Код:
forward Freeze();
public Freeeze()
{
TooglePlayerControllable(playerid, 1);
return 1;
}
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid,0);
SetTimer("unfreeze",3000,0);
return 1;
}

forward unfreeze(playerid);
public unfreeze(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
Reply
#4

Quote:
Originally Posted by ViruZZzZ_ChiLLL

pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, 1);
SetTimer("Freeze", 3000, true);
return 1;
}
pawn Код:
forward Freeze();
public Freeeze()
{
TooglePlayerControllable(playerid, 0);
return 1;
}
You made it so when someone spawns,he is unfreezed and after 3 seconds you freeze him.
It should be:
pawn Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, 0);
SetTimer("Freeze", 3000, true);
return 1;
}
pawn Код:
forward Freeze();
public Freeeze()
{
TooglePlayerControllable(playerid, 1);
return 1;
}
Reply
#5

I edited it awhile ago

EDIT : Sorry, I'm really getting confused right now...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)