Problem with a variable
#1

I`m currently trying to do a respawn command, to respawn all the vehicles. The problem is that I get this error: error 021: symbol already defined: "i"

code:
Код:
dcmd_respawncars(playerid, params[])
{
	#pragma unused params
	for(new i=0, i <= MAX_VEHICLES, i++) SetVehicleToRespawn(i); //error line
	return 1;
}
I`ve tried to delete the "new" and use only "for(i=0 ..." but if I do that way I get two errors, on the same line, that "i" it`s not defined. Some help please?
Reply
#2

Код:
dcmd_respawncars(playerid, params[])
{
	#pragma unused params
	for(new i=0; i <= MAX_VEHICLES; i++) SetVehicleToRespawn(i); //error line
	return 1;
}
You used wrong tag.
use ; instead of ,
Reply
#3

Oh! How could I have missed that. Thanks!
Reply
#4

doesn't matter. Everyone can make a mistake right?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)