Thread: [Solved] Compiler failder :(
View Single Post
Author Message
GaBy96
Member
Join Date: Oct 2012
Location: Spain
Old 11-04-2020 , 10:59   Compiler failder :(
Reply With Quote #1

I have this plugin:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include         <  amxmodx  >
#include         <  cstrike  >
#include <fakemeta>
#include         <  hamsandwich  >
#include         <  fakemeta_util  >
#include <dhudmessage>
#include <csx>
#include <fun>

#define TASKROUND 1231232135
#define TASKBOMB 42342523
#define         PLUGIN             "CS: Competitive Mod"
#define         VERSION         "0.Ox"
#define         AUTHOR             "Hades Ownage"

#define            szTag            "!g[!tCSGO]!n -"

#define            SWITCH_TIME        9    // seconds

new TeamScore ], SwitchedShowmsgg_nextMap[32], g_mapCycle[32], g_pos
new Float:C4_CountDownDelay
new Float:roundtime
new end
new hs[33]
native get_mvp()
native set_user_chest(id,nr)
native get_user_chest(id)

public 
plugin_init ( ) {
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_logevent "round_start"2"1=Round_Start" );
    
register_logevent "round_end"2"1=Round_End" );
    
    
register_event"HLTV""ev_RoundStart""a""1=0""2=0" ); 
    
register_event("DeathMsg""Event_DeathMsg""a")
    
    
set_task 1.0"CheckPlayers"___"b" );

    new 
szString[32], szString2[32], szString3[8]
    
    
get_localinfo("lastmapcycle"szString31)
    
parse(szStringszString231szString37)
    
g_pos str_to_num(szString3)
    
get_cvar_string("mapcyclefile"g_mapCycle31)

    if (!
equal(g_mapCycleszString2))
        
g_pos 0    // mapcyclefile has been changed - go from first

    
readMapCycle(g_mapCycleg_nextMap31)
    
set_cvar_string("amx_nextmap"g_nextMap)
    
format(szString331"%s %d"g_mapCycleg_pos)    // save lastmapcycle settings
    
set_localinfo("lastmapcycle"szString3)
}
public 
dff()
{
    
TeamScore ] = 15
}

public 
vote()
{
    
server_cmd("gal_startvote")
}
public 
round_start ( ) {
    
end 0

    
if (!Showmsg ) {
        
        
set_hudmessage 255850, -1.00.1316.02.0 );
        
show_hudmessage 0"MATCH STARTS!" );
        
        
set_pev 0pev_flagspev 0pev_flags ) & ~FL_FROZEN );
        
        
Showmsg 1;
        
set_task(60.0"vote")
        
    }
    
    if ( 
TeamScore ] == 15 && TeamScore ] < 15 ) {
        
        
set_hudmessage 255255255, -1.00.1316.03.0 );
        
show_hudmessage 0"RUNDA DECISIVA!" );
        
    }
    
    if ( 
TeamScore ] == 15 && TeamScore ] < 15 ) {
        
        
set_hudmessage 255255255, -1.00.1316.03.0 );
        
show_hudmessage 0"RUNDA DECISIVA!" );
        
    }
    
    if ( 
TeamScore ] == 15 && TeamScore ] == 14 ) {
        
        
set_hudmessage 255850, -1.00.1316.03.0 );
        
show_hudmessage 0"ULTIMA RUNDA!" );
        
    }
    
    if ( 
TeamScore ] == 15 && TeamScore ] == 14 ) {
        
        
set_hudmessage 255850, -1.00.1316.03.0 );
        
show_hudmessage 0"ULTIMA RUNDA!" );
        
    }
    
    if ( 
TeamScore ] + TeamScore ] == 14 && !Switched ) {
        
        
set_hudmessage 255850, -1.00.1516.03.0 );
        
show_hudmessage 0"ULTIMA RUNDA DIN PRIMA REPRIZA!" );
        
    }
    
remove_task(TASKROUND)
    
