vehicle checkpoint - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: vehicle checkpoint (
/showthread.php?tid=153485)
vehicle checkpoint -
billiout - 09.06.2010
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!!
Re: vehicle checkpoint -
DJDhan - 09.06.2010
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.
Re: vehicle checkpoint -
billiout - 09.06.2010
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
Re: vehicle checkpoint -
Joe_ - 09.06.2010
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.
Re: vehicle checkpoint -
billiout - 09.06.2010
the fuction isplayeronfoot exists?
Re: vehicle checkpoint -
Joe_ - 09.06.2010
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.