AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error 010: invalid function or declaration (https://forums.alliedmods.net/showthread.php?t=241501)

Thomeeek 06-04-2014 12:41

error 010: invalid function or declaration
 
I got error 010: invalid function or declaration when compiling this file.
Some can help me what is the problem?

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>
#include <cstrike>
#include <hamsandwich>
 
#define PLUGIN "Weapon Menu"
#define VERSION "1.0"
#define AUTHOR "Silent"
 
new gWPCT;
new 
gWPTE;
 
public 
plugin_init() {
   
register_plugin(PLUGINVERSIONAUTHOR)
   
register_clcmd("say /guns""fegyvermenu");
   
RegisterHam(Ham_Spawn,  "player""fegyvermenu"1)
   
register_logevent("logevent_end"2"1=Round_End");
}
 
public 
logevent_end()
{
   
gWPCT 0;
   
gWPTE 0;
}
 
 
public 
fegyvermenu(id)
{
   
cs_set_user_money(id0);   // Penz nullazasa
   
if(!user_has_weapon(idCSW_C4))
   {
   
strip_user_weapons(id);
   new 
menu menu_create("\rValassz packot!""handler");
   
menu_additem(menu"M4A1 PACK.""1"0);
   
menu_additem(menu"AK47 PACK.""2"0);
   
menu_additem(menu"AWP PACK.\y (elso 4 embernek)""3"0);
   
menu_additem(menu"MachineGun PACK.""4"0);
   
menu_additem(menu"AUG PACK.""5"0);
   
menu_additem(menu"FAMAS PACK.""6"0);
   
menu_additem(menu"Galil PACK.""7"0);
   
menu_additem(menu"SMG PACK.""8"0);
   
menu_additem(menu"Autoshotgun PACK. \d (xm1014)""9"0);
   
menu_additem(menu"Shotgun PACK.\d (m3)""10"0);
   
menu_additem(menu"Scout PACK.""11"0);
   
menu_setprop(menuMPROP_EXITMEXIT_ALL);
   
menu_display(idmenu);
   }
    else
        {
   new 
menu menu_create("\rValassz packot!""handler");
   
menu_additem(menu"M4A1 PACK.""1"0);
   
menu_additem(menu"AK47 PACK.""2"0);
   
menu_additem(menu"AWP PACK.\y (elso 4 embernek)""3"0);
   
menu_additem(menu"MachineGun PACK.""4"0);
   
menu_additem(menu"AUG PACK.""5"0);
   
menu_additem(menu"FAMAS PACK.""6"0);
   
menu_additem(menu"Galil PACK.""7"0);
   
menu_additem(menu"SMG PACK.""8"0);
   
menu_additem(menu"Autoshotgun PACK. \d (xm1014)""9"0);
   
menu_additem(menu"Shotgun PACK.\d (m3)""10"0);
   
menu_additem(menu"Scout PACK.""11"0);
   
menu_setprop(menuMPROP_EXITMEXIT_ALL);
   
menu_display(idmenu);
     }
}
 
public 
handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    switch(
key)
    {
   
   case 
1:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"weapon_m4a1");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy M4A1 packot!");
   }
   case 
2:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"weapon_ak47");
      
give_item(id"ammo_762nato");
      
give_item(id"ammo_762nato");
      
give_item(id"ammo_762nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy AK47 packot!");
   }
   case 
3:
   {
        new 
CsTeams:userTeam cs_get_user_team(id);
        if(
userTeam == CS_TEAM_CT)
        {
              if(
gWPCT 2)
              {
                 
                 
give_player_grenades(id);
                 
give_item(id"weapon_knife");
                 
give_item(id"weapon_awp");
                 
give_item(id"weapon_deagle");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_338magnum");
                 
give_item(id"ammo_338magnum");
                 
give_item(id"ammo_338magnum");
                 
ColorChat(idBLUE"[INFO]^x04 Kaptal egy AWP packot!");
                 
gWPCT++
              }
                            else
              {
                 
client_print(idprint_center"Csak 2 ember wpzhet csapatonkent!");
                 
fegyvermenu(id);
              }
        }
        if(
userTeam == CS_TEAM_T)
        {
             if(
gWPTE 2)
              {
                 
                 
give_player_grenades(id);
                 
give_item(id"weapon_knife");
                 
give_item(id"weapon_awp");
                 
give_item(id"weapon_deagle");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_50ae");
                 
give_item(id"ammo_338magnum");
                 
give_item(id"ammo_338magnum");
                 
give_item(id"ammo_338magnum");
                 
ColorChat(idBLUE"[INFO]^x04 Kaptal egy AWP packot!");
                 
gWPTE++
              }
                            else
              {
                 
client_print(idprint_center"Csak 2 ember wpzhet csapatonkent!");
                 
fegyvermenu(id);
              }
         }
 
   }
   case 
4:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"weapon_m249");
      
give_item(id"ammo_556natobox");
      
give_item(id"ammo_556natobox");
      
give_item(id"ammo_556natobox");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy MachineGun packot!");
   }  
   case 
5:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_aug");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy AUG packot!");
   }
   case 
6:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_famas");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy Famas packot!");
   }
   case 
7:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_galil");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
give_item(id"ammo_556nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy Galil packot!");
   }
   case 
8:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_mp5navy");
      
give_item(id"ammo_9mm");
      
give_item(id"ammo_9mm");
      
give_item(id"ammo_9mm");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy Smg packot!");
   }
   case 
9:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_xm1014");
      
give_item(id"ammo_buckshot");
      
give_item(id"ammo_buckshot");
      
give_item(id"ammo_buckshot");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy AutoShotgun packot!");
   }
   case 
10:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_m3");
      
give_item(id"ammo_buckshot");
      
give_item(id"ammo_buckshot");
      
give_item(id"ammo_buckshot");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy Shotgun packot!");
   }
   case 
11:
   {
     
      
give_player_grenades(id);
      
give_item(id"weapon_knife");
      
give_item(id"weapon_deagle");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae");
      
give_item(id"ammo_50ae")
      
give_item(id"weapon_scout");
      
give_item(id"ammo_762nato");
      
give_item(id"ammo_762nato");
      
give_item(id"ammo_762nato");
      
ColorChat(idBLUE"[INFO]^x04 Kaptal egy Scout packot!");
   }
    }
    return 
PLUGIN_HANDLED;
}
 
stock give_player_grenades(index)
{
   
give_item(index"weapon_hegrenade");
   
give_item(index"weapon_flashbang");
   
give_item(index"weapon_flashbang");
   
give_item(index"weapon_smokegrenade");
   
give_item(index"item_thighpack");
   
give_item(index"item_assaultsuit")



Flick3rR 06-04-2014 13:18

Re: error 010: invalid function or declaration
 
It compiles just fine for me. But the code could be made better at all.

Thomeeek 06-04-2014 14:57

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by Flick3rR (Post 2146763)
It compiles just fine for me. But the coude could be made better at all.

Can you upload the amxx somewhere to me?

WildCard65 06-04-2014 15:33

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by Thomeeek (Post 2146826)
Can you upload the amxx somewhere to me?

NOPE! No one (except moderators or people with equal rights, but they only do it on special reasons) can upload .amxx files ANYWAY on forums

Thomeeek 06-04-2014 15:39

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by WildCard65 (Post 2146844)
NOPE! No one (except moderators or people with equal rights, but they only do it on special reasons) can upload .amxx files ANYWAY on forums

Not on the forum. Somewhere else. I can't compile the .sma. Same error always. Can you or someone compile it, download up to a fileshare page and send me the link in private? It is not against the rules, is it?

YamiKaitou 06-04-2014 16:06

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by Thomeeek (Post 2146851)
Not on the forum. Somewhere else. I can't compile the .sma. Same error always. Can you or someone compile it, download up to a fileshare page and send me the link in private? It is not against the rules, is it?

Show us the error you are getting instead of asking someone to violate the GPL

Thomeeek 06-04-2014 16:59

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by YamiKaitou (Post 2146869)
Show us the error you are getting instead of asking someone to violate the GPL

http://content.screencast.com/users/...06-04_2258.png

YamiKaitou 06-04-2014 17:07

Re: error 010: invalid function or declaration
 
Seems you have the file encoded as UTF8 instead of UTF8 without BOM

Thomeeek 06-04-2014 17:20

Re: error 010: invalid function or declaration
 
Quote:

Originally Posted by YamiKaitou (Post 2146902)
Seems you have the file encoded as UTF8 instead of UTF8 without BOM

Worked!!!
Thank you very much Sir! :)


All times are GMT -4. The time now is 09:35.

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