Jump to content

[REZOLVAT] Timer intre comenzi


rAcs
 Share

Recommended Posts

pui de exemplu, timerheal[playerid] = 30; cand foloseste comanda

 

la timerul global al serverului pui

 

if(timerheal[playerid] >= 1) timerheal[playerid] --;

 

la  cmd:

 

if(timerheal[playerid] >= 1) SCM(playerid, -1, "Nu poti folosi aceasta comanda inca");

 

sau format(string,sizeof(string), "Poti folosi aceasta comanda peste %s secunde!", FormatNumber(timerheal[playerid]));

SCM(playerid, -1, string);

 

Nu am inteles nimic. 

Poti fi mai explicit de atat?

Link to comment
Share on other sites

  • Administrator

pui de exemplu, timerheal[playerid] = 30; cand foloseste comanda

 

la timerul global al serverului pui

 

if(timerheal[playerid] >= 1) timerheal[playerid] --;

 

la  cmd:

 

if(timerheal[playerid] >= 1) SCM(playerid, -1, "Nu poti folosi aceasta comanda inca");

 

sau format(string,sizeof(string), "Poti folosi aceasta comanda peste %s secunde!", FormatNumber(timerheal[playerid]));

SCM(playerid, -1, string);

Metode antice.

 

Setezi un PVAR dupa ce a folosit comanda:
 
SetPVarInt(playerid, "deelayComanda", gettime() + secunde);
 
Faci o verificare la comanda pe care tocmai a folosit-o:
 
if(gettime() < GetPVarInt(playerid, "deelayComanda")) return SCMf(playerid, COLOR_EROARE, "Eroare: Poti folosi aceasta comanda in %d secunde.", GetPVarInt(playerid, "deelayComanda") - gettime());
 
Iar la final stergi PVAR-ul, mai exact la OnPlayerDisconnect( playerid, reason )
 
DeletePVar(playerid, "deelayComanda");

Sper ca ai inteles. :wink:

Link to comment
Share on other sites

 

Metode antice.

 

Setezi un PVAR dupa ce a folosit comanda:
 
SetPVarInt(playerid, "deelayComanda", gettime() + secunde);
 
Faci o verificare la comanda pe care tocmai a folosit-o:
 
if(gettime() < GetPVarInt(playerid, "deelayComanda")) return SCMf(playerid, COLOR_EROARE, "Eroare: Poti folosi aceasta comanda in %d secunde.", GetPVarInt(playerid, "deelayComanda") - gettime());
 
Iar la final stergi PVAR-ul, mai exact la OnPlayerDisconnect( playerid, reason )
 
DeletePVar(playerid, "deelayComanda");

Sper ca ai inteles. :wink:

 

oh good, best

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...