Raised This Month: $ Target: $400
 0% 

[HELP] Run time error 10 (cs_set_weapon_ammo)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-18-2018 , 08:19   Re: [HELP] Run time error 10 (cs_set_weapon_ammo)
Reply With Quote #1

Quote:
Originally Posted by CrazY. View Post
Honestly I have not seen anything informing to ignore this error on the site that Bugsy given to you...
Well, I am far from a programmer and just starting out.
My plugin works without any issues, and I simply thought that it would return 0 if it didnt find any weapon entity.
There was not much further explanation, I still don't know how to properly check if an entity exists..

Something like this?

PHP Code:
            new ak47Ent;
            new 
glock18Ent;
            new 
uspEnt;
            
ak47Ent find_ent_by_owner(-1"weapon_ak47"id);
            
glock18Ent find_ent_by_owner(-1"weapon_glock18"id);
            
uspEnt find_ent_by_owner(-1"weapon_usp"id);
            if(
pev_valid(ak47Ent))
            {
                
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_ak47",id),30)
            }
            if(
pev_valid(glock18Ent))
            {
                
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_glock18",id),20)
            }
            if(
pev_valid(uspEnt))
            {
                
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_usp",id),12)
            } 
__________________
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-18-2018 at 08:34.
GoldNux is offline
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 04:36.


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