SA-MP Forums Archive
Add VehicleModel ? - 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: Add VehicleModel ? (/showthread.php?tid=346782)



Add VehicleModel ? - Ajez - 30.05.2012

pawn Код:
new newkeys,l,u;
GetPlayerKeys(playerid, newkeys, l, u);
new i;
if(Holding(KEY_FIRE))
{
       if(GetPlayerWeapon(playerid) == 42)
       {
with the code above, if I can use code like this?

pawn Код:
new newkeys,l,u;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerKeys(playerid, newkeys, l, u);
new i;
if(Holding(KEY_FIRE)
{
       if(GetPlayerWeapon(playerid) == 42 && (GetVehicleModel(vehicleid) == 407))
       {



Re: Add VehicleModel ? - Ballu Miaa - 30.05.2012

You can use it like this.

pawn Код:
if(GetPlayerWeapon(playerid) == 42 && (GetVehicleModel(vehicleid) == 407))
This will check for both of these conditions to be true.


Re: Add VehicleModel ? - mati233 - 30.05.2012

I'm not sure if it will work, I think no weapon is returned when you are inside a vehicle...