AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reload on Low... (https://forums.alliedmods.net/showthread.php?t=13812)

Tupac 05-30-2005 08:27

Reload on Low...
 
Hi, new to amxx :) just wondering now use to these functions...

i want to make it so u cannot reload when ammo == 1-50...
not sure how to tell u...

i have the whole script but this is the part unsure of...
Code:
if(get_user_button(id) & IN_RELOAD) { if (cs_get_weapon_ammo(id, 1-50)) (get_user_button(id) & IN_RELOAD==0)

I know that the cs_get_weapon_ammo tell us how much a player has
in his clip but i wanna be able to tell if he has any ammo from 1 to 50...
not sure how any ideas plz :)

Thanks again enjoy my stay here.

Front Line 05-30-2005 08:29

Why would you want to know this...?
sorry not able to help pm v3x hes very knowledgable...

Tupac 05-30-2005 09:08

Just an idea...anyone help please?

v3x 05-30-2005 12:27

Backpack ammo or what? I've combined the clip ammo + the bp ammo and came up with this:
Code:
#include <amxmodx> #include <engine> public plugin_init()     register_plugin("No reload on low amt","0.1","v3x") public client_prethink(id) {     if(get_user_button(id)&IN_RELOAD) {             new weapon,clip,ammo         get_user_ammo(id,weapon,clip,ammo)         if((clip+ammo) <= 50)             return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
If that doesn't work, we can try an event like so:
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("No reload on low amt","0.1","v3x")     register_event("CurWeapon","weapon_event","be") } public weapon_event(id) {     if(get_user_button(id)&IN_RELOAD) {             new weapon,clip,ammo         get_user_ammo(id,weapon,clip,ammo)         if((clip+ammo) <= 50)             return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
Let me know the outcome. :)

Front Line 05-31-2005 03:14

i thought he was trying to only make it reload when on 0 bullets...
therefore u can't reload between 1-50?


All times are GMT -4. The time now is 16:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.