21.11.2009, 20:38
Ok, well.. I scripted /kick /ban /freeze and /thaw, but whenever i do it on ID 0, it doesn't work. Here's my thaw code:
Some help would be extremely appreciated
pawn Код:
if(strcmp(cmd, "/thaw", true) == 0 || strcmp(cmd, "/unfreeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ALERT, "** Error: /freeze [id/name]");
if(PlayerInfo[playerid][Admin] >= 2)
{
new player = ReturnUser(tmp);
if(IsPlayerConnected(player))
{
if(player != INVALID_PLAYER_ID)
{
TogglePlayerControllable(player,1);
new giveplayer[MAX_PLAYER_NAME], getplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid,giveplayer,sizeof(giveplayer));
GetPlayerName(player,getplayer,sizeof(getplayer));
format(tmp, sizeof(tmp), "Admin: %s was unfrozen by %s.",getplayer,giveplayer);
SendClientMessageToAll(COLOR_ADMIN, tmp);
new year,month,day;
getdate(year,month,day);
format(tmp, sizeof(tmp), "Admin: %s was unfrozen by %s. [%d/%d/%d]",getplayer,giveplayer,day,month,year);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_ALERT, "** That player is not connected.");
return 1;
}
}
}
return 1;