AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=43)
-   -   compiling error. (https://forums.alliedmods.net/showthread.php?t=196127)

Shahruh10 09-15-2012 18:09

compiling error.
 
I got a compiling error,

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// sh_monitor.sma
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(199) : error 070
: rational number support was not enabled
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(307) : error 017
: undefined symbol "set_task"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(449) : error 017
: undefined symbol "get_user_name"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(450) : error 017
: undefined symbol "get_user_authid"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(451) : error 017
: undefined symbol "get_user_userid"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(452) : error 017
: undefined symbol "format"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(455) : error 017
: undefined symbol "copy"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(458 ) : error 017
: undefined symbol "strlen"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(464) : error 017
: undefined symbol "format"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(465) : error 017
: undefined symbol "server_print"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(466) : error 017
: undefined symbol "log_message"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(142) : error 017: undefine
d symbol "register_plugin"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(145) : error 017: undefine
d symbol "register_event"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(149) : error 017: undefine
d symbol "register_event"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(157) : error 017: undefine
d symbol "CreateHudSyncObj"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(159) : error 017: undefine
d symbol "engfunc"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(162) : error 017: undefine
d symbol "set_pev"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(162) : warning 215: expres
sion has no effect
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(162) : error 001: expected
token: ";", but found ")"
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(162) : error 029: invalid
expression, assumed zero
// C:\Users\Shahruh10\Desktop\compiler\sh_monito r.sma(162) : fatal error 107: to
o many error messages on one line
//
// Compilation aborted.
// 21 Errors.
// Could not locate output file compiled\sh_monitor.amx (compile failed).
//
// Compilation Time: 0,03 sec
// ----------------------------------------

Press enter to exit ...



Know anything about this?

PandaDnB 09-15-2012 18:13

Re: compiling error.
 
No one can't help if you don't post .sma

Torge 09-15-2012 18:15

Re: compiling error.
 
Don't create 2 threads with the same problem ...

This should fix your problem:

PHP Code:

/* AMX Mod X script.
*
*   SuperHero Monitor (sh_monitor.sma)
*   Copyright (C) 2006 vittu
*
*   This program is free software; you can redistribute it and/or
*   modify it under the terms of the GNU General Public License
*   as published by the Free Software Foundation; either version 2
*   of the License, or (at your option) any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License
*   along with this program; if not, write to the Free Software
*   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
*   In addition, as a special exception, the author gives permission to
*   link the code of this program with the Half-Life Game Engine ("HL
*   Engine") and Modified Game Libraries ("MODs") developed by Valve,
*   L.L.C ("Valve"). You must obey the GNU General Public License in all
*   respects for all of the code used other than the HL Engine and MODs
*   from Valve. If you modify this file, you may extend this exception
*   to your version of the file, but you are not obligated to do so. If
*   you do not wish to do so, delete this exception statement from your
*   version.
*
****************************************************************************
*
*               ******** AMX Mod X 1.80 and above Only ********
*               ***** SuperHero Mod 1.2.0 and above Only ******
*               *** Must be loaded after SuperHero Mod core ***
*
*  Description:
*     This plugin will display a hud message to the user showing their true
*      current health and armor just above chat messages. Might possibly
*      add other things into the message in the future, suggestions?
*
*  Why:
*     When a users health is over 255 in the HUD it loops over again
*      starting from 0. When a users armor is over 999 it does not show the
*      correct number rather it shows a hud symbol and the last few digits.
*
*  Who:
*     This plugin is intended for SuperHero Mod servers that have heroes that
*      make it possible to have more then 255 hp or more then 999 armor.
*
*  Known Issues:
*     If using the REPLACE_HUD option, clients radar is also removed from the
*      hud. If lots of hud messages are being displayed at the same time the
*      monitor may flash briefly, but does not happen enough to be concerned.
*
****************************************************************************
*
*  http://shero.rocks-hideout.com/
*
*  Notes: Currently there are no cvars, message will not display when sh mod is off.
*          However, loop will still run incase shmod is enabled again. Plugin tested
*          at 800x600 to 1280x1024.
*
*  Changelog:
*   v1.5 - vittu - 10/28/10
*        - Fixed possible issue with get_players array size.
*
*   v1.4 - vittu - 10/19/09
*        - Changed to make each item optional
*        - Added option to show when godmode is on
*        - Added option to show information of player being spectated (similar to wc3ft)
*        (Update required use of SuperHero Mod 1.2.0 or above, also made the code ugly.)
*
*   v1.3 - vittu - 07/06/07
*        - Fixed bug forgot to make sure entity was valid in think forward
*           - Added requested option to show Gravity and Speed, set as disabled define because it
*              gets checked constantly
*
*   v1.2 - vittu - 06/13/07
*        - Conversion to Fakemeta
*           - Optimization of code all around, much improved
*
*   v1.1 - vittu - 06/11/06
*        - Used a hud sync object instead of taking up a single hud channel (suggested by jtp10181)
*        - Added option to remove the hud's hp/ap and place message there (suggested by Freecode)
*
*   v1.0 - vittu - 06/05/06
*        - Initial Release
*
*  Thanks:
*        - OneEyed for the basis of an entity as a task
*
*  To-Do:
*        - Possibly add other features instead of just HP/AP display,
*              ie. secondary message showing info of user you aim at
*           - Maybe add a file to allow user to save location of message
*           - Maybe add a check to verify users xp has loaded to show spec info (requires change in SH core)
*
****************************************************************************/

/****** Changeable defines requie recompile *******/


/********* Uncomment to replace HUD hp/ap **********/
//#define REPLACE_HUD

/********* Uncomment the ones you want to display **********/
#define MONITOR_HP
#define MONITOR_AP
//#define MONITOR_GRAVITY
//#define MONITOR_SPEED
//#define MONITOR_GODMODE
#define MONITOR_SPEC


/************* Do Not Edit Below Here **************/


#include <superheromod>
#include <amxmodx>

#if defined MONITOR_HP || defined MONITOR_SPEC
    
new UserHealth[SH_MAXSLOTS+1]
#endif

#if defined MONITOR_AP || defined MONITOR_SPEC
    
new UserArmor[SH_MAXSLOTS+1]
#endif

#if defined MONITOR_SPEC
    
new ServerMaxLevel
#endif

#if defined REPLACE_HUD
    
new MsgHideWeapon
    
#define HIDE_HUD_HEALTH (1<<3)
#endif

new MonitorHudSync
new const TaskClassname[] = "monitorloop"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
register_plugin("SuperHero Monitor""1.5""vittu")

    
#if defined MONITOR_HP || defined MONITOR_SPEC
        
register_event("Health""health_change""b")
    
#endif

    #if defined MONITOR_AP || defined MONITOR_SPEC
        
register_event("Battery""armor_change""b")
    
#endif

    #if defined REPLACE_HUD
        
MsgHideWeapon get_user_msgid("HideWeapon")
        
register_message(MsgHideWeapon"msg_hideweapon")
    
#endif

    
MonitorHudSync CreateHudSyncObj()

    new 
monitor engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if ( 
monitor )
    {
        
set_pev(monitorpev_classnameTaskClassname)
        
set_pev(monitorpev_nextthinkget_gametime() + 0.1)
        
register_forward(FM_Think"monitor_think")
    }
}
//----------------------------------------------------------------------------------------------
#if defined MONITOR_SPEC
public plugin_cfg()
{
    
ServerMaxLevel sh_get_num_lvls()
}
#endif
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return

    
#if !defined MONITOR_SPEC
        
