AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Include help (https://forums.alliedmods.net/showthread.php?t=154328)

KviZ 04-06-2011 09:31

Include help
 
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?

lis_16 04-06-2011 10:02

Re: Include help
 
http://www.amxmodx.org/funcwiki.php?go=func&id=186

KviZ 04-06-2011 10:10

Re: Include help
 
I tried it before and got error while compiling...

error 035: argument type mismatch <argument 2>

Arkshine 04-06-2011 11:16

Re: Include help
 
Show what you have tried instead of saying just it doesn't work.

KviZ 04-06-2011 12:42

Re: Include help
 
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")
    }



Nyuszy 04-06-2011 13:14

Re: Include help
 
PHP Code:

cs_set_user_bpammo(id,CSW_M249,999

?

lis_16 04-06-2011 13:28

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

Here are names of weapons and other constants from cstrike.

KviZ 04-06-2011 16:26

Re: Include help
 
Thanks :)


All times are GMT -4. The time now is 19:46.

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