Raised This Month: $ Target: $400
 0% 

errors with get_user_ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 05-25-2006 , 17:04   errors with get_user_ammo
Reply With Quote #1

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
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-25-2006 , 17:25  
Reply With Quote #2

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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