IsPlayerInVehicle
#1

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 :

Reply
#2

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.
Reply
#3

But I want them both but that doenst work :S

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

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

I don't wanna disable all id 413 car's
Reply
#6

Right, so replace

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

*facepalm so bad* +1 rep
Reply
#8

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

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

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)