/quitjob car respawn - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /quitjob car respawn (
/showthread.php?tid=454561)
/quitjob car respawn -
Donvalley - 29.07.2013
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;
}
Re: /quitjob car respawn -
Donvalley - 29.07.2013
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;
}
Re: /quitjob car respawn -
JimmyCh - 29.07.2013
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.
Re: /quitjob car respawn -
Donvalley - 29.07.2013
because i have multiple vehicles such as
pawn Код:
PizzaBike[0]
PizzaBike[1]
PizzaBike[2]
Re: /quitjob car respawn -
Donvalley - 30.07.2013
bump..