Posts: 471
Threads: 97
Joined: Feb 2010
Reputation:
0
Hello,
Is there a way to call a function on OnPlayerSpawn that freezes the player, and then when the objects near the player has finished loading, he becomes unfrozen.
Is there a way to do this, if yes how would that be possible?
Yours sincerely,
Kevin
Posts: 342
Threads: 24
Joined: Feb 2013
Use
pawn Код:
forward Update(); //on the top
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid,0);
//
SetTimer("Update", 10000, false); // 10 seconds for streaming object that will be fine
return 1;
}
//lacks
public Update()
{
TogglePlayerControllable(playerid,1);
}
Posts: 142
Threads: 5
Joined: Jun 2013
add this near stocks :
pawn Код:
stock freeze()
{
TogglePlayerControllable(playerid, 1);
}
and add this one under onplayerspawn
pawn Код:
TogglePlayerControllable(playerid, 0);
SetTimer(freeze, 20000, false);
Posts: 342
Threads: 24
Joined: Feb 2013
Quote:
Originally Posted by M3HR4N
add this near stocks :
pawn Код:
stock freeze() { TogglePlayerControllable(playerid, 1); }
and add this one under onplayerspawn
pawn Код:
TogglePlayerControllable(playerid, 0); SetTimer(freeze, 20000, false);
|
@Mehran
pawn Код:
SetTimer(freeze, 20000, false);
20000 = 20 seconds lol are you mad? 10 seconds will be fine