Old bug - Not fixed
#1

This was attempted to fix in RC2 of 0.3e.

"- Fixed bug where the player might get teleported to 0,0,0 if they're surfing a vehicle that gets respawned/deleted."

This doesn't work for trains with no carridges.
Reply
#2

bump.
Reply
#3

pawn Code:
stock SetVehicleToRespawnEx(vehicleid)
{
    if(vehicleid == INVALID_VEHICLE_ID) return SetVehicleToRespawn(vehicleid);
    if(GetVehicleModel(vehicleid) == 537 || GetVehicleModel(vehicleid) == 538 || GetVehicleModel(vehicleid) == 449)
    {
        for (new i = 0; i != MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID && GetPlayerSurfingVehicleID(playerid) == vehicleid)
                {
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x+2.5, x, y, z+0.5);
                   
                    continue;
                }
            }
        }
       
        return SetVehicleToRespawn(vehicleid);
    }
}

#if defined _ALS_SetVehicleToRespawn
  #undef SetVehicleToRespawn
#else
#define _ALS_SetVehicleToRespawn
#endif

#define SetVehicleToRespawn SetVehicleToRespawnEx

stock DestroyVehicleEx(vehicleid)
{
    if(vehicleid == INVALID_VEHICLE_ID) return DestroyVehicle(vehicleid);
    if(GetVehicleModel(vehicleid) == 537 || ( GetVehicleModel (vehicleid )) == 538 || GetVehicleModel(vehicleid) == 449)
    {
        for (new i = 0; i != MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID && GetPlayerSurfingVehicleID(playerid) == vehicleid)
                {
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x+2.5, x, y, z+0.5);

                    continue;
                }
            }
        }

        return DestroyVehicle(vehicleid);
    }
}

#if defined _ALS_DestroyVehicle
  #undef DestroyVehicle
#else
#define _ALS_DestroyVehicle
#endif

#define DestroyVehicle DestroyVehicleEx
Basically set's their position off a bit and completes the operation, this isn't tested but is a possible fix.
Reply
#4

Quote:
Originally Posted by Abagail
View Post
pawn Code:
stock SetVehicleToRespawnEx(vehicleid)
{
    if(vehicleid == INVALID_VEHICLE_ID) return SetVehicleToRespawn(vehicleid);
    if(vehicleid == 537 || vehicleid == 538 || vehicleid == 449)
    {
        for (new i = 0; i != MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID && GetPlayerSurfingVehicleID(playerid) == vehicleid)
                {
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x+2.5, x, y, z+0.5);
                   
                    continue;
                }
            }
        }
       
        return SetVehicleToRespawn(vehicleid);
    }
}

#if defined _ALS_SetVehicleToRespawn
  #undef SetVehicleToRespawn
#else
#define _ALS_SetVehicleToRespawn
#endif

#define SetVehicleToRespawn SetVehicleToRespawnEx

stock DestroyVehicleEx(vehicleid)
{
    if(vehicleid == INVALID_VEHICLE_ID) return DestroyVehicle(vehicleid);
    if(vehicleid == 537 || vehicleid == 538 || vehicleid == 449)
    {
        for (new i = 0; i != MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID && GetPlayerSurfingVehicleID(playerid) == vehicleid)
                {
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x+2.5, x, y, z+0.5);

                    continue;
                }
            }
        }

        return DestroyVehicle(vehicleid);
    }
}

#if defined _ALS_DestroyVehicle
  #undef DestroyVehicle
#else
#define _ALS_DestroyVehicle
#endif

#define DestroyVehicle DestroyVehicleEx
Basically set's their position off a bit and completes the operation, this isn't tested but is a possible fix.
What about when OnVehicleDeath is called because the car died or went into water.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)