if ( is_user_bot(id) ) return
    
#endif

    // Check varibles initially when spawned, mainly so hp doesn't start at 0
    #if defined MONITOR_HP || defined MONITOR_SPEC
        
UserHealth[id] = get_user_health(id)
    
#endif
    #if defined MONITOR_AP || defined MONITOR_SPEC
        
UserArmor[id] = get_user_armor(id)
    
#endif

    #if defined REPLACE_HUD
        #if defined MONITOR_SPEC
            
if ( !is_user_bot(id) )
            {
        
#endif
                // Remove HP and AP from screen, however radar is removed aswell
                
message_begin(MSG_ONE_UNRELIABLEMsgHideWeapon_id)
                
write_byte(HIDE_HUD_HEALTH)
                
message_end()
        
#if defined MONITOR_SPEC
            
}
        
#endif
    #endif
}
//----------------------------------------------------------------------------------------------
#if defined MONITOR_HP || defined MONITOR_SPEC
public health_change(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return

    
#if !defined MONITOR_SPEC
        
if ( is_user_bot(id) ) return
    
#endif

    
UserHealth[id] = read_data(1)
}
#endif
//----------------------------------------------------------------------------------------------
#if defined MONITOR_AP || defined MONITOR_SPEC
public armor_change(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return

    
#if !defined MONITOR_SPEC
        
if ( is_user_bot(id) ) return
    
#endif

    
UserArmor[id] = read_data(1)
}
#endif
//----------------------------------------------------------------------------------------------
public monitor_think(ent)
{
    if ( !
pev_valid(ent) ) return FMRES_IGNORED

    
static class[32]
    
pev(entpev_classname, class, charsmax(class))

    if ( 
equal(class, TaskClassname) )
    {
        if ( 
sh_is_active() )
        {
            
#if defined MONITOR_SPEED || defined MONITOR_SPEC
                
static Float:velocity[3]
            
#endif
            #if defined MONITOR_GRAVITY || defined MONITOR_SPEC
                
static Float:gravity
            
#endif
            #if defined MONITOR_GODMODE
                
static Float:takeDamage
            
#endif

            #if defined MONITOR_SPEC
                
static specPlayerspecPlayerLevel
            
#endif

            #if defined MONITOR_HP || defined MONITOR_AP || defined MONITOR_GRAVITY || defined MONITOR_SPEED || defined MONITOR_GODMODE
                
static len
            
#endif

            
static players[32], countiid
            
static temp[128]
            
get_players(playerscount"ch")

            for ( 
0counti++ )
            {
                
id players[i]
                
temp[0] = '^0'

                
if ( is_user_alive(id) )
                {
                    
#if defined MONITOR_HP || defined MONITOR_AP || defined MONITOR_GRAVITY || defined MONITOR_SPEED || defined MONITOR_GODMODE
                        
len 0
                        
#if defined MONITOR_HP
                            
len += formatex(tempcharsmax(temp), "HP %d"UserHealth[id])
                        
#endif

                        #if defined MONITOR_AP
                            #if defined MONITOR_HP
                                
len += formatex(temp[len], charsmax(temp) - len"  |  ")
                            
#endif

                            
len += formatex(temp[len], charsmax(temp) - len"AP %d"UserArmor[id])
                        
#endif

                        #if defined MONITOR_GRAVITY
                            #if defined MONITOR_HP || defined MONITOR_AP
                                
len += formatex(temp[len], charsmax(temp) - len"  |  ")
                            
#endif

                            
pev(idpev_gravitygravity)
                            
len += formatex(temp[len], charsmax(temp) - len"G %d%%"floatround(gravity*100.0))
                        
#endif

                        #if defined MONITOR_SPEED
                            #if defined MONITOR_HP || defined MONITOR_AP || defined MONITOR_GRAVITY
                                
len += formatex(temp[len], charsmax(temp) - len"  |  ")
                            
#endif

                            
pev(idpev_velocityvelocity)
                            
len += formatex(temp[len], charsmax(temp) - len"SPD %d"floatround(vector_length(velocity)) )
                        
#endif

                        #if defined MONITOR_GODMODE
                            
pev(idpev_takedamagetakeDamage)
                            
                            
// GODMODE will only show if godmode is on
                            
if ( takeDamage == DAMAGE_NO )
                            {
                                
#if defined MONITOR_HP || defined MONITOR_AP || defined MONITOR_GRAVITY || defined MONITOR_SPEED
                                    
len += formatex(temp[len], charsmax(temp) - len"  |  ")
                                
#endif
                                
formatex(temp[len], charsmax(temp) - len"GODMODE")
                            }
                        
#endif

                        // Sets Y location
                        #if defined REPLACE_HUD
                            
set_hudmessage(25518000.020.9700.00.30.00.0)
                        
#else
                            
set_hudmessage(25518000.020.7300.00.30.00.0)
                        
#endif

                        
ShowSyncHudMsg(idMonitorHudSync"[SH]  %s"temp)
                    
#endif
                
}
                
#if defined MONITOR_SPEC
                    
else
                    {
                        
// Who is the id specing
                        
specPlayer pev(idpev_iuser2)

                        if ( !
specPlayer || id == specPlayer ) continue

                        
pev(specPlayerpev_velocityvelocity)
                        
pev(specPlayerpev_gravitygravity)
                        
specPlayerLevel sh_get_user_lvl(specPlayer)

                        if ( 
specPlayerLevel ServerMaxLevel ) {
                            
formatex(tempcharsmax(temp), "/%d"sh_get_lvl_xp(specPlayerLevel+1))
                        }

                        
set_hudmessage(2552552550.0180.920.050.10.013.0)
                        
ShowSyncHudMsg(idMonitorHudSync"[SH] Level: %d/%d  |  XP: %d%s^nHealth: %d  |  Armor: %d^nGravity: %d%%  |  Speed: %d"specPlayerLevelServerMaxLevelsh_get_user_xp(specPlayer), tempUserHealth[specPlayer], UserArmor[specPlayer], floatround(gravity*100.0), floatround(vector_length(velocity)))
                    }
                
#endif
            
}

        }

        
// Keep monitorloop active even if shmod is not, incase sh is turned back on
        
set_pev(entpev_nextthinkget_gametime() + 0.1)
    }

    return 
FMRES_IGNORED
}
//----------------------------------------------------------------------------------------------
#if defined REPLACE_HUD
public msg_hideweapon()
{
    if ( !
sh_is_active() ) return

    
// Block HP/AP/Radar if not being blocked, must block all 3 can not individually be done
    
set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | HIDE_HUD_HEALTH)
}
//----------------------------------------------------------------------------------------------
#endif 


