07.03.2010, 01:44
well create a timer like this
then create the "refillcar"
note that this will refill and not stop refilling, to make it stop after x times you need to create 3 new variables, 1 for the amount it needs to refill, another to count up to that number and another one for the timer.
like this.
top of the script
then in the /refill command
then in the timer
Код:
SetTimerEx("refillcar",1000,1,"d",playerid);
Код:
forward refillcar(playerid); public refillcar(playerid) { Fuel[playerid]++; }
like this.
top of the script
Код:
new refilltimes[MAX_PLAYERS]; new refillcount[MAX_PLAYERS]; new refilltimer[MAX_PLAYERS];
Код:
refilltimes[playerid] = 100-Fuel[playerid]; refillcount[playerid] = 0; killtimer(refilltimer[playerid]); refilltimer[playerid] = SetTimerEx("refillcar",1000,1,"d",playerid);
Код:
if(refillcount[playerid] == refilltimes[playerid]) killtimer(refilltimer[playerid]); refillcount[playerid]++;