AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Requesting help for compilation (https://forums.alliedmods.net/showthread.php?t=317373)

Pegasus6 07-09-2019 19:03

Requesting help for compilation
 
Hello everyone, i've got these errors after trying to compile a shop plugin, can anyone help me with these errors ? I would be verry thankfull :)

Errors :
Code:

//// furienshop3.sma
            \furienshop3.sma(164) : warning 217: loose indentation
            \furienshop3.sma(164) : error 029: invalid expression, assumed zero
            \furienshop3.sma(164) : error 017: undefined symbol "Player_TakeDamage"
            \furienshop3.sma(164) : error 017: undefined symbol "iInflictor"
            \furienshop3.sma(164) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file compiled\furienshop3.amx (compile failed).
//
// Compilation Time: 0.28 sec

And the line with those errors (I think :) ) :
Code:

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage ) {
       
        if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasKnife [ iAttacker ] ) {
               
                SetHamParamFloat ( 4, fDamage * 3.0 );
                return HAM_HANDLED;
               
        }
       
        if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasAk47[ iAttacker ] ) {
               
                SetHamParamFloat ( 4, fDamage * 2.0 );
                return HAM_HANDLED;
               
        }
       
        return HAM_IGNORED;
       
}


OciXCrom 07-09-2019 20:21

Re: Requesting help for compilation
 
The error is not on those lines. It's somewhere before them - probably a missing bracket.

Pegasus6 07-09-2019 20:26

Re: Requesting help for compilation
 
Hmm, i think you are right, I thought that there is the problem, here is the full code if anyone can help me :3

Code:

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < colorchat >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
#include < xs >
#include < fun >

#define PLUGIN "F & AF SHOP"
#define VERSION "1.0"
#define AUTHOR "HamletEagle"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

new const RADAR_SOUND[ ]                = "misc/motion.wav";
#define RADAR_DELAY        1.0
       

new money  [ 10 ]
new money1 [ 10 ]

new g_iMaxPlayers;
new g_iSprite

new g_bHasThermalGoggle
#define SetUserThermalGoggle(%1)                g_bHasThermalGoggle |= 1<<(%1&31)
#define RemoveUserThermalGoggle(%1)        g_bHasThermalGoggle &= ~(1<<(%1&31))
#define HasUserThermalGoggle(%1)                g_bHasThermalGoggle & 1<<(%1&31)

new g_bThermalGoggleActivated
#define ActiveUserThermalGoggle(%1)        g_bThermalGoggleActivated |= 1<<(%1&31)
#define DeactiveUserThermalGoggle(%1)        g_bThermalGoggleActivated &= ~(1<<(%1&31))
#define HasUserActiveThermalGoggle(%1)        g_bThermalGoggleActivated & 1<<(%1&31)

#define FREQUENCY 0.1
#define MAX_DISTANCE        1000.0

#define MAX_PLAYERS 32

new Float:g_flNextUpdate[MAX_PLAYERS+1]

#define FLASHBANG_SEARCH_RADIUS 1500.0

new g_bHasNoFlash
#define SetUserNoFlash(%1)                g_bHasNoFlash |=  1<<(%1&31)
#define RemoveUserNoFlash(%1)                g_bHasNoFlash &= ~(1<<(%1&31))
#define HasUserNoFlash(%1)                g_bHasNoFlash &    1<<(%1&31)

new bool: HasKnife [ 33 ]
new bool: HasAk47 [ 33 ]

new const Knife [ ] [ ]= {
       
        "models/hamlet_shop/v_sknife.mdl",
        "models/hamlet_shop/p_sknife.mdl"

}