Shahruh10 09-15-2012 18:22

Re: compiling error.
 
Now i got this, and sorry for posting twice, but i couldnt get help on the other one:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// sh_monitor.sma
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(199) : error 025
: function heading differs from prototype
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(307) : error 088
: number of arguments does not match definition
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : warning 2
15: expression has no effect
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 001
: expected token: ";", but found ")"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 029
: invalid expression, assumed zero
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : fatal err
or 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file compiled\sh_monitor.amx (compile failed).
//
// Compilation Time: 0,06 sec
// ----------------------------------------

Press enter to exit ...

Know what to do?

Torge 09-15-2012 18:27

Re: compiling error.
 
Quote:

Originally Posted by Shahruh10 (Post 1800238)
Now i got this, and sorry for posting twice, but i couldnt get help on the other one:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// sh_monitor.sma
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(199) : error 025
: function heading differs from prototype
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(307) : error 088
: number of arguments does not match definition
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : warning 2
15: expression has no effect
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 001
: expected token: ";", but found ")"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 029
: invalid expression, assumed zero
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : fatal err
or 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file compiled\sh_monitor.amx (compile failed).
//
// Compilation Time: 0,06 sec
// ----------------------------------------

Press enter to exit ...

Know what to do?

Dude.. clear your sh_monitor.sma and copy the code which I posted in your cleared sh_monitor.sma and then compile...

