03.04.2010, 17:08
pawn Код:
if(strcmp(cmd, "/unfreeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /unfreeze [playerid/partofname]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "You got unfrozen by %s",sendername);
SendClientMessage(playa,COLOR_RED,string);
format(string, sizeof(string), "You've unfrozen %s",giveplayer);
SendClientMessage(playerid,COLOR_RED,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Attempt denied! You are not authorized to use that command!");
}
}
return 1;
}
if(strcmp(cmd, "/freeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /unfreeze [playerid/partofname]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
TogglePlayerControllable(playa, 0);
format(string, sizeof(string), "You got frozen by %s",sendername);
SendClientMessage(playa,COLOR_RED,string);
format(string, sizeof(string), "You frozen %s",giveplayer);
SendClientMessage(playerid,COLOR_RED,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Attempt denied! You are not authorized to use that command!");
}
}
return 1;
}