roundtime = (get_cvar_float("mp_roundtime")*60.0)-20.0
    set_task
(roundtime"startspk"TASKROUND)
}

public 
bomb_planted() {
    if(
end)
        return 
1;

    
remove_task(TASKROUND)
    
C4_CountDownDelay get_cvar_float("mp_c4timer")-10.0
    set_task
(C4_CountDownDelay"bomb"TASKBOMB)
    return 
0;
}

public 
round_end ( ) {

    if ( 
TeamScore ] + TeamScore ] >= 15 && !Switched ) {
        
        
set_hudmessage 255255255, -1.00.1316.05.00.00.0, -);
        
show_hudmessage 0"\\ TEAM SWITCH //" );
        
        
Switched 1;
        
TeamSwitch ( );
        
        new 
t_score TeamScore ];
        new 
ct_score TeamScore ];
        
        
TeamScore ] = ct_score;
        
TeamScore ] = t_score;
        
server_cmd "amx_cvar mp_startmoney 800" );
        
set_pev 0pev_flagspev 0pev_flags ) | FL_FROZEN );
    }
    
    if ( 
TeamScore ] >= 16 || TeamScore ] >= 16 ) {
        new 
mvp[32], tfragctfraghsntfrag[32], nctfrag[32], nhs[32]
        
tfrag tPower()
        
ctfrag ctPower()
        
hs hsPower()
        
get_user_name(get_mvp(), mvp31)
        
get_user_name(tfragntfrag31)
        
get_user_name(ctfragnctfrag31)
        
get_user_name(hsnhs31)
        if(!
tfrag)
            
formatex(ntfrag31"Nimeni")
        if(!
ctfrag)
            
formatex(nctfrag31"Nimeni")
        if(!
hs)
            
formatex(nhs31"Nimeni")
        if(!
get_mvp())
            
formatex(mvp31"Nimeni")
        
        
        if ( 
TeamScore ] > TeamScore ] ) {
            
            
set_hudmessage 25500, -1.00.1316.0360.0 );
            
show_hudmessage 0"TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s"mvp,ntfrag,nctfrag,nhs );
            for(new 
x32x++)
            {
                if(!
is_user_connected(x))
                    continue;
            }
            
            
set_task (5.0"changelevel_" );
            
        }
        
        else if ( 
TeamScore ] > TeamScore ] ) {
            
set_hudmessage 0127255, -1.00.1316.0360.0 );
            
show_hudmessage 0"ANTI TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s"mvp,ntfrag,nctfrag,nhs );
            for(new 
x32x++)
            {
                if(!
is_user_connected(x))
                    continue;
            }
            
set_task 5.0"changelevel_" );
            
        }
        
        else if ( 
TeamScore ] == TeamScore ] ) {
            
            
set_hudmessage 255850, -1.00.1316.0360.0 );
            
show_hudmessage 0"MECI EGAL!^n^nCele mai multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s"mvp,ntfrag,nctfrag,nhs );
            
set_task 5.0"changelevel_" );
            
        }
        
        
set_pev 0pev_flagspev 0pev_flags ) | FL_FROZEN );
    }
    
end 1
    
    
return 1;
    
}
stock tPower()
{
    new 
iPlayers[32], iNumidiiLeaderiPacksmvt
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers
        
if(cs_get_user_team(id) == CS_TEAM_T)
        {
            
iPacks get_user_frags(id)

            if(
iPacks >= 50)
                
set_user_chest(id,get_user_chest(id)+1)

            if ( 
iPacks mvt )
            {
                
mvt iPacks
                iLeader 
id
            
}
        }
    }
    return 
iLeader
}
stock ctPower()
{
    new 
iPlayers[32], iNumidiiLeaderiPacksmvt
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers
        
if(cs_get_user_team(id) == CS_TEAM_CT)
        {
            
iPacks get_user_frags(id)
            if(
iPacks >= 50)
                
set_user_chest(id,get_user_chest(id)+1)

            if ( 
iPacks mvt )
            {
                
mvt iPacks
                iLeader 
id
            
}
        }
    }
    return 
