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

Give item function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-20-2011 , 21:42   Give item function
Reply With Quote #1

I tried to use this
PHP Code:
give_item(id"weapon_hegrenade"
then an error pop out said that was an undefined symbol . So I change it to player
PHP Code:
give_item(player"weapon_smokegrenade"
But it still say the same . How do I fix that ? Help please .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-20-2011 , 21:53   Re: Give item function
Reply With Quote #2

You need to use the variable that contains the player's entity number. You can't just use undefined variables. If you can't figure it out then you need to show the exact error and the WHOLE code.
__________________

Last edited by fysiks; 10-20-2011 at 21:54.
fysiks is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-20-2011 , 21:53   Re: Give item function
Reply With Quote #3

like 1 - 32 ? o.O
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-20-2011 , 21:54   Re: Give item function
Reply With Quote #4

Quote:
Originally Posted by JoKeR LauGh View Post
like 1 - 32 ? o.O
Show your code.
__________________
fysiks is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-20-2011 , 21:58   Re: Give item function
Reply With Quote #5

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Alot of nade"
#define VERSION "0.2"
#define AUTHOR "Alliedmodders"
#define WEP CSW_HEGRENADE
#define WEP_1 CSW_FLASHBANG
#define WEP_2 CSW_SMOKEGRENADE

/* CVars */

new cvar_he_count cvar_fb_count cvar_sg_count

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /nade""GiveNade")
    
    
cvar_he_count register_cvar("HE Count""15")
    
cvar_fb_count register_cvar("FB Count""15")
    
cvar_sg_count register_cvar("SG Count""15")
}

public 
GiveNade()
{
    
give_item(player"weapon_hegrenade")
    
cs_set_user_bpammo(idWEPget_pcvar_num(cvar_he_count)
    
give_item(player"weapon_flashbang")
    
cs_set_user_bpammo(idWEP_1get_pcvar_num(cvar_fb_count)
    
give_item(player"weapon_smokegrenade")
    
cs_set_user_bpammo(idWEP_2get_pcvar_num(cvar_sg_count)

__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Isaacd3d
BANNED
Join Date: Aug 2011
Location: :P
Old 10-20-2011 , 22:02   Re: Give item function
Reply With Quote #6

@JoKeR LauGh

Quote:
public GiveNade()
must be

Quote:
public GiveNade(id)
and change give_item(player -to-- give_item(id
Isaacd3d is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-20-2011 , 22:04   Re: Give item function
Reply With Quote #7

I know . I just forgot to put it . Thanks for remind but still errors
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Isaacd3d
BANNED
Join Date: Aug 2011
Location: :P
Old 10-20-2011 , 22:08   Re: Give item function
Reply With Quote #8

@JoKeR LauGh

maybe the error is this:

Quote:
cs_set_user_bpammo(id, WEP
and must be:

Quote:
cs_set_user_bpammo(id, CSW_HEGRENADE

Last edited by Isaacd3d; 10-20-2011 at 22:08.
Isaacd3d is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 10-20-2011 , 22:10   Re: Give item function
Reply With Quote #9

I already define it .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Isaacd3d
BANNED
Join Date: Aug 2011
Location: :P
Old 10-20-2011 , 22:11   Re: Give item function
Reply With Quote #10

Quote:
Originally Posted by JoKeR LauGh View Post
I already define it .
I no whats the problem!
Isaacd3d 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 13:53.


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