new g_iCvarMinFurienSpeed;
new g_iCvarRadarRange;
new Float:g_fCurrentTime;
new Float:g_fNextRadarTime[ 33 ];
new bool:g_bUserHasRadar[ 33 ];
new bool:g_bUserHasProtection[ 33 ];
new bool:g_bDrawFurienOnRadar[ 33 ];
new g_iMsgIdHostageK;
new g_iMsgIdHostagePos;

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_clcmd ( "say /shop", "CheckAcces" );
       
        //////////Cvarurile pentru money//////////////
       
        money [ 1 ] = register_cvar( "f_item1", "16000" )
        money [ 2 ] = register_cvar( "f_item2", "4000" )
        money [ 3 ] = register_cvar( "f_item3" ,"4000" )
        money [ 4 ] = register_cvar( "f_item4" ,"3000" )
        money [ 5 ] = register_cvar( "f_item5" ,"3000" )
        money [ 6 ] = register_cvar( "f_item6" ,"5000" )
        money [ 7 ] = register_cvar( "f_item7" ,"10000" )
        money [ 8 ] = register_cvar( "f_item8" ,"16000" )
        money [ 9 ] = register_cvar( "f_item9" ,"5000" )
       
        money1 [ 1 ] = register_cvar( "af_item1" ,"16000" )
        money1 [ 2 ] = register_cvar( "af_item2" ,"300" )
        money1 [ 3 ] = register_cvar( "af_item3" ,"4000" )
        money1 [ 4 ] = register_cvar( "af_item4" ,"4000" )
        money1 [ 5 ] = register_cvar( "af_item5" ,"3000" )
        money1 [ 6 ] = register_cvar( "af_item6" ,"5000" )
        money1 [ 7 ] = register_cvar( "af_item7" ,"10000" )
        money1 [ 8 ] = register_cvar( "af_item8" ,"16000" )
        money1 [ 9 ] = register_cvar( "af_item9" ,"5000" )
       
        /////////////////////////////////////////////////////////
       
        //////////////////////////////////////////Events///////////////////
       
       
        register_event ( "CurWeapon", "Current_Weapon", "be", "1=1" );
        RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage", true );
        register_event ( "NVGToggle", "Event_NVGToggle", "be" );
        RegisterHam ( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true );
        register_forward(FM_FindEntityInSphere, "FindEntityInSphere")
        register_event(  "DeathMsg",  "EventDeathMsg",  "a"  );
        register_forward( FM_PlayerPreThink, "fw_PlayerPreThinkPre", false );
        RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) 
       
        //////////////////////////////////////////////////////////////////////
       
        g_iMaxPlayers = get_maxplayers ( )
       
        g_iCvarMinFurienSpeed = register_cvar( "afr_minspeed", "100" );
        g_iCvarRadarRange = register_cvar( "afr_range", "850" );
        g_iMsgIdHostageK = get_user_msgid( "HostageK" );
        g_iMsgIdHostagePos = get_user_msgid( "HostagePos" );
       
       
}

public plugin_precache( ) {
       
        static i;
        for ( i = 0 ; i < sizeof ( Knife ); i++ )
                precache_model ( Knife [ i ] )

        g_iSprite = precache_model("sprites/poison.spr")       
        precache_sound( RADAR_SOUND );
}

public Ham_CBasePlayer_Killed_Post(id) //remove thermalgoogle
{
        RemoveUserThermalGoggle(id)
        DeactiveUserThermalGoggle(id)
}

public fwHamPlayerSpawnPost(id) {

    HasKnife [ id ] = false
    HasAk47 [ id ] = false

}

public Current_Weapon ( id ) {
       
        new weapon=get_user_weapon(id)
       
        if( weapon == CSW_KNIFE ) {
               
                if( HasKnife [ id ] == true ) {
                       
                        set_pev ( id, pev_viewmodel2, Knife [ 0 ] );
                        set_pev ( id, pev_weaponmodel2, Knife [ 1 ] );
                       
        }
               

       
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage ) {
       
        if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasKnife [ iAttacker ] ) {
               
                SetHamParamFloat ( 4, fDamage * 3.0 );
                return HAM_HANDLED;
               
        }
       
        if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasAk47[ iAttacker ] ) {
               
                SetHamParamFloat ( 4, fDamage * 2.0 );
                return HAM_HANDLED;
               
        }
       
        return HAM_IGNORED;
       
}

public Event_NVGToggle(id)
{
        if( HasUserThermalGoggle(id) )
        {
                if( read_data(1) )
                {
                        ActiveUserThermalGoggle(id)
                }
                else
                {
                        DeactiveUserThermalGoggle(id)
                }
        }
}

