Hello everyone,
I'm looking for a piece of code that would prevent a player from picking up weapon and ammo if MaxAmmo has been reached !
I hope someone can help me on that one
Cheers
Use a GM/PlayerCanPickupWeapon hook to prevent the player from picking up the weapon, and game.GetAmmoMax with Weapon/GetPrimaryAmmoType and Player/GetAmmoCount to check when the player reaches the max amount with your ammo type.
Thank you very much for your fast answer !
Perhaps I posted in the wrong section... as I'm a total stranger to lua I needed some example to work with. I would understand if it's too much to ask though.
Cheers
Check the example of the hook on the PlayerCanPickupWeapon page for how your code should kind-of look - you don't need an ENT function. Also, you cannot start variables with a number in Lua.
Sorry, you need to Log In to post a reply to this thread.