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

Symbol Already Defined


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 07-05-2016 , 14:00   Symbol Already Defined
Reply With Quote #1

Hello. Why do I get Symbol Already Defined on these 3?

PHP Code:
Print(id, const sMsg[], any:...)
{
    static 
i
    
id id get_Player();
    
    if( !
)
    {
        return;
    }
    
    new 
sMessage[256];
    new 
len formatex(sMessagecharsmax(sMessage), "^x01[HideNSeek MoneyMod]^x03 ");
    
vformat(sMessage[len], charsmax(sMessage) - lensMsg3);
    
sMessage[192] = '^0';
        
    static 
msgid_SayText;
    if( !
msgid_SayText )
    {
        
msgid_SayText get_user_msgid("SayText");
    }
    
    new const 
team_Names[][] =
    {
        
"",
        
"TERRORIST",
        
"CT",
        
"SPECTATOR"
    
};
        
    new 
sTeam get_user_team(i);
    
    
/* 0 = White || 1 = Red || 2 = Blue || 3 = White */
    
team_Info(iidteam_Names[2]);
        
    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTmsgid_SayText_id);
    
write_byte(i);
    
write_string(sMessage);
    
message_end();
        
    
team_Info(iidteam_Names[sTeam]);

PHP Code:
team_Info(receiversendersTeam[])
{
    static 
msgid_TeamInfo;
    if( !
msgid_TeamInfo )
    {
        
msgid_TeamInfo get_user_msgid("TeamInfo");
    }
    
    
message_begin(sender MSG_ONE_UNRELIABLE MSG_BROADCASTmsgid_TeamInfo_sender);
    
write_byte(receiver);
    
write_string(sTeam);
    
message_end();

PHP Code:
get_Player()
{
    for( new 
id 1id <= get_maxplayers(); id++ )
    {
        return 
id;
    }
    
    return 
0;

__________________

Last edited by Groven; 07-05-2016 at 14:01.
Groven is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-05-2016 , 14:13   Re: Symbol Already Defined
Reply With Quote #2

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Symbol is never used: "Print" on line 78
Warning: Symbol is never used: "get_Player" on line 78
Warning: Symbol is never used: "team_Info" on line 78
Header size:            116 bytes
Code size:               76 bytes
Data size:               92 bytes
Stack/heap size:      16384 bytes; estimated max. usage=778 cells (3112 bytes)
Total requirements:   16668 bytes

3 Warnings.
Done.
What? See if is a { without } on your plugin, this can cause the error.

I already had that error, because i open a { and dont use the } for close.
I dont know if is that your problem, but try it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 07-05-2016 at 14:14.
EFFx is offline
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 07-05-2016 , 14:41   Re: Symbol Already Defined
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Symbol is never used: "Print" on line 78
Warning: Symbol is never used: "get_Player" on line 78
Warning: Symbol is never used: "team_Info" on line 78
Header size:            116 bytes
Code size:               76 bytes
Data size:               92 bytes
Stack/heap size:      16384 bytes; estimated max. usage=778 cells (3112 bytes)
Total requirements:   16668 bytes

3 Warnings.
Done.
What? See if is a { without } on your plugin, this can cause the error.

I already had that error, because i open a { and dont use the } for close.
I dont know if is that your problem, but try it.
'

I sent you a PM.
__________________
Groven is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-05-2016 , 16:28   Re: Symbol Already Defined
Reply With Quote #4

AAhh

Because the cashmod include already have this.

Here's the .sma
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <cashmod>

#pragma semicolon 1

new const gszModel_Present[] = "models/present/w_present2.mdl";
new const 
gszClass_Present[] = "cashmod_present";


new 
Float:fMaxs[3] =

    
2.0
    
2.0
    
4.0 
};

new 
Float:fMins[3] = 

    -
2.0,
    -
2.0,
    -
4.0 
};

new const 
VERSION[] = "1.0.6";

