/quitjob car respawn
#1

im having a problem with this /quitjob command, even if i am not in one of these vehicles:
pawn Код:
PizzaBike[0] || Trashmaster[0] || Sweeper[0] || Housetruck[0] || FedexC[0] || ComTruck[0] || Trucks[0])
it still ejects me and re spawns my car?

pawn Код:
if(strcmp(cmd, "/quitjob", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] > 0)
            {
                DisablePlayerCheckpoint(playerid);
                SendClientMessage(playerid, COLOR_WHITE, "[Phone] Boss Says : Alright man, was nice to work with you , hope to see you later");
                PlayerInfo[playerid][pJob] = 0;
                PlayerInfo[playerid][pPRoute] = 0;
                PlayerInfo[playerid][pTRoute] = 0;
                PlayerInfo[playerid][pvLoaded] = 0;
            }
            new playerstate = GetPlayerState(playerid);
            if (playerstate == PLAYER_STATE_DRIVER)
            {
            if(GetPlayerVehicleID(playerid) >= PizzaBike[0] || Trashmaster[0] || Sweeper[0] || Housetruck[0] || FedexC[0] || ComTruck[0] || Trucks[0])
            {
            RemovePlayerFromVehicle(playerid);
            SetVehicleToRespawn(GetPlayerVehicleID(playerid));
            }
        }
    }
return 1;
}
Reply
#2

tried this way and it still does same thing :S

pawn Код:
if(strcmp(cmd, "/quitjob", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] > 0)
            {
                DisablePlayerCheckpoint(playerid);
                SendClientMessage(playerid, COLOR_WHITE, "[Phone] Boss Says : Alright man, was nice to work with you , hope to see you later");
                PlayerInfo[playerid][pJob] = 0;
                PlayerInfo[playerid][pPRoute] = 0;
                PlayerInfo[playerid][pTRoute] = 0;
                PlayerInfo[playerid][pvLoaded] = 0;
            }
            new playerstate = GetPlayerState(playerid);
            if (playerstate == PLAYER_STATE_DRIVER)
            {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(vehicleid >= ComTruck[0] && vehicleid <= ComTruck[10] || Sweeper[0] && vehicleid <= Sweeper[8] || PizzaBike[0] && vehicleid <= PizzaBike[4] || Housetruck[0] && vehicleid <= Housetruck[5] || FedexC[0] && vehicleid <= FedexC[12] || Trashmaster[0] && vehicleid <= Trashmaster[2])
            {
            RemovePlayerFromVehicle(playerid);
            SetVehicleToRespawn(GetPlayerVehicleID(playerid));
            }
        }
    }
return 1;
}
Reply
#3

Hi, I used to have a similiar problem, fixed it by doing the following:
pawn Код:
if (playerstate == PLAYER_STATE_DRIVER)
            {
            if(GetPlayerVehicleID(playerid) == PizzaBike[0] || GetPlayerVehicleID(playerid) == Trashmaster[0] || GetPlayerVehicleID(playerid) == Sweeper[0] ||  GetPlayerVehicleID(playerid) == Housetruck[0] ||  GetPlayerVehicleID(playerid) == FedexC[0] ||  GetPlayerVehicleID(playerid) == ComTruck[0] ||  GetPlayerVehicleID(playerid) == Trucks[0])
            {
Can I know the reason you did >= and not ==? Maybe I could be able to help you.
Reply
#4

because i have multiple vehicles such as

pawn Код:
PizzaBike[0]
PizzaBike[1]
PizzaBike[2]
Reply
#5

bump..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)