AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   errors with get_user_ammo (https://forums.alliedmods.net/showthread.php?t=28910)

wonsae 05-25-2006 17:04

errors with get_user_ammo
 
hi these are the errors i get
Code:

L 05/25/2006 - 17:02:24: Invalid weapon id 0
L 05/25/2006 - 17:02:24: [AMXX] Displaying debug trace (plugin "realmod.amxx")
L 05/25/2006 - 17:02:24: [AMXX] Run time error 10: native error (native "get_user_ammo")
L 05/25/2006 - 17:02:24: [AMXX]    [0] realmod.sma::ammo (line

and this is the part of the code
Code:
public ammo(id){     new weapon1, clip1, ammo1     get_user_ammo(id, weapon1, clip1, ammo1)     if(get_user_weapon(id,clip1,ammo1)){         client_print(id,print_chat,"[RealMod] You have about %i amount of ammo and %i amount of clips left",ammo1,clip1)     }     return PLUGIN_HANDLED }

whenever i call public ammo it shows the errors

Hawk552 05-25-2006 17:25

weapon in get_user_ammo is not passed by reference. This means that you'r e telling the plugin to get the ammo of weapon index 0, which will never work.

Run get_user_weapon instead.


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

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