public 
plugin_init()
{
    
register_plugin("HNS MoneyMod Present"VERSION"dinnk. [Idea from FakeNick");
    
    
register_clcmd("say /padd",         "spawn_present");
    
register_clcmd("say /pdelete",         "remove_present");
    
register_clcmd("say /pdeleteall",    "remove_all");
    
register_clcmd("say /psave",         "save");
    
register_clcmd("say /pload",        "load_all");
        
    
register_forward(FM_Touch"fwTouch");
    
register_event("HLTV""eventNewRound""a""1=0""2=0");
}

public 
plugin_precache()
{
    
precache_model(gszModel_Present);
}

public 
eventNewRound()
{
    new 
iEnt;
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"gszClass_Present)) )
    {
        
remove_entity(iEnt);
    }
    
    new 
szDir[64], szFile[128], szLine[256], fOrigin_File[3][32], szTemp[128], szTemp2[128];
    new 
iLeniLine;
    new 
Float:fOrigin[3];
    
    
get_configsdir(szDircharsmax(szDir));
    
    new 
szMap[32];
    
get_mapname(szMapcharsmax(szMap));
    
    
formatex(szFilecharsmax(szFile), "%s/presents/%s_origins.cfg"szDirszMap);

    if( !
file_exists(szFile) )
    {
        
server_print("No presents added @ %s"szMap);
        return 
PLUGIN_HANDLED;
    }
    
    
iLine read_file(szFilerandom_num(0file_size(szFile1)), szLinecharsmax(szLine), iLen);

    if( 
iLine )
    {
        
strtok(szLineszTempcharsmax(szTemp), szTemp2charsmax(szTemp2), '|'0);
            
        
parse(szTempfOrigin_File[0], charsmax(fOrigin_File[]), fOrigin_File[1], charsmax(fOrigin_File[]), fOrigin_File[2], charsmax(fOrigin_File[]));
        
fOrigin[0] = str_to_float(fOrigin_File[0]);
        
fOrigin[1] = str_to_float(fOrigin_File[1]);
        
fOrigin[2] = str_to_float(fOrigin_File[2]);
        
func_spawn(fOrigin);
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
load_all(id)
{
    if( !
access(idADMIN_KICK) )
    {
        
console_print(id"You don't have access to this command!");
        return 
PLUGIN_HANDLED;
    }
    
    new 
iEnt;
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"gszClass_Present)) )
    {
        
remove_entity(iEnt);
    }
    
    new 
szDir[64], szFile[128];
    
get_configsdir(szDircharsmax(szDir));
    
    new 
szMap[32];
    
get_mapname(szMapcharsmax(szMap));
    
    
formatex(szFilecharsmax(szFile), "%s/presents/%s_origins.cfg"szDirszMap);
    
    new 
sFileOrigin[3][32], iLine 0iLengthszText[256];
    new 
Float:fOrigin[3];
    
    while( 
read_file(szFileiLine++, szTextcharsmax(szText), iLength) )
    {
        
parse(szTextsFileOrigin[0], charsmax(sFileOrigin[]), sFileOrigin[1], charsmax(sFileOrigin[]), sFileOrigin[2], charsmax(sFileOrigin[]));
        
        
fOrigin[0] = str_to_float(sFileOrigin[0]);
        
fOrigin[1] = str_to_float(sFileOrigin[1]);
        
fOrigin[2] = str_to_float(sFileOrigin[2]);
        
        
func_spawn(fOrigin);
    }
    
    Print(
id"Loaded %i presents!"iLine);
    return 
PLUGIN_HANDLED;
}

public 
spawn_present(id)
{    
    if( !
access(id,ADMIN_KICK) )
    {
        return;
    }
    
    new 
Float:fOrigin[3], iOrigin[3];
    
get_user_origin(idiOrigin3);
    
    
IVecFVec(iOriginfOrigin);
    
    if( (
engfunc(EngFunc_PointContentsfOrigin) != CONTENTS_SKY) && (engfunc(EngFunc_PointContentsfOrigin) != CONTENTS_SOLID) )
    {
        
func_spawn(fOrigin);
        
        Print(
id"Successfully created present at origins: [^x04 %d^x03 ], [^x04 %d^x03 ], [^x04 %d^x03 ]!"iOrigin[0], iOrigin[1], iOrigin[2]);
        Print(
id"Now save the origins with command^x04 !psave^x03 !");
    }
    else
    {
        Print(
id"Sorry, that location isn't available!");
    }
}

public 
remove_present(id)
{
    if( !
access(id,ADMIN_KICK) )
    {
        return;
    }
    
    new 
iEntiBody;
    
get_user_aiming(idiEntiBody);
    
    if( 
pev_valid(iEnt) )
    {
        if( 
IsPresent(iEnt) )
        {
            
remove_entity(iEnt);
            Print(
id"Present successfully removed. Now refresh the save file with the command^x04 !psave^x03 !");
        }
        else
        {
            Print(
id"Sorry, you must aim at a present!");
        }
    }
}

public 
remove_all(id)
{
    if( !
access(idADMIN_KICK) )
    {
        return;
    }
    
    new 
iEnt = -1iCount;
    
iCount 0;
    
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"gszClass_Present)) )
    {
        
iCount++;
        
remove_entity(iEnt);
    }
    
    Print(
id"All presents removed!^x04 [^x03 Presents: %i^x04 ]"iCount);
    Print(
id"Now save the origins with the command^x04 !psave^x03 !");
}

public 
save(id)
{
    if( !
access(idADMIN_KICK) )
    {
        return;
    }
    
    new 
szDir[64], szFile[128], szBuffer[256], iEnt = -1iCount;
    new 
Float:fEntOrigin[3];
    
    
get_configsdir(szDircharsmax(szDir));
    
    new 
szMap[32];
    
get_mapname(szMapcharsmax(szMap));
    
    
formatex(szFilecharsmax(szFile), "%s/presents/%s_origins.cfg"szDirszMap);
    
    if( 
file_exists(szFile) )
    {
        
delete_file(szFile);
    }
    
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"gszClass_Present)) )
    {
        
pev(iEntpev_originfEntOrigin);
        
formatex(szBuffercharsmax(szBuffer), "%f %f %f"fEntOrigin[0], fEntOrigin[1], fEntOrigin[2]);
        
write_file(szFileszBuffer, -1);
        
iCount++;
    }
    
    Print(
id"Successfully saved all present origins^x04 (%d)^x03 for map^x04 %s^x03!"iCountszMap);
}

public 
func_spawn(Float:fOrigin[3])
{
    new 
iEnt create_entity("info_target");
    
    if( !
iEnt || !is_valid_ent(iEnt) )
    {
        Print(
0"Failed to create MoneyMod-Present!");
        return 
PLUGIN_HANDLED;
    }
        
    
entity_set_string(iEntEV_SZ_classnamegszClass_Present);
    
entity_set_int(iEntEV_INT_solidSOLID_BBOX);
    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_NONE);
    
entity_set_model(iEntgszModel_Present);
    
entity_set_size(iEntfMinsfMaxs);
    
entity_set_origin(iEntfOrigin);
    
    return 
PLUGIN_HANDLED;
}

public 
fwTouch(idiEnt)
{
    if( 
IsPresent(iEnt) )
    {
        new 
szName[32], iCash;
        
get_user_name(idszNamecharsmax(szName));
        
        
set_hudmessage(02550, -1.00.300.04.00.10.1, -1);
        if( 
random_num(1100) == )
        {
            
iCash 200;
            
show_hudmessage(0"LOL!! %s was lucky and gained a present with 500$!"szName);
        }
        else
        {
            
iCash random_num(50150);
            
show_hudmessage(0"%s: Found the present and was given %i$!"szNameiCash);
        }
        
        
cm_set_user_cash(id, (cm_get_user_cash(id) + iCash));
        
remove_entity(iEnt);
    }
    
    return 
FMRES_HANDLED;
}

bool:IsPresent(iEnt)
{
    if( 
is_valid_ent(iEnt) )
    {
        new 
szClass[35];
        
pev(iEntpev_classnameszClasscharsmax(szClass));
        if( 
equal(szClassgszClass_Present) )
        {
            return 
true;
        }
    }
    
    return 
false;

Just add your prefix at the inc file
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 07-05-2016 at 16:28.
EFFx 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 02:53.


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