public client_PostThink(id)
{
        if( HasUserActiveThermalGoggle(id) || !is_user_alive(id) )
        {
                return
        }
       
        new Float:flTime = get_gametime()
       
        if( g_flNextUpdate[id] > flTime )
        {
                return
        }
       
        g_flNextUpdate[id] = flTime + FREQUENCY
       
        new Float:fMyOrigin[3]
        entity_get_vector(id, EV_VEC_origin, fMyOrigin)
       
        static Players[32], iNum
        get_players(Players, iNum, "ae", get_user_team(id) == 2? "TERRORIST" : "CT")
        for(new i = 0; i < iNum; ++i)
        {
                new target = Players[3]
               
                new Float:fTargetOrigin[3]
                entity_get_vector(target, EV_VEC_origin, fTargetOrigin)
               
               
                if( get_distance_f(fMyOrigin, fTargetOrigin) > MAX_DISTANCE )
                {
                        continue
                }
               
                new Float:fMiddle[3], Float:fHitPoint[3]
                xs_vec_sub(fTargetOrigin, fMyOrigin, fMiddle)
                trace_line(-1, fMyOrigin, fTargetOrigin, fHitPoint)
               
                new Float:fWallOffset[3], Float:fDistanceToWall
                fDistanceToWall = vector_distance(fMyOrigin, fHitPoint) - 10.0
                xs_vec_mul_scalar(fMiddle, fDistanceToWall/vector_length(fMiddle), fWallOffset)
               
                new Float:fSpriteOffset[3]
                xs_vec_add(fWallOffset, fMyOrigin, fSpriteOffset)
                new Float:fScale, Float:fDistanceToTarget = vector_distance(fMyOrigin, fTargetOrigin)
                if(fDistanceToWall > 100.0)
                        fScale = 8.0 * (fDistanceToWall / fDistanceToTarget)
                else
                fScale = 2.0
               
                message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, .player=id)
                {
                        write_byte(TE_SPRITE)
                        engfunc(EngFunc_WriteCoord, fSpriteOffset[0])
                        engfunc(EngFunc_WriteCoord, fSpriteOffset[1])
                        engfunc(EngFunc_WriteCoord, fSpriteOffset[2])
                        write_short(g_iSprite)
                        write_byte(floatround(fScale))
                        write_byte(125)
                }
                message_end()
        }
}

public FindEntityInSphere(id, Float:fVecOrigin[3], Float:flRadius)
{
        if( flRadius == FLASHBANG_SEARCH_RADIUS )
        {
                while( IsPlayer( (id=engfunc(EngFunc_FindEntityInSphere, id, fVecOrigin, flRadius)) ) )
                {
                        if( ~HasUserNoFlash(id) && is_user_alive(id) )
                        {
                                forward_return(FMV_CELL, id)
                                return FMRES_SUPERCEDE
                        }
                }
                forward_return(FMV_CELL, 0)
                return FMRES_SUPERCEDE
        }
        return FMRES_IGNORED
}


public CheckAcces ( id ) {
       
        if( is_user_alive ( id ) ) {
               
                if ( get_user_team ( id ) == 1 ) ShowMenu ( id )
                if ( get_user_team ( id ) == 2 ) ShowMenu1 ( id )
               
        }
       
       
}

public ShowMenu( id )
{
        new menu = menu_create( "Furien Shop", "furien_handler" );
       
        menu_additem(menu, "SuperKnife                    \r[ \y16000$ \r]", "", 0);
        menu_additem(menu, "AP +35                        \r[ \y4000$ \r]", "", 0);
        menu_additem(menu, "HP +35                          \r[ \y4000$ \r]", "", 0);
        menu_additem(menu, "He Grenade                        \r[ \y3000$ \r]", "", 0);
        menu_additem(menu, "Flashbang Grenade                \r[ \y3000$ \r]", "", 0);
        menu_additem(menu, "Smoke Grenade                \r[ \y5000$ \r]", "", 0);
        menu_additem(menu, "No Flash                          \r[ \y10000$ \r]", "", 0);
        menu_additem(menu, "AntiFurienRadarProtection          r[ \y16000$ \r]", "", 0);
        menu_additem(menu, "NightVisionGoggles                \r[ \y5000$ \r]", "", 0);
       
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
        menu_setprop(menu, MPROP_NOCOLORS, 1);
        menu_setprop(menu, MPROP_NUMBER_COLOR, "\y");
       
        menu_display(id, menu, 0);
       
        return PLUGIN_HANDLED;
}

