Raised This Month: $ Target: $400
 0% 

error 010: invalid function or declaration


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thomeeek
Junior Member
Join Date: Nov 2011
Location: At Home
Old 06-04-2014 , 12:41   error 010: invalid function or declaration
Reply With Quote #1

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")


Last edited by Thomeeek; 06-04-2014 at 12:50.
Thomeeek is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-04-2014 , 13:18   Re: error 010: invalid function or declaration
Reply With Quote #2

It compiles just fine for me. But the code could be made better at all.
__________________

Last edited by Flick3rR; 06-04-2014 at 15:37.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Thomeeek
Junior Member
Join Date: Nov 2011
Location: At Home
Old 06-04-2014 , 14:57   Re: error 010: invalid function or declaration
Reply With Quote #3

Quote:
Originally Posted by Flick3rR View Post
It compiles just fine for me. But the coude could be made better at all.
Can you upload the amxx somewhere to me?
Thomeeek is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-04-2014 , 15:33   Re: error 010: invalid function or declaration
Reply With Quote #4

Quote:
Originally Posted by Thomeeek View Post
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

Last edited by WildCard65; 06-04-2014 at 15:33.
WildCard65 is offline
Thomeeek
Junior Member
Join Date: Nov 2011
Location: At Home
Old 06-04-2014 , 15:39   Re: error 010: invalid function or declaration
Reply With Quote #5

Quote:
Originally Posted by WildCard65 View Post
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?

Last edited by Thomeeek; 06-04-2014 at 15:49.
Thomeeek is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-04-2014 , 16:06   Re: error 010: invalid function or declaration
Reply With Quote #6

Quote:
Originally Posted by Thomeeek View Post
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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Thomeeek
Junior Member
Join Date: Nov 2011
Location: At Home
Old 06-04-2014 , 16:59   Re: error 010: invalid function or declaration
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Show us the error you are getting instead of asking someone to violate the GPL
Thomeeek is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-04-2014 , 17:07   Re: error 010: invalid function or declaration
Reply With Quote #8

Seems you have the file encoded as UTF8 instead of UTF8 without BOM
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Thomeeek
Junior Member
Join Date: Nov 2011
Location: At Home
Old 06-04-2014 , 17:20   Re: error 010: invalid function or declaration
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
Seems you have the file encoded as UTF8 instead of UTF8 without BOM
Worked!!!
Thank you very much Sir!
Thomeeek 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 09:35.


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