PDA

View Full Version : IsPlayerInVehicle


ikbenremco
04/05/2012, 04:54 PM
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 :

http://i47.tinypic.com/2coiqv9.png

sleepysnowflake
04/05/2012, 05:02 PM
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.

ikbenremco
04/05/2012, 05:04 PM
But I want them both but that doenst work :S

if(!IsPlayerInVehicle(playerid, 638 | 639)) return 1;

ViniBorn
04/05/2012, 05:10 PM
if(GetVehicleModel(GetPlayerVehicleID) != 413) return 1;

ikbenremco
04/05/2012, 05:18 PM
I don't wanna disable all id 413 car's

ViniBorn
04/05/2012, 05:21 PM
Right, so replace

if(!IsPlayerInVehicle(playerid, 638 | 639)) return 1;
if(!IsPlayerInVehicle(playerid, 368 | 369)) return 1;

ikbenremco
04/05/2012, 05:34 PM
*facepalm so bad* +1 rep

ikbenremco
04/05/2012, 06:07 PM
It still doenst work.. when I do /load nothing happends

MP2
04/05/2012, 06:24 PM
Use a clearer indentation style so you don't get confused. Debug your code with prints.

ikbenremco
04/05/2012, 06:27 PM
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)

MP2
04/05/2012, 06:28 PM
Do you mean vehicle ID or model ID?

ikbenremco
04/05/2012, 06:57 PM
Model that you can find on samp wiki.