SA-MP Forums Archive
i want limit the player weapon - 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: i want limit the player weapon (/showthread.php?tid=354963)



i want limit the player weapon - peterory - 28.06.2012

i don't want the player use eagle and shotgun in the car
how to limit it


Re: i want limit the player weapon - Ainseri - 28.06.2012

Perhaps check the player's weapon when they press a key whilst in a vehicle? If it's bad, unequip it.


Re: i want limit the player weapon - MP2 - 28.06.2012

If you want SMG only:

Under OnPlayerStateChange:
pawn Код:
if(newstate == 3) // Entered a vehicle as a passenger
{
    // Drive-by weapons (SMG only)
    new weaponid, ammo;
    GetPlayerWeaponData(playerid, 4, weaponid, ammo); // 4 is the SMG slot
    SetPlayerArmedWeapon(playerid, weaponid);
}