Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Saving

$
0
0
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
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.3796160.89051003.03);
    
vazenietimer[id] = SetTimerEx("vazenie",1000,true,"i",id);
    return 
1;


//public
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;


Thank you for helping me.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>