Jump to content
  • 0

problema comanda cu timer


Flyer-Satyr

Question

Salut , am o comanda la care am incercat sa adaug un timer , '

adica , daca a folosit comanda odata sa nu mai poata so foloseasca un timp ex 20 secunde.

am facut tot pana aici , dar am o problema , habar nu am cum sa ii scot comanda playeruui

cum pot face sa nu ii mai mearga comanda la player ?:|

adica , daca nu a expirat acel timp , playerul sa nu mai foata accesa comanda

va rog mult , ajutati-ma :D

metallica-logo.jpg
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

La inceputul comenzii pui:

[pawn]if( GetPVarInt(playerid, "ICanUseFirstCommand") == 1 ) return SendClientMessage(playerid, -1, "Poti sa folosesti aceasta comanda doar o data pe minut !");

SetPVarInt(playerid, "ICanUseFirstCommand", 1);

SetTimerEx("CanUseCommand", 60000 /*timpul in care nu poate folosi comanda din nou*/, 0, "i",  playerid);

[/pawn]

Undeva in script:

[pawn]forward CanUseCommand(playerid);

public CanUseCommand(playerid)

{

SendClientMessage(playerid, -1, "Acum poti folosi comanda NUME_COMANDA_LA_CARE_A_FOST_FOLOSIT_ASTA !");

SetPVarInt(playerid, "ICanUseFirstCommand", 0);

return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.