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



IsPlayerInVehicle - ikbenremco - 04.05.2012

Hey I've made an trucker job but I want people to just /load with these vehicle ID's not from the ****** site.(look at picture)
Код:
CMD:load(playerid, params[]) {
                if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 638 || 639)
                if(jobVariables[playerVariables[playerid][pJob]][jJobType] != 5) return 1;
	            if(IsPlayerInRangeOfPoint(playerid, 5, -79.0338,-1583.1932,2.6107)) {
	            if(playerVariables[playerid][pCheckpoint] == 0) {
		        SendClientMessage(playerid, COLOR_WHITE, "Reach the checkpoint to collect your money");
		        playerVariables[playerid][pCheckpoint] = 8;
		        SetPlayerCheckpoint(playerid, 266.8578,1405.8596,10.4810, 10);
	        }
	    }


	    else {
	        format(szMessage, sizeof(szMessage), "You already have an active checkpoint (%s), reach it first, or /killcheckpoint.", getPlayerCheckpointReason(playerid));
			SendClientMessage(playerid, COLOR_WHITE, szMessage);
		}
		return 1;
    }
PS : The first's ID's :




Re: IsPlayerInVehicle - sleepysnowflake - 04.05.2012

The 'IDs' are not the cars MODEL IDs. They represent the cars' spawning order. The 'GetPlayerVehicleID(playerid)' gets those IDs so the cars can be differentiated.


Re: IsPlayerInVehicle - ikbenremco - 04.05.2012

But I want them both but that doenst work :S

Код:
if(!IsPlayerInVehicle(playerid, 638 | 639)) return 1;



Re: IsPlayerInVehicle - ViniBorn - 04.05.2012

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID) != 413) return 1;



Re: IsPlayerInVehicle - ikbenremco - 04.05.2012

I don't wanna disable all id 413 car's


Re: IsPlayerInVehicle - ViniBorn - 04.05.2012

Right, so replace

pawn Код:
if(!IsPlayerInVehicle(playerid, 638 | 639)) return 1;
pawn Код:
if(!IsPlayerInVehicle(playerid, 368 | 369)) return 1;



Re: IsPlayerInVehicle - ikbenremco - 04.05.2012

*facepalm so bad* +1 rep


Re: IsPlayerInVehicle - ikbenremco - 04.05.2012

It still doenst work.. when I do /load nothing happends


Re: IsPlayerInVehicle - MP2 - 04.05.2012

Use a clearer indentation style so you don't get confused. Debug your code with prints.


Re: IsPlayerInVehicle - ikbenremco - 04.05.2012

Sorry I don't understadn what you're saying right now I just need that you only can /load with vehicle ID :515 (changed my mind)