Shahruh10 09-15-2012 18:30

Re: compiling error.
 
I did clear the .sma file and pasted your code then that came up...

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// sh_monitor.sma
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(199) : error 025
: function heading differs from prototype
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(307) : error 088
: number of arguments does not match definition
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : warning 2
15: expression has no effect
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 001
: expected token: ";", but found ")"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 029
: invalid expression, assumed zero
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : fatal err
or 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file compiled\sh_monitor.amx (compile failed).
//
// Compilation Time: 0,06 sec
// ----------------------------------------

Press enter to exit ...

Torge 09-15-2012 18:32

Re: compiling error.
 
Quote:

Originally Posted by Shahruh10 (Post 1800245)
I did clear the .sma file and pasted your code then that came up...

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// sh_monitor.sma
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(199) : error 025
: function heading differs from prototype
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(307) : error 088
: number of arguments does not match definition
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : warning 2
15: expression has no effect
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 001
: expected token: ";", but found ")"
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 029
: invalid expression, assumed zero
// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : fatal err
or 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file compiled\sh_monitor.amx (compile failed).
//
// Compilation Time: 0,06 sec
// ----------------------------------------

Press enter to exit ...

Don't copy the code to your superheromod.inc :l

Shahruh10 09-15-2012 18:36

Re: compiling error.
 
I haven't paste the code into superheromod.inc... i just pasted the code into the .sma file.

Torge 09-15-2012 18:38

Re: compiling error.
 
Quote:

Originally Posted by Shahruh10 (Post 1800249)
I haven't paste the code into superheromod.inc... i just pasted the code into the .sma file.

Then just explain me what this mean:

Quote:

// C:\Users\Shahruh10\Desktop\compiler\include\s uperheromod.inc(442) : error 017
: undefined symbol "get_cvar_num"
I did the same as like in this thread I explained and everything compile without any problems...

Shahruh10 09-15-2012 18:44

Re: compiling error.
 
Can you give me your superheromod.inc file? let me try with that one...


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

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