30.03.2014, 07:51
Код:
CMD:jail(playerid,params[]) { new TargetID; if(pInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid, COLOR_RED,""ERROR_MESSAGE""); new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /jail [playerid] [minutes] [reason]"); new targetname[MAX_PLAYER_NAME]; GetPlayerName(TargetID,targetname,24); if(caged[TargetID] == 1) return SCM(playerid,COLOR_RED,"The Player is Caged"); new string[128]; TargetID = strval(tmp); if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SendClientMessage(playerid, COLOR_RED, "* Player Is Not Connected."); if(pInfo[TargetID][Jailed] == 0) { new jtime = strval(tmp2); if(jtime == 0) jtime = 9999; pInfo[TargetID][JailTime] = jtime*1000*60; JailPlayer(TargetID); Jail1(TargetID); SetPlayerInterior(TargetID,10); SetPlayerPos(TargetID,227.5357,109.9256,999.0156); pInfo[TargetID][Jailed] = 1; if(jtime == 9999) { if(!strlen(params[strlen(tmp2)+1])) format(string,sizeof(string),"** JAIL: %s (%d) (Admin Jail)",targetname,TargetID); else format(string,sizeof(string),"** JAIL: %s (%d) (Admin Jail) (reason: %s)",targetname,TargetID, params[strlen(tmp)+1] ); } else { if(!strlen(tmp3)) format(string,sizeof(string),"** JAIL: %s (%d) (Admin Jail) for %d minutes",targetname,TargetID, jtime); else format(string,sizeof(string),"** JAIL: %s (%d) (Admin Jail) for %d minutes (reason: %s)",targetname,TargetID, jtime, params[strlen(tmp2)+strlen(tmp)+1] ); } return SendClientMessageToAll(COLOR_HOTPINK,string); } else return SendClientMessage(playerid, COLOR_RED, "Player is already in jail"); }