Greedings,again me and i have got again problem...I made jail system on minutes...but i dont know how to save it,how many minutes remaining...Please help me how to make it...
There is a code..
//command
//public
Thank you for helping me.
There is a code..
//command
PHP Code:
CMD:jail(playerid,params[])
{
new id,dovod[225],minuty,string[128];
if(AdminLevel[playerid] < 2)return SendClientMessage(playerid,COLOR_RED,"[!] {FFFFFF}Nemá oprávnenie na tento príkaz");
if(sscanf(params,"uis[225]",id,minuty,dovod))return SendClientMessage(playerid,COLOR_RED,"[!] {FFFFFF}Musí zadat /jail [ID] [Cas v minutách] [Dôvod]");
if(jail[id] > 0)return SendClientMessage(playerid,COLOR_RED,"[!] {FFFFFF}Tento hrác u je vo väzení");
format(string,sizeof(string),"%s{FF3300}%s(ID:%d) ťa dal do väzenia na %i minút [Dôvod: %s]",GetPlayerAdminTitle(playerid),Meno(playerid),playerid,minuty,dovod);
SendClientMessage(id,COLOR_RED,string);
jail[id] = gettime() + 60*minuty;
PlayerTextDrawShow(playerid,VazenieTimer[playerid][0]);
PlayerTextDrawShow(playerid,VazenieTimer[playerid][1]);
SetPlayerInterior(id,3);
SetPlayerPos(id,198.3796, 160.8905, 1003.03);
vazenietimer[id] = SetTimerEx("vazenie",1000,true,"i",id);
return 1;
}
PHP Code:
public vazenie(playerid)
{
if(jail[playerid] > gettime())
{
new string[128];
format(string,sizeof(string),"%s",TimeConvert(jail[playerid] - gettime()));
PlayerTextDrawSetString(playerid,VazenieTimer[playerid][0],string);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Odpykal si si trest");
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1109.2490,-1796.0345,16.5938);
KillTimer(vazenietimer[playerid]);
PlayerTextDrawHide(playerid,VazenieTimer[playerid][0]);
PlayerTextDrawHide(playerid,VazenieTimer[playerid][1]);
}
return 1;
}