16.01.2014, 10:58
Hello,I want code to put it in,my script to freeze,the player while the maping is loading to avoid bugs ,thanks
CMD:freeze(playerid, params[])
{
if(IsPlayerAdmin(playerid))//is player rcon to freeze players
{
new pID;
if(sscanf(params, "u", pID))return SendClientMessage(playerid, COLOR_WHITE, "Syntax: /freeze [PlayerID/Name]");
TogglePlayerControlable(pID, 1);
}
return 1;
}
forward PlayerControllableAfterSpawn(playerid);
stock SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, interiorid = 0)
{
SetPlayerPos(playerid, X, Y, Z+0.5), SetPlayerInterior(playerid, interiorid);
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid , "Please Wait..." , 3000, 5);
SetPlayerVirtualWorld(playerid , 54);
SetTimerEx("PlayerControllableAfterSpawn", 500, 0, "i", playerid);
return 1;
}
public PlayerControllableAfterSpawn(playerid)
{
TogglePlayerControllable(playerid , 1);
SetPlayerVirtualWorld(playerid , 0);
return 1;
}
On the top of script :
PHP код:
PHP код:
|
forward PlayerControllableAfterSpawn(playerid);
stock SetPlayerPosEx2(playerid, Float:X, Float:Y, Float:Z, interiorid = 0)
{
SetPlayerPos(playerid, X, Y, Z+0.5), SetPlayerInterior(playerid, interiorid);
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid , "Please Wait..." , 3000, 5);
SetPlayerVirtualWorld(playerid , 54);
SetTimerEx("PlayerControllableAfterSpawn", 500, 0, "i", playerid);
return 1;
}
public PlayerControllableAfterSpawn(playerid)
{
TogglePlayerControllable(playerid , 1);
SetPlayerVirtualWorld(playerid , 0);
return 1;
}