getting vehicle name - 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: getting vehicle name (
/showthread.php?tid=513679)
getting vehicle name -
saikumar - 17.05.2014
is there any function like
isplayerinvehicleinfernus bla bla..
i want the code that to know is the player in infernus or not.
thanks in advance
Re: getting vehicle name -
iZN - 17.05.2014
You can make any macro like this?
pawn Код:
#define IsPlayerInInfernus(%0) (GetVehicleModel(%0) == 411)
Sample usage:
pawn Код:
// check if the player is sitting in infernus
static pvID = GetPlayerVehicleID(playerid);
if(IsPlayerInInfernus(pvID))
{
}
// check if the player is not sitting in infernus
static pvID = GetPlayerVehicleID(playerid);
if(!IsPlayerInInfernus(pvID))
{
}
Re: getting vehicle name -
rickisme - 17.05.2014
pawn Код:
stock IsPlayerInVehicle(playerid, model)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehmodel == model)
{
return 1;
}
}
return 0;
}