SA-MP Forums Archive
Freeze Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Freeze Command (/showthread.php?tid=580746)



Freeze Command - NexySamp - 07.07.2015

I need that command that admins can use.Example USE: /Freeze <Player> <duration> <reason>


Re: Freeze Command - JimmyCh - 07.07.2015

You need to use TogglePlayerControllable function, check this out for an idea on how to use it:
https://sampwiki.blast.hk/wiki/Function:...erControllable


Re: Freeze Command - KingServerIRAN - 07.07.2015

Try this

Код:
CMD:freeze(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return GameTextForPlayer(playerid, "~r~error~w~:only admins can use this command!",3000,3);
else
{
new
pname[MAX_PLAYER_NAME],
string[128],
reason[50],
giveplayerid;
GetPlayerName(playerid, pname,sizeof(pname));
if(sscanf(params,"rs[50]",giveplayerid,reason)) return GameTextForPlayer(playerid, "~r~error~w~:/freeze (playerid) (reason)",2000,3);
else if(!IsPlayerConnected(giveplayerid)||giveplayerid == INVALID_PLAYER_ID) return GameTextForPlayer(playerid, "~r~error~w~:This player isn't connected!",3000,3);
else
{
format(string,sizeof(string),"ADMIN FREEZE: %s has been freezed by an administrator(Reason: %s)",pname,reason);
SendClientMessageToAll(COLOR_PINK, string);
TogglePlayerControllable(giveplayerid, 0);
GameTextForPlayer(giveplayerid,"~r~FROZEN",3000,3);
}
}
return 1;
}
Maybe i have helped you