iLeader
}
public 
Event_DeathMsg()
{
    new 
id read_data(1)
    new 
hss read_data(3);
    if(
is_user_connected(id) && hss)
        
hs[id]++
}

stock hsPower()
{
    new 
iPlayers[32], iNumidiiLeaderiPacksmvt
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers
        iPacks 
hs[id]
        
        if ( 
iPacks mvt )
        {
            
mvt iPacks
            iLeader 
id
        
}
    }
    return 
iLeader
}
public 
changelevel_ ( ) {
    new 
name[32]
    
    
getNextMapName(name31);
    
    
server_cmd "amx_map %s",name );
    
}

public 
t_win ( )
{
    
TeamScore ]++;
    
remove_task(TASKBOMB)
    
remove_task(TASKROUND)
}
public 
ct_win ( )
{
    
TeamScore ]++;
    
remove_task(TASKBOMB)
    
remove_task(TASKROUND)
}

public 
TeamSwitch ( ) {
    
    new 
iPlayers[  32  ],  iNum;
    
get_players(  iPlayers,  iNum );
    
    if(  
iNum  
    {
        new  
id;
        
        for(  --
iNum;  iNum  >=  0;  iNum--  ) 
        {
            
id  =  iPlayers[  iNum  ];
            
BeginDelayedTeamChange(  id  );
            
        }
    }
    
}

public 
BeginDelayedTeamChange (  id  ) {
    
    switch(  
id  
    { 
        case  
1..6:  set_task(  0.1"ChangeUserTeamWithDelay",  id  +  112233  ); 
            case  
7..13:  set_task(  0.2"ChangeUserTeamWithDelay",  id  +  112233  ); 
            case  
14..20:  set_task(  0.3"ChangeUserTeamWithDelay",  id  +  112233  ); 
            case  
21..26:  set_task(  0.4"ChangeUserTeamWithDelay",  id  +  112233  ); 
            case  
27..32:  set_task(  0.5"ChangeUserTeamWithDelay",  id  +  112233  ); 
        } 
}

public 
ChangeUserTeamWithDelay (  id  ) {
    
    
id  -=  112233;
    if(  !
is_user_connected(  id  )  )  return 1;
    
    
cs_set_user_money id800 1);
    
    switch(  
cs_get_user_team(  id  )   ) 
    {
        
        case  
CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
            case  
CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
            
    }
    
    
server_cmd "sv_restart 1" );
    
    return 
0;
}

public 
CheckPlayers ( ) {
    
    
    
set_dhudmessage 51102153, -1.00.0616.03.0 );
        
    if ( 
TeamScore ] + TeamScore ] + 10 )
        
show_dhudmessage 0"Runda: %d"TeamScore ] + TeamScore ] + );
    else if ( 
TeamScore ] + TeamScore ] + == 10 )
        
show_dhudmessage 0"Runda: 10" );
    else
        
show_dhudmessage 0"Runda: 0%d"TeamScore ] + TeamScore ] + );
        
    
set_dhudmessage 1562550, -1.00.0916.03.0 );
    
show_dhudmessage 0"T: %s%d         -         CT: %s%d"TeamScore ] > "" "0"TeamScore ], TeamScore ] > "" "0"TeamScore ] );
}

stock PlayerAllCount Team ) {
    
    new 
iCount 0
    for ( new 
1<= get_maxplayers ( ); i++) {
        
        if ( 
is_user_connected ) && get_user_team ) == Team )
            ++
iCount
    } 
    
    return 
iCount
}  