public furien_handler(id, menu, item)
{
        if(item == MENU_EXIT)
        {
                menu_cancel(id);
                return PLUGIN_HANDLED;
        }
       
        new  command[6], name[64], access, callback
        new price
        price = cs_get_user_money( id )
       
        menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
       
        switch(item)
        {
                case 0: {
                       
                        if(price>=get_pcvar_num(money[1])) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money [ 1 ] ))
                               
                                set_pev ( id, pev_viewmodel2, Knife [ 0 ] );
                                set_pev ( id, pev_weaponmodel2, Knife [ 1 ] );
                                HasKnife [ id ] = true
                               
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 1: {
                       
                        if( price >= get_pcvar_num(money [ 2 ]) ) {
                               
                                cs_set_user_money( id,price- get_pcvar_num( money [ 2 ] ))
                                set_user_armor ( id, get_user_armor ( id ) + 35 )
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 2: {
                       
                        if( price >=get_pcvar_num( money [ 3 ] )) {
                               
                                cs_set_user_money( id,price- get_pcvar_num(money [ 3 ]))
                                set_user_health ( id, get_user_health ( id ) + 35 )
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 3: {
                       
                        if( price >=get_pcvar_num( money [ 4 ] )) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money [ 4 ] ))
                                give_item(id,"weapon_hegrenade")
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 4: {
                       
                        if( price >= get_pcvar_num(money [ 5 ]) ) {
                               
                                cs_set_user_money( id,price-get_pcvar_num( money [ 5 ] ))
                                give_item(id,"weapon_flashbang")
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 5: {
                       
                        if( price >=get_pcvar_num( money [ 6 ]) ) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money [ 6 ] ))
                                give_item(id,"weapon_smokegrenade")
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 6: {
                       
                        if( price >= get_pcvar_num(money [ 7 ]) ) {
                               
                                cs_set_user_money( id,price- get_pcvar_num(money [ 7 ] ))
                                SetUserNoFlash( id )
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 7: {
                       
                        if( price >= get_pcvar_num(money [ 8 ]) ) {
                               
                                cs_set_user_money( id,price-get_pcvar_num( money [ 8 ] ))
                                g_bUserHasProtection[ id ] = true;
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 8: {
                       
                        if( price >= get_pcvar_num(money [ 9 ] )) {
                               
                                cs_set_user_money( id,price-get_pcvar_num(money [ 9 ] ))
                                cs_set_user_nvg(id, 1)
                                SetUserThermalGoggle(id)
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
        }
       
        menu_destroy(menu);
       
        return PLUGIN_HANDLED;
       
}

public ShowMenu1(id)
{
        new menu2 = menu_create("Anti-Furien Menu", "af_menu");
       
        menu_additem(menu2, "Anti-Furien Weapon - AK47  \r[ \y16000$ \r]", "", 0);
        menu_additem(menu2, "DefuseKIT                          \r[ \y300$ \r]", "", 0);
        menu_additem(menu2, "HP +35                          \r[ \y4000$ \r]", "", 0);
        menu_additem(menu2, "AP +35                          \r[ \y4000$ \r]", "", 0);
        menu_additem(menu2, "Flashbang Grenade                \r[ \y5000$ \r]", "", 0);
        menu_additem(menu2, "Smoke Grenade                \r[ \y5000$ \r]", "", 0);
        menu_additem(menu2, "No Flash                        \r[ \y10000$ \r]", "", 0);
        menu_additem(menu2, "AntiFurienRadar                \r[ \y16000$ \r]", "", 0);
        menu_additem(menu2, "NightVisionGoggles          \r[ \y5000$ \r]", "", 0);
       
        menu_setprop(menu2, MPROP_EXIT, MEXIT_ALL);
        menu_setprop(menu2, MPROP_NOCOLORS, 1);
       
        menu_display(id, menu2, 0);
       
        return PLUGIN_HANDLED;
}

public af_menu(id, menu2, item)
{
        if(item == MENU_EXIT)
        {
                menu_cancel(id);
                return PLUGIN_HANDLED;
        }
       
        new command[6], name[64], access, callback,price
        price=cs_get_user_money(id)
       
        menu_item_getinfo(menu2, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
       
        switch(item)
        {
                case 0: {
                       
                        if( price >= get_pcvar_num(money1 [ 1 ]) ) {
                               
                                cs_set_user_money( id,price-get_pcvar_num(money1 [ 1 ] ))
                               
                                give_item(id,"weapon_ak47")
                               
                                cs_set_user_bpammo(id,CSW_AK47,250)
                               
                                HasAk47 [ id ] = true
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 1: {
                       
                        if( price >=get_pcvar_num( money1 [ 2 ]) ) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 2 ] ))
                                cs_set_user_defuse(id,1)
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 2: {
                       
                        if( price >= get_pcvar_num(money1 [ 3 ]) ) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 3 ]) )
                                set_user_health(id,get_user_health(id)+35)
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 3: {
                       
                        if( price >= get_pcvar_num(money1 [ 4 ] )) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 4 ] ))
                                set_user_armor(id,get_user_armor(id)+35)
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 4: {
                       
                        if( price >= get_pcvar_num(money1 [ 5 ] ) ){
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 5 ] ))
                                give_item(id,"weapon_flashbang")
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 5: {
                       
                        if( price >= get_pcvar_num(money1 [ 6 ] )) {
                               
                                cs_set_user_money( id,price-get_pcvar_num(money1 [ 6 ] ))
                                give_item(id,"weapon_smokegrenade")
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 6: {
                       
                        if( price >= get_pcvar_num(money1 [ 7 ] )) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 7 ] ))
                                SetUserNoFlash( id )
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 7: {
                       
                        if( price >= get_pcvar_num(money1 [ 8 ] ) ){
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 8 ] ))
                                g_bUserHasRadar[ id ] = true;
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
                case 8: {
                       
                        if( price >=get_pcvar_num( money1 [ 9 ] )) {
                               
                                cs_set_user_money( id, price-get_pcvar_num(money1 [ 9 ] ))
                                cs_set_user_nvg(id, 1)
                                SetUserThermalGoggle(id)
                        }
                       
                        else ColorChat(id,GREEN,"Nu ai destui bani")
                               
                       
                }
               
        }
       
        menu_destroy(menu2);
       
        return PLUGIN_HANDLED;
       
}

public client_putinserver( id )
{
       
        g_bUserHasRadar[ id ] = false;
        g_bUserHasProtection[ id ] = false;
        g_bDrawFurienOnRadar[ id ] = false;
}

public client_disconnect( id )
{
       
        g_bUserHasRadar[ id ] = false;
        g_bUserHasProtection[ id ] = false;
        g_bDrawFurienOnRadar[ id ] = false;
}

public EventDeathMsg(  )       
{
        static id;
        id = read_data( 2 );
       
        g_bUserHasRadar[ id ] = false;
        g_bUserHasProtection[ id ] = false;
        g_bDrawFurienOnRadar[ id ] = false;
}
       

public fw_PlayerPreThinkPre( id )
{
        if( !is_user_alive( id ) )
                return FMRES_IGNORED;
       
        g_fCurrentTime = get_gametime( );
       
        if( get_user_team( id ) == 2 && g_bUserHasRadar[ id ] )
        {
               
                if( g_fNextRadarTime[ id ] <= g_fCurrentTime )
                {
                       
                        g_fNextRadarTime[ id ] = g_fCurrentTime + RADAR_DELAY;
                        static bool:bBeep;
                        bBeep = false;
                       
                        for( new iFurien = 1; iFurien <= g_iMaxPlayers; iFurien++ )
                        {
                               
                                if( g_bDrawFurienOnRadar[ iFurien ] )
                                {
                                        if( !g_bUserHasProtection[ iFurien ] )
                                        {
                                                static Float:fOrigin[ 3 ];
                                                pev( iFurien, pev_origin, fOrigin );
                                               
                                                UTIL_ShowOnRadar( id, iFurien, fOrigin );
                                        }
                                       
                                        bBeep = true;
                                }
                        }
                       
                        if( bBeep )
                                client_cmd( id, "spk %s", RADAR_SOUND );
                       
                }
               
        }
       
        else if( get_user_team( id ) == 1 )
        {
               
               
                static Float:fFurienOrigin[ 3 ];
                pev( id, pev_origin, fFurienOrigin );
               
                static Float:fVelocity[ 3 ];
                pev( id, pev_velocity, fVelocity );
               
                static Float:fCurSpeed;
                fCurSpeed = vector_length( fVelocity );
               
                if( fCurSpeed > float( get_pcvar_num( g_iCvarMinFurienSpeed ) ) )
                {       
       
                        static iAnti;
                        for( iAnti = 1; iAnti <= g_iMaxPlayers; iAnti++ )
                        {
                                if( get_user_team( iAnti ) == 2 && is_user_alive( iAnti ) )
                                {
                                        static Float:fAntiOrigin[ 3 ];
                                        pev( iAnti, pev_origin, fAntiOrigin );
                                       
                                        if( get_distance_f( fFurienOrigin, fAntiOrigin ) <= float( get_pcvar_num( g_iCvarRadarRange ) ) )
                                        {
                                                g_bDrawFurienOnRadar[ id ] = true;
                                               
                                                break;
                                        }
                                }
                        }
                }
                else
                {
                        g_bDrawFurienOnRadar[ id ] = false;
                }
               
        }
       
        return FMRES_IGNORED;
       
}

UTIL_ShowOnRadar( id, iTarget, Float:fOrigin[ 3 ] )
{
       
       
        //Make a dot on players radar.
        message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostagePos, .player = id );
        write_byte( id );
        write_byte( iTarget );
        engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
        engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
        engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] );
        message_end( );
       
        //Make the dot red.
        message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostageK, .player = id );
        write_byte( iTarget );
        message_end( );
       
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


fysiks 07-09-2019 22:04

Re: Requesting help for compilation
 
It looks like you copy/pasted some of the code which is a frequent cause of things like this. Also, being able to keep track of braces is why I always but both the opening and closing brace on their own line so that they line up (when properly indented). Then, it's extremely easy to see where you're missing one.

In this particular code, it's immediately above the line where the compiler threw an error.

Also, if you use Notepad++, it has "matching brace highlighting" which can help finding this also.

SomewhereLost 07-10-2019 11:10

Re: Requesting help for compilation
 
PHP Code:

public Current_Weapon id ) {
    
    new 
weapon=get_user_weapon(id)
    
    if( 
weapon == CSW_KNIFE ) {
        
        if( 
HasKnife id ] == true ) {
            
            
set_pev idpev_viewmodel2Knife ] );
            
