SA-MP Forums Archive
Problem - 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: Problem (/showthread.php?tid=609338)



Problem - Ugaustin - 11.06.2016

hi , can someone tell me what could cause.. so if a player high jacks my car i want to lose job and vehicle to respawn .. and none of them work why??

PHP Code:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
                        {
                            new 
veh GetPlayerVehicleID(playerid);
                            if(
PlayerInfo[playerid][pJob] == 20)
                            {
                                if(
IsAFarmerCar(vehi))
                                {
                                    
SendClientMessage(playeridCOLOR_RED"You exited the vehicle !");
                                    
SetVehicleToRespawn(veh);
                                    
printf("Testing");
                                  }
                            }
                        } 



Re: Problem - Ugaustin - 11.06.2016

anyone ??


Re: Problem - Adeon - 11.06.2016

Code:
if(IsAFarmerCar(vehi))
shouldn't it be veh instead of vehi ?

Code:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT) 
                        { 
                            new veh = GetPlayerVehicleID(playerid);
also how can you get vehicle info if the player is on foot ?


Re: Problem - Ugaustin - 11.06.2016

if he is in car and exits..


Re: Problem - Vince - 11.06.2016

That's why OnPlayerExitVehicle exists.


Re: Problem - Ugaustin - 11.06.2016

but if I get car jacked??or player gets removed from vehicle??