07.01.2013, 01:00
how to make that on command /time write how much I'm Jailed !?
commands
commands
Код:
CMD:prison(playerid,params[]) { new Random = random(sizeof(AreaSpawns)); new id,time,reason[128],string[128]; if(PlayerInfo[playerid][pAdmin] < 2) return 1; else if(sscanf(params,"uds[128]",id,time,reason)) return SendClientMessage(playerid, COLOR_RED, "/prison [ID/Ime igraca] [Vrijeme] [Razlog]"); else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Igrac nije na serveru"); else if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin])return SendClientMessage(playerid,COLOR_RED,""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Nemozes zatvoriti veci Admin Level"); else if(Jailed[id] == 1)return SendClientMessage(playerid,COLOR_RED,"Igrac je vec u zatvoru"); { format(string, sizeof(string), "Zatvoren si na %d minuta; Razlog: %s", time, reason); SendClientMessage(id, COLOR_RED, string); format(string, sizeof(string), "Admin %s je zatvorio igraca %s (ID:%d) na %d minuta; Razlog: %s", PlayerName(playerid), PlayerName(id), id, time, reason); SendAdminMessage(1, COLOR_CHARTREUSE, string); Jailed[id] = 1; SetPlayerInterior(id, 0); SetPlayerVirtualWorld(id, 0); SetPlayerFacingAngle(id, 360.0); SetPlayerPos(id, AreaSpawns[Random][0], AreaSpawns[Random][1], AreaSpawns[Random][2]); ResetPlayerWeapons(id); JailTimer[id] = SetTimer("Unjail",time*60000, false); } return 1; }
Код:
CMD:time(playerid, params[]) { new Sati, Min, Sec, string[128]; gettime(Sati, Min, Sec); format(string, sizeof(string), "Sada je: %i sati, %i minuta i %i sekundi.", Sati, Min, Sec); SendClientMessage(playerid, COLOR_GREEN, string); format(string, sizeof(string), "Jos ste zatvoreni %i minuta", JailTimer[playerid]); SendClientMessage(playerid, COLOR_GREEN, string); return 1; }