Raised This Month: $51 Target: $400
 12% 

[HELP] Run time error 10 (cs_set_weapon_ammo)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-16-2018 , 19:43   [HELP] Run time error 10 (cs_set_weapon_ammo)
Reply With Quote #1

Quote:
[CSTRIKE] Non-player entity 0 out of range
[AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
[AMXX] [0] gn_retake.sma::playerSpawned (line 127)
Code:
public playerSpawned(id) {     if (cs_get_user_team(id) == CS_TEAM_T)     {         cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_ak47",id),30)         cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_glock18",id),20)         cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_usp",id),12)     } }

This function does what I want it to do but I get this error and I would like to know why.
I'm not sure if the weapon entity index is set incorrectly or if the issue is that noone has a specific weapon.

Thanks!
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-16-2018 at 19:52.
GoldNux is offline
 



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 06:04.


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