set_pev idpev_weaponmodel2Knife ] );
            
    }
        

    


>>

PHP Code:

public Current_Weapon id ) {
    
    new 
weapon=get_user_weapon(id)
    
    if( 
weapon == CSW_KNIFE ) {
        
        if( 
HasKnife id ] == true ) {
            
            
set_pev idpev_viewmodel2Knife ] );
            
set_pev idpev_weaponmodel2Knife ] );
            
        }
        
    }



Compiles fine.

Pegasus6 07-10-2019 18:04

Re: Requesting help for compilation
 
Quote:

Originally Posted by SomewhereLost (Post 2658616)
PHP Code:

public Current_Weapon id ) {
    
    new 
weapon=get_user_weapon(id)
    
    if( 
weapon == CSW_KNIFE ) {
        
        if( 
HasKnife id ] == true ) {
            
            
set_pev idpev_viewmodel2Knife ] );
            
set_pev idpev_weaponmodel2Knife ] );
            
    }
        

    


>>

PHP Code:

public Current_Weapon id ) {
    
    new 
weapon=get_user_weapon(id)
    
    if( 
weapon == CSW_KNIFE ) {
        
        if( 
HasKnife id ] == true ) {
            
            
set_pev idpev_viewmodel2Knife ] );
            
set_pev idpev_weaponmodel2Knife ] );
            
        }
        
    }



Compiles fine.

Worked ! I thank you a lot for your help, you are awsome realy, appreciate that :)

Pegasus6 07-10-2019 18:09

Re: Requesting help for compilation
 
Quote:

Originally Posted by fysiks (Post 2658550)
It looks like you copy/pasted some of the code which is a frequent cause of things like this. Also, being able to keep track of braces is why I always but both the opening and closing brace on their own line so that they line up (when properly indented). Then, it's extremely easy to see where you're missing one.

In this particular code, it's immediately above the line where the compiler threw an error.

Also, if you use Notepad++, it has "matching brace highlighting" which can help finding this also.

Sorry for x2 post

Yes, is copy/pasted and i wanted to edit some things in this code and then i wanted to compile it and boom, errors , unbeliveble, no ? XD
Also, yes, it was a bracet error.
I thoght AMXX Studio helps you more. :(

Thank you a lot guys for your help+helping tips :)


All times are GMT -4. The time now is 17:26.

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