Freeze Command
#1

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

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)