stock bacon_strip_weapon(indexweapon[]) {
    if(!
equal(weapon"weapon_"7)) 
        return 
0
    
    
static weaponid 
    weaponid 
get_weaponid(weapon)
    
    if(!
weaponid
        return 
0
    
    
static weaponent
    weaponent 
fm_find_ent_by_owner(-1weaponindex)
    
    if(!
weaponent
        return 
0
    
    
if(get_user_weapon(index) == weaponid
        
ExecuteHamB(Ham_Weapon_RetireWeaponweaponent)
    
    if(!
ExecuteHamB(Ham_RemovePlayerItemindexweaponent)) 
        return 
0
    
    ExecuteHamB
(Ham_Item_Killweaponent)
    
set_pev(indexpev_weaponspev(indexpev_weapons) & ~(1<<weaponid))
    
    return 
1
}

stock chat_color(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[320]
    
vformat(msg190input3)
    
replace_all(msg190"!g""^4")
    
replace_all(msg190"!n""^1")
    
replace_all(msg190"!t""^3")
    
replace_all(msg190"!t2""^0")
    
    if (
id)
        
players[0] = id;
    else
        
get_players(playerscount"ch")
    
    
    for (new 
0counti++)
    {
        if (
is_user_connected(players))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players)
            
write_byte(players)
            
write_string(msg)
            
message_end()
        }
    }
}

getNextMapName(szArg[], iMax)
{
    new 
len get_cvar_string("amx_nextmap"szArgiMax)
    
    if (
ValidMap(szArg)) return len
    len 
copy(szArgiMaxg_nextMap)
    
set_cvar_string("amx_nextmap"g_nextMap)
    
    return 
len
}


stock bool:ValidMap(mapname[])
{
    if ( 
is_map_valid(mapname) )
    {
        return 
true;
    }
    
// If the is_map_valid check failed, check the end of the string
    
new len strlen(mapname) - 4;
    
    
// The mapname was too short to possibly house the .bsp extension
    
if (len 0)
    {
        return 
false;
    }
    if ( 
equali(mapname[len], ".bsp") )
    {
        
// If the ending was .bsp, then cut it off.
        // the string is byref'ed, so this copies back to the loaded text.
        
mapname[len] = '^0';
        
        
// recheck
        
if ( is_map_valid(mapname) )
        {
            return 
true;
        }
    }
    
    return 
false;
}

new 
g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"

readMapCycle(szFileName[], szNext[], iNext)
{
    new 
b0iMaps 0
    
new szBuffer[32], szFirst[32]

    if (
file_exists(szFileName))
    {
        while (
read_file(szFileNamei++, szBuffer31b))
        {
            if (!
isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
            
            if (!
iMaps)
                
copy(szFirst31szBuffer)
            
            if (++
iMaps g_pos)
            {
                
copy(szNextiNextszBuffer)
                
g_pos iMaps
                
return
            }
        }
    }

    if (!
iMaps)
    {
        
log_amx(g_warningszFileName)
        
get_mapname(szFirst31)
    }

    
copy(szNextiNextszFirst)
    
g_pos 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
And i try to compile and i have this problem:
PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// competitive.sma
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(22) : error 021: symbol already defined: "set_dhudmessage"
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(27) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(37) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(40) : error 021: symbol already defined: "show_dhudmessage"
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(45) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(47) : warning 218: old style prototypes used with optional semicolumns
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(48) : error 054: unmatched closing brace
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(49) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(52) : warning 218: old style prototypes used with optional semicolumns
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(53) : error 054: unmatched closing brace
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(54) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(57) : error 021: symbol already defined: "get_players"
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(59) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(61) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(66) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(68) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(70) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(73) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(82) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(85) : warning 218: old style prototypes used with optional semicolumns
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(86) : error 054: unmatched closing brace
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(87) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(89) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(93) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(98) : error 021: symbol already defined: "vformat"
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(99) : warning 218: old style prototypes used with optional semicolumns
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(100) : error 054: unmatched closing brace
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(103) : error 021: symbol already defined: "ArrayDestroy"
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(106) : error 010: invalid function or declaration
// C:\Users\Personal Computer\Desktop\Compiler 1.8.3\include\dhudmessage.inc(109) : error 025: function heading differs from prototype
//
// Compilation aborted.
// 26 Errors.
// Could not locate output file compiled\competitive.amx (compile failed).
//
// Compilation Time: 3.41 sec
// ----------------------------------------

Press enter to exit ... 
and my dhud include:
PHP Code:
#if defined _dhudmessage_included
    #endinput
#endif
  #if AMXX_VERSION_NUM < 183
    #include <dhudmessage>
#endif 

#define _dhudmessage_included

#include <amxmodx>

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

stock set_dhudmessagered 0green 160blue 0Float:= -1.0Float:0.65effects 2Float:fxtime 6.0Float:holdtime 3.0Float:fadeintime 0.1Float:fadeouttime 1.5bool:reliable false )
{
    
#define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
    #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

    
__dhud_color       pack_colorclamp_bytered ), clamp_bytegreen ), clamp_byteblue ) );
    
