[HELP] checkpoint 'for loop' countdown
#1

new string[30];
for(new i = 30; i >= 0; i--){
format(string, sizeof(string), "CP countdown: %i", i);
gMyText1 = TextDrawCreate(280, 340, string);
}

In game it just shows "CP countdown: 1" then it freezes there.. when I leave the cp and reenter it, it doesnt even show anything..

{
if(checkpointid = Checkpoint[1]){
if(gTeam[playerid] == TEAM_GANG){
SetTimer("Timer", 1, true);
}
}
return 1;
}

NOTE: Checkpoint[1] is that checkpoint id that I'm using atm
Reply
#2

Код:
new i = 30;
gMyText1 = TextDrawCreate(280,340,"CP countdown: 30");
while(i >= 0)
{
i--;
format(string, sizeof(string), "CP countdown: %i", i);
TextDrawSetString(gMyText1,string);
}
Reply
#3

It only shows "CP countdown: -1"
Any idea?
Reply
#4

I did
public Timer()
{
new string[50];
new i = 30;
for(i; i>=30; i--){
format(string, sizeof(string), "CP countdown: %i", i);
gMyText1 = TextDrawCreate(250,420,string);
TextDrawShowForAll(gMyText1);
}
return 1;
}

Everything else is fine but it says "CP countdown: 30" and doesnt go down. So the fault is in the for loop I think. I've done the forwarding of the function and stuff so thats all cool.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)