freeze
#6

Quote:
Originally Posted by J4Rr3x
Посмотреть сообщение
pawn Код:
// You need zcmd and sscanf2

CMD:freeze(playerid, params[]) {
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You aren't admin"); // Comment this line if you want the command for all player
   new targetid;
   if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /freeze [playerid/playername]");
   TogglePlayerControllable(targetid, 0);
   SendClientMessage(targetid, -1, "An admin froze you.");
   return 1;
}
and how the player will unfreeze O.O?

for freeze
PHP код:
CMD:freeze(playeridparams[]) {
   if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You aren't admin"); // Comment this line if you want the command for all player
   
new targetid,string[128],an[MAX_PLAYER_NAME],pn[MAX_PLAYER_NAME];
   if(
sscanf(params"u"targetid)) return SendClientMessage(playerid, -1"Syntax: /freeze [playerid/playername]");
   
GetPlayerName(playerid,an,sizeof(an)); GetPlayerName(targetid,pn,sizeof(pn));
   
TogglePlayerControllable(targetid0);
   
format(string,sizeof(string),"You has been frozen by administrator: %s",an);
   
SendClientMessage(targetid0x33FF33AAstring);
   
format(string,sizeof(string),"You has frozen %s",pn);
   
SendClientMessage(targetid0x33FF33AAstring);
   return 
1;

for unfreeze
PHP код:
CMD:unfreeze(playeridparams[]) {
   if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You aren't admin"); // Comment this line if you want the command for all player
   
new targetid,string[128],an[MAX_PLAYER_NAME],pn[MAX_PLAYER_NAME];
   if(
sscanf(params"u"targetid)) return SendClientMessage(playerid, -1"Syntax: /unfreeze [playerid/playername]");
   
GetPlayerName(playerid,an,sizeof(an)); GetPlayerName(targetid,pn,sizeof(pn));
   
TogglePlayerControllable(targetid0);
   
format(string,sizeof(string),"You has been unfrozen by administrator: %s",an);
   
SendClientMessage(targetid0x33FF33AAstring);
   
format(string,sizeof(string),"You has unfrozen %s",pn);
   
SendClientMessage(playerid0x33FF33AAstring);
   return 
1;

Reply


Messages In This Thread
freeze - by Trollerz - 19.09.2015, 21:48
Re: freeze - by Mister0 - 19.09.2015, 21:55
Re : Re: freeze - by KillerDVX - 19.09.2015, 23:17
Re: freeze - by Mister0 - 20.09.2015, 09:46
Re: freeze - by J4Rr3x - 20.09.2015, 10:03
Re: freeze - by jlalt - 20.09.2015, 10:21

Forum Jump:


Users browsing this thread: 2 Guest(s)