12.03.2016, 23:11
What's wrong with this code?
PHP код:
#define RESPAWN_TIME 10 // mini
native IsValidVehicle(vehicleid);
forward VehicleRespawn();
public VehicleRespawn() {
for(new i = 0; i < MAX_VEHICLES; i ++ ) {
for(new o = 0; o < GetMaxPlayers(); o ++ ) {
if(!IsPlayerConnected(o)) continue;
if(IsAnyBodyInVehicle(i)) continue;
SetVehicleToRespawn(i);
}
}
return 1;
}
stock IsAnyBodyInVehicle(vid) {
for(new i = 0; i < GetMaxPlayers(); i ++ ) {
if(IsPlayerInVehicle(i, vid)) return 1;
}
return 0;
}
SetVehicleToRespawn(i)
{
for(new i = 435, j = GetVehiclePoolSize(); i <= j; i++) // vehicleids start at 435,this could be changed
{
VehicleRespawn(i);
}
}
Код:
C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(192) : error 021: symbol already defined: "SetVehicleToRespawn" C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(194) : error 010: invalid function or declaration C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(196) : error 021: symbol already defined: "VehicleRespawn" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.