__dhud_x           _:x;
    
__dhud_y           _:y;
    
__dhud_effect      effects;
    
__dhud_fxtime      _:fxtime;
    
__dhud_holdtime    _:holdtime;
    
__dhud_fadeintime  _:fadeintime;
    
__dhud_fadeouttime _:fadeouttime;
    
__dhud_reliable    _:reliable;

    return 
1;
}

stock show_dhudmessageindex, const message[], any:... )
{
    new 
buffer128 ];
    new 
numArguments numargs();

    if( 
numArguments == )
    {
        
send_dhudMessageindexmessage );
    }
    else if( 
index || numArguments == )
    {
        
vformatbuffercharsmaxbuffer ), message);
        
send_dhudMessageindexbuffer );
    }
    else
    {
        new 
playersList32 ], numPlayers;
        
get_playersplayersListnumPlayers"ch" );

        if( !
numPlayers )
        {
            return 
0;
        }

        new Array:
handleArrayML ArrayCreate();

        for( new 
2jnumArgumentsi++ )
        {
            if( 
getarg) == LANG_PLAYER )
            {
                while( ( 
buffer] = getarg1j++ ) ) ) {}
                
0;

                if( 
GetLangTransKeybuffer ) != TransKey_Bad )
                {
                    
ArrayPushCellhandleArrayMLi++ );
                }
            }
        }

        new 
size ArraySizehandleArrayML );

        if( !
size )
        {
            
vformatbuffercharsmaxbuffer ), message);
            
send_dhudMessageindexbuffer );
        }
        else
        {
            for( new 
0jnumPlayersi++ )
            {
                
index playersList];

                for( 
0sizej++ )
                {
                    
setargArrayGetCellhandleArrayML), 0index );
                }

                
vformatbuffercharsmaxbuffer ), message);
                
send_dhudMessageindexbuffer );
            }
        }

        
ArrayDestroyhandleArrayML );
    }

    return 
1;
}

stock send_dhudMessage( const index, const message[] )
{
    
message_begin__dhud_reliable ? ( index MSG_ONE MSG_ALL ) : ( index MSG_ONE_UNRELIABLE MSG_BROADCAST ), SVC_DIRECTOR_index );
    {
        
write_bytestrlenmessage ) + 31 );
        
write_byteDRC_CMD_MESSAGE );
        
write_byte__dhud_effect );
        
write_long__dhud_color );
        
write_long__dhud_x );
        
write_long__dhud_y );
        
write_long__dhud_fadeintime );
        
write_long__dhud_fadeouttime );
        
write_long__dhud_holdtime );
        
write_long__dhud_fxtime );
        
write_stringmessage );
    }
    
message_end();

__________________

We have over 400 skins on weapons and 5 types for hands!
Costumes for players!
New style for Top15 and stats!
Kill marks, molotov!
And many more are waiting for you to play!

Last edited by GaBy96; 11-06-2020 at 10:54.
GaBy96 is offline
Send a message via Skype™ to GaBy96