28.08.2011, 00:53
@4ir-W4ys: c'mon watch ur words dude! He wants to learn, well maybe he could have get smarter by using the search function first but lets be honest, we all used to be noobs having alot of questions and this forums is here to have the opportunity to ask questions! No need to get rude!
About the 3rd question:
You can set up a simple timer. Or didnt i get u ordinary?
Hope this helps
//edit: fixed some mistakes
About the 3rd question:
You can set up a simple timer. Or didnt i get u ordinary?
pawn Code:
new countdown[MAX_PLAYERS];
new countdownkill[MAX_PLAYERS];
//OnPlayerConnect
countdown[playerid]=0;
//As soon as u put the player into the vehicle u can start the timer:
countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);
//somewhere else in ur script:
forward counter(playerid);
public counter(playerid)
{
if(countdown[playerid] > 0)
{
new string[45];
countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);
countdown[playerid] ++;
//in addition u can format the string and show the player for how long hes already active:
format(string, sizeof(string), "alive for: %d seconds!", countdown[playerid]);
GameTextForPlayer(playerid,string,1000,5);
//ofc u can also use texdraws or clientmessages to make a cool looking timer ;)
}
return 1;
}
//After death just reset the timer and let it start over again:
KillTimer(countdownkill[playerid]);
countdownkill[playerid]=-1;
countdown[playerid]=0;
countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);
//edit: fixed some mistakes