SA-MP Forums Archive
[HELP]ZCMD: /jail {O.o} - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]ZCMD: /jail {O.o} (/showthread.php?tid=252172)



[HELP]ZCMD: /jail {O.o} - Gertin - 30.04.2011

Hey i wan't to know, how to make that, like i type /jail [ID] [REASON] [TIME] , then that time what i typed, that time he was jailed ? After that time he is back. I have that cmd :
pawn Код:
COMMAND:jail(playerid,params[])
{
    new PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
    new tmp[256], Index, string[256];
    tmp = strtok(params,Index), playerid2 = strval(tmp);
    GetPlayerName(playerid2,on,sizeof(on));
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(Account[playerid][Level] < 2) return SendClientMessage(playerid,RED,"{990000}You need to be level 2 to use this command!");
    if(sscanf(params, "us[256]", playerid2,params[2])) return SendClientMessage(playerid, COLOR_GREEN, "{009900}Usage: /Jail [ID] [REASON]");
    if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,ORANGE,"{FF9900}Player is not connected!");
    format(string,sizeof(string),"{990000}%s {9933CC} has jailed by Administrator{990000} %s {9933CC} | Reason:{990000} %s",on,PlayerName,params[2]);
    SendClientMessageToAll(Blue,string);
    SetPlayerVirtualWorld(playerid2, 101);
    TogglePlayerControllable(playerid2, 0);
    PlayerPlaySound(playerid, 1076, 0.0, 0.0, 0.0);
    format(string,sizeof(string),"{33CC00}[ADMIN]:{990000} %s {33CC00}is jailed by Administrator {990000}%s",on,PlayerName);
    AdminCChat(COLOR_LIGHTRED,string,1);
    return 1;
}
Srry for a bad english