Some help needed...
#1

Alright, I'm making a RespawnAllVehicles function and the command basically stops once it gets to a certain line.

pawn Код:
public RespawnAllVehicles()
{
    new VehicleCannotBeRespawned[MAX_VEHICLES], VehiclePath[128];
    for(new i; i <= MAX_PLAYERS; i++) {
        if(IsPlayerInAnyVehicle(i)) {
            VehicleCannotBeRespawned[GetPlayerVehicleID(i)] = 1;
        }
    }
    for(new vehid; vehid <= MAX_VEHICLES; vehid++) {
        print("Loop");
        format(VehiclePath, sizeof(VehiclePath), "\\Vehicles\\%d.ini", vehid);
        print("Format");
        if(dini_Exists(VehiclePath)) {
            print("Exists");
            if(VehicleCannotBeRespawned[vehid] == 0) {
                print("Check");
                SetVehiclePos(vehid,
                dini_Float(VehiclePath, "SpawnX"),
                dini_Float(VehiclePath, "SpawnY"),
                dini_Float(VehiclePath, "SpawnZ")), print("Move");
                SetVehicleZAngle(vehid, dini_Float(VehiclePath, "SpawnA"));
                print("Angle");
            }
        }
    }
    SendClientMessageToAll(COLOR_YELLOW, "[SERVER] - All unused vehicles have been respawned.");
    AllVehiclesAreRespawning = 0;
    return 1;
}
As you can see, I'm using prints to see which line to server gets to before the command stopped. I saw Loop, Format, Exists, Check but Move wasn't there. Therefore it's the SetVehiclePos command which is causing the server to stop. Any ideas how to fix this?

pawn Код:
SetVehiclePos(vehid, dini_Float(VehiclePath, "SpawnX"), dini_Float(VehiclePath, "SpawnY"), dini_Float(VehiclePath, "SpawnZ"));
Any help would be appreciated,

-Conroy
Reply


Messages In This Thread
Some help needed... - by Conroy - 31.07.2010, 21:59
Re: Some help needed... - by straco - 31.07.2010, 22:10
Re: Some help needed... - by Conroy - 31.07.2010, 22:13
Re: Some help needed... - by straco - 31.07.2010, 22:18
Re: Some help needed... - by Conroy - 31.07.2010, 22:20
Re: Some help needed... - by Vince - 31.07.2010, 22:26
Re: Some help needed... - by Conroy - 31.07.2010, 23:24
Re: Some help needed... - by straco - 31.07.2010, 23:33
Re: Some help needed... - by Conroy - 31.07.2010, 23:37
Re: Some help needed... - by Daren_Jacobson - 31.07.2010, 23:37

Forum Jump:


Users browsing this thread: 2 Guest(s)