Raised This Month: $ Target: $400
 0% 

Include help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-06-2011 , 09:31   Include help
Reply With Quote #1

I made my first plugin, but I don't know if it works, because I can't compile it. It shows that weapon_m249 is undefined symbol, can you guys help me?

PS. Is my plugin correct? Or I did something wrong?

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <ammopacks>
#include <fun>

new Price

public plugin_init()
{
    
register_plugin("BB Machinegun""1.0""KviZ")
    
register_concmd("say /mg""Buy_Machinegun");
    
Price register_cvar("BB_Machinegun_Price""20")

}
public 
Buy_Machinegun(id)
{
    if (!
is_user_alive(id))
    return;

    new 
Get_AP BB_get_user_ap(id)

    if(
Get_AP >= get_pcvar_num(Price))
    {
        
BB_set_user_ap(idGet_AP get_pcvar_num(Price))
        
give_item(idweapon_m249)
    }
    else
    {
        
client_print(idprint_chat,"Neuztenka Ammo paketu | Not enough ammo packets")
    }

EDIT: I looked at other plugins and I fixed my problem, I didn't put ("") on the weapon_m249. And how can I make my weapon get 9999 ammo?

Last edited by KviZ; 04-06-2011 at 09:50.
KviZ is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 04-06-2011 , 10:02   Re: Include help
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=186
lis_16 is offline
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-06-2011 , 10:10   Re: Include help
Reply With Quote #3

I tried it before and got error while compiling...

error 035: argument type mismatch <argument 2>

Last edited by KviZ; 04-06-2011 at 10:16.
KviZ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-06-2011 , 11:16   Re: Include help
Reply With Quote #4

Show what you have tried instead of saying just it doesn't work.
__________________
Arkshine is offline
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-06-2011 , 12:42   Re: Include help
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <ammopacks>
#include <fun>

new Price

public plugin_init()
{
    
register_plugin("BB Machinegun""1.0""KviZ")
    
register_concmd("say /mg""Buy_Machinegun")
    
Price register_cvar("BB_Machinegun_Price""20")

}
public 
Buy_Machinegun(id)
{
    if (!
is_user_alive(id))
    return;

    new 
Get_AP BB_get_user_ap(id)

    if(
Get_AP >= get_pcvar_num(Price))
    {
        
BB_set_user_ap(idGet_AP get_pcvar_num(Price))
        
give_item(id"weapon_m249")
        
cs_set_user_bpammo(id,"weapon_m249",999)
    }
    else
    {
        
client_print(idprint_chat,"Neuztenka Ammo paketu | Not enough ammo packets")
    }

KviZ is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-06-2011 , 13:14   Re: Include help
Reply With Quote #6

PHP Code:
cs_set_user_bpammo(id,CSW_M249,999
?
Nyuszy is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 04-06-2011 , 13:28   Re: Include help
Reply With Quote #7

http://www.amxmodx.org/funcwiki.php?go=module&id=4

Here are names of weapons and other constants from cstrike.
lis_16 is offline
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-06-2011 , 16:26   Re: Include help
Reply With Quote #8

Thanks
KviZ is offline
Old 04-07-2011, 07:48
KviZ
This message has been deleted by KviZ.
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 19:46.


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