07.06.2015, 20:26
Hello!
I was trying to make respawn all vehicles command!
But fail!
Whats wrong?
CMD:rav(playerid, params[])
{
if(pInfo[playerid][Admin] >= 3)
{
for(new i = 1; i < MAX_VEHICLES; i++)
if(!IsVehicleOccupied(i))
{
GameTextForAll("An Adminstrator had respawned all unused vehicles!", 5000, 0);
SetVehicleToRespawn(i);
}
}
else
SendClientMessage(playerid, COLOR_RED, "You must be admin to access this command!");
}
stock IsVehicleOccupied(iVehicleID, iSeatID = 0)
{
[6968]foreach(Player, i);
[6969]if(GetPlayerVehicleID(i) == iVehicleID && GetPlayerVehicleSeat(i)== iSeatID) return 1;
return 0;
}
Errors:
C:\Users\----\Desktop\Sa-Mp Server\filterscripts\ssss.pwn(696 : error 017: undefined symbol "foreach"
C:\Users\----\Desktop\Sa-Mp Server\filterscripts\ssss.pwn(6969) : error 017: undefined symbol "i"
I was trying to make respawn all vehicles command!
But fail!
Whats wrong?
CMD:rav(playerid, params[])
{
if(pInfo[playerid][Admin] >= 3)
{
for(new i = 1; i < MAX_VEHICLES; i++)
if(!IsVehicleOccupied(i))
{
GameTextForAll("An Adminstrator had respawned all unused vehicles!", 5000, 0);
SetVehicleToRespawn(i);
}
}
else
SendClientMessage(playerid, COLOR_RED, "You must be admin to access this command!");
}
stock IsVehicleOccupied(iVehicleID, iSeatID = 0)
{
[6968]foreach(Player, i);
[6969]if(GetPlayerVehicleID(i) == iVehicleID && GetPlayerVehicleSeat(i)== iSeatID) return 1;
return 0;
}
Errors:
C:\Users\----\Desktop\Sa-Mp Server\filterscripts\ssss.pwn(696 : error 017: undefined symbol "foreach"
C:\Users\----\Desktop\Sa-Mp Server\filterscripts\ssss.pwn(6969) : error 017: undefined symbol "i"