A command resetting ALL vehicles (unoccupied) crashes the server...
#1

Good Evening, Okay I wouldn't normally post here about things like this, but I thought it was worth mentioning.

I have this command:
pawn Код:
dcmd_resetvehicles(playerid, params[])
{
    HMOD_CHECK;
    for(new i; i < MAX_VEHICLES; i++)
    {
        if(IsVehicleEmpty(i) == 1) SetVehicleToRespawn(i);
    }
    #pragma unused params
    return 1;
}
The function it uses:
pawn Код:
stock IsVehicleEmpty(vehicleid)
{
    for(new i; i < GetMaxPlayers(); i++)
    {
        if(GetPlayerVehicleID(i) == vehicleid) return 0;
        if(GetVehicleTrailer(GetPlayerVehicleID(i)) == vehicleid) return 0;
    }
    return 1;
}
However, it crashes the server?! It seems pretty straight forward and I don't see what could crash it.

I have also tried like this:
pawn Код:
dcmd_resetvehicles(playerid, params[])
{
     HMOD_CHECK;
     for(new i; i < MAX_VEHICLES; i++)
     {
          for(new p; p < GetMaxPlayers(); p++)
          {
               if(GetPlayerVehicleID(p) == i) continue;
           if(GetVehicleTrailer(GetPlayerVehicleID(p)) == i) continue;
               SetVehicleToRespawn(i);
          }
     }
     return 1;
}
This also crashes the server.
I do not see what could be crashing the server.

Also, I know it is this command. I enabled a "crash reporter", to log everything players do (I knew it wasn't in a recurring timer or something, as my test server which is locked; doesn't have this problem - and it doesn't get used that often, if at all)

The crash log has given the same results EVERY time.

Код:
AleXandeR(2): Called Command: /resetvehicles =# System Crash (HALT)
Ash(12): Called Command: /resetvehicles =# System Crash (HALT)
Joe(4): Called Command: /resetvehicles =# System Crash (HALT)
Slithisthroat(0)Called Command: /resetvehicles =# System Crash (HALT)
They are all on separate occasions.

Has anyone got any ideas, I just don't see what could be at fault.

Thanks,
Ash.
Reply


Messages In This Thread
A command resetting ALL vehicles (unoccupied) crashes the server... - by Ash. - 22.06.2011, 17:37
Re: A command resetting ALL vehicles (unoccupied) crashes the server... - by Sascha - 22.06.2011, 18:36
Re: A command resetting ALL vehicles (unoccupied) crashes the server... - by Ash. - 22.06.2011, 19:03
Re: A command resetting ALL vehicles (unoccupied) crashes the server... - by Ash. - 26.06.2011, 15:25

Forum Jump:


Users browsing this thread: 1 Guest(s)