vehicle checkpoint
#1

i use this streamer http://forum.sa-mp.com/index.php?topic=127905.0 for checkpoints. i want the checkpoint to enable when a player from a certain team enter on this checkpoint with a certain car. the OnPlayerEnterDynamicCP callback doesnt have vehicleid so i dont know how to make it.

pls help!!
Reply
#2

It doesn't matter if it has the vehicle id parameter on not
Код:
IsPlayerInAnyVehicle(playerid)
{
  new vehid;
  vehid=GetPlayerVehicleID(playerid);
}
There you have the vehicle id.
Reply
#3

i have this car "wangscar" how i can use the checkpoint enable only when this car enter on it! i dont know how to use your code. sry
Reply
#4

Quote:
Originally Posted by DJDhan
It doesn't matter if it has the vehicle id parameter on not
Код:
IsPlayerInAnyVehicle(playerid)
{
  new vehid;
  vehid=GetPlayerVehicleID(playerid);
}
There you have the vehicle id.
Use what he said, but make sure the vehicle you're trying to check has a ID (A unuiqe one, All vehicles have an ID)

pawn Код:
new vehid = GetPlayerVehicleID(playerid);

if(vehid != wangscar) return 0;

//Do what you want it to do here
GetPlayerVehicleID Returns the vehicle ID if playerid is in a vehicle, if he isn't in a vehicle, it returns 0.



1 line, works as good.
Reply
#5

the fuction isplayeronfoot exists?
Reply
#6

No but you can make it.

pawn Код:
stock IsPlayerOnfoot(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 1;
return 0;
}
Basic, returns 1 if he is onfoot, 0 if he's not, but I don't see much of a point.

But my point being, you don't have to be in a vehicle to check if you're in a vehicle, so it's useless checking if you're in a vehicle in the first place.

pawn Код:
new vehid = GetPlayerVehicleID(playerid);

if(!vehid) return 0;
If vehid returns 0, then he's not in a vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)