20.08.2010, 11:07
(
Последний раз редактировалось James124; 20.08.2010 в 12:10.
)
pawn Код:
if(strcmp(cmd, "/jail", true) == 0){
if (adminlevel[playerid] < 2) return SendClientMessage(playerid,RED,"You Are Not Level 2 Admin!");
new tmp2[256], time[3], date[3],name[20];
new jailedname[MAX_PLAYER_NAME];
new jailedid;
new targetid = ReturnUser(tmp);
gettime(time[0],time[1],time[2]);
getdate(date[0],date[1],date[2]);
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
new id = strval(tmp);
new jtime = strval(tmp2);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid,ADMIN_RED,"[Usage:] /Jail [ID] [Time] [Reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,ADMIN_RED,"[Error:] Invalid ID");
GetPlayerName(id,name,sizeof(name));
new result[128];
result = strrest(cmdtext,idx);
if(!strlen(result)) return SendClientMessage(playerid,ADMIN_RED,"[Usage:] /Jail [ID] [Time] [Reason]");
jail[targetid] = 1;
OnPlayerJailed(targetid);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(jailedid, jailedname, sizeof(jailedname));
format(string,sizeof(string),"Administrator %s jailed %s. [ Time: %d ] [ Reson: %s - %d.%d.%d %d:%d:%d]",jtime,result,date[2],date[1],date[0],time[0],time[1],time[2]);
SendClientMessageToAll(COLOR_BLUE,string);
dini_IntSet(GetFile(playerid),"JTime",jtime);
dini_BoolSet(GetFile(playerid),"Jailed",true);
SetTimerEx("UnJail",jtime*1000*60,false,"%d",id);
format(string,sizeof(string),"~b~Time Left In Jail:%d",jtime);
GameTextForPlayer(id,string,1000,6);
return 1;}
if i do /jail 0 5 testing it says unknown command
with this i cannot jail anyone !
Please someone help
any help is greatly appreciated !