12.08.2010, 17:44
pawn Код:
dcmd_jail(playerid, params[])
{
new ReturnPlayer, ppName[24], ReturnUserName[24], str[128];
if(PlayerInfo[playerid][AdminLevel] < 1) return false;
if(sscanf(params, "dd", ReturnPlayer, JailMins[ReturnPlayer])) return SendClientMessage(playerid, mwhite, "Usage: /jail [playerid] [mins]");
if(!IsPlayerConnected(ReturnPlayer)) return SendClientMessage(playerid, mbrightred, "Invalid playerid.");
if(PlayerIsJailed[ReturnPlayer] == 1) return SendClientMessage(playerid, mbrightred, "That player is jailed already.");
GetPlayerName(playerid, ppName, sizeof(ppName));
GetPlayerName(ReturnPlayer, ReturnUserName, sizeof(ReturnUserName));
format(str, sizeof(str), "You have been jailed for %d minutes!", JailMins[ReturnPlayer]);
SendClientMessage(ReturnPlayer, COLOR_RED, str);
SendClientMessage(ReturnPlayer, COLOR_RED, "Commands are disabled untill you get unjailed.");
format(str, sizeof(str), "Mod Message: %s (ID: %d) has jailed %s (ID: %d) for %d minutes.", ppName, playerid, ReturnUserName, ReturnPlayer, JailMins[ReturnPlayer]);
SendModMsg(mwhite, str);
JailTimerEx[ReturnPlayer] = SetTimerEx("JailTimer", 60000, 1, "d", ReturnPlayer);
SetPlayerInterior(ReturnPlayer,3);
SetPlayerVirtualWorld(ReturnPlayer,990);
PlayerIsJailed[ReturnPlayer] = 1;
return 1;
}
How to fix?