AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Error Plugin (https://forums.alliedmods.net/showthread.php?t=288391)

GuTo 09-28-2016 18:56

[Help] Error Plugin
 
this plugin is with an error that I do not know how to fix, someone help me?

PHP Code:

#include < amxmodx > 
#include < hamsandwich > 
#include < fakemeta >
#include < zombieplague > 

#define PLUGIN_AUTHOR    " "  
#define PLUGIN_NAME    "[TARGETBR] Faca Gelo p/ Surv"
#define PLUGIN_VERSION    "1.0 - Private " 

#define FFADE_IN                    0x0000
#define FFADE_STAYOUT            0x0004
#define BREAK_GLASS                0x01
#define UNIT_SECOND                (1<<12)

#define MAX_CLIENTS                32

#define XTRA_OFS_WEAPON         4
#define m_pPlayer                    41

#define KNIFE_V_MODEL            "models/v_frost_knife.mdl"
#define KNIFE_P_MODEL            "models/p_frost_knife.mdl"

#define KNIFE_SOUND_FROST        "warcraft3/impalehit.wav"
#define KNIFE_SOUND_BREAK        "warcraft3/impalelaunch1.wav"

#define KNIFE_FROST_DURATION    1.0 // Tempo de congelamento
#define KNIFE_FROST_DAMAGE    12.0// Danos faca
#define KNIFE_FROST_VELOCITY    300.0// Gravitação
#define KNIFE_FROST_SPEED    350.0// Velocidade
#define KNIFE_FROST_KNOCK_POWER 3.0// Retorno

enum
{
    
SOUND_NULL,
    
SOUND_DRAW,
    
SOUND_MISS,
    
SOUND_STAB,
    
SOUND_HIT,
    
SOUND_HIT1,
    
SOUND_HIT2,
    
SOUND_HITWALL,
    
    
SOUND_END
}

enum
{
    
KNIFE_ACTIVE,
    
    
KNIFE_END
}

new const 
g_KNIFESounds[SOUND_END][] =
{
    
"",
    
"weapons/vox/axe_drawww.wav",
    
"weapons/vox/axe_miss.wav",
    
"weapons/vox/axe_stabb.wav",
    
"weapons/vox/axe_hitwal.wav",
    
"weapons/vox/axe_hit1.wav",
    
"weapons/vox/axe_hit22.wav",
    
"weapons/vox/axe_hitwal.wav"
}

new 
Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

new Trieg_ReplacedSounds

new g_KnifeData [MAX_CLIENTS 1][KNIFE_END]
new 
g_iFrozen MAX_CLIENTS ]
new 
g_glassSpr
new g_iMaxPlayers

public plugin_precache( ) 
{
    new 
i

    g_ReplacedSounds 
TrieCreate()
    
    
TrieSetCell(g_ReplacedSounds"weapons/knife_deploy1.wav"SOUND_DRAW)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_hit1.wav"SOUND_HIT)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_hit2.wav"SOUND_HIT1)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_hit3.wav"SOUND_HIT2)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_hit4.wav"SOUND_HIT)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_hitwall1.wav"SOUND_HITWALL)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_slash1.wav"SOUND_MISS)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_slash2.wav"SOUND_MISS)
    
TrieSetCell(g_ReplacedSounds"weapons/knife_stab.wav"SOUND_STAB)

    
precache_model(KNIFE_V_MODEL); precache_model(KNIFE_P_MODEL)
    
precache_sound(KNIFE_SOUND_FROST); precache_sound(KNIFE_SOUND_BREAK
    
    
g_glassSpr engfunc(EngFunc_PrecacheModel"models/glassgibs.mdl")

    for (
SOUND_DRAWSOUND_ENDi++)
    {
        
precache_sound(g_KNIFESounds[i])
    }
}

public 
plugin_init( ) 
{
    
register_plugin 
    
(
        
PLUGIN_NAME 
        
PLUGIN_VERSION 
        
PLUGIN_AUTHOR
    
);

    
RegisterHamHam_Item_Deploy"weapon_knife""Knife_Deploy_Post"1)
    
RegisterHamHam_Player_PreThink"player""Player_PreThink")
    
RegisterHamHam_TraceAttack,    "player",         "Knife_TraceAttack" );
    
    
register_event"DeathMsg""EV_DeathMsg""a" );
    
    
register_forward(FM_EmitSound"EmitSound")

    
g_iMaxPlayers get_maxplayers( );
}

public 
plugin_end()
{
    
TrieDestroy(g_ReplacedSounds)
}

public 
client_disconnect(iPlayer)
{
    
arrayset(g_KnifeData[iPlayer], 0KNIFE_END)
}

public 
zp_user_infected_post(iPlayerInfector)
{
    
arrayset(g_KnifeData[iPlayer], 0KNIFE_END)
}

public 
zp_user_humanized_postiPlayer 
{
    if( 
zp_get_user_survivoriPlayer ) ) 
    {
        
g_KnifeData[iPlayer][KNIFE_ACTIVE] = true
    
}
    else 
arrayset(g_KnifeData[iPlayer], 0KNIFE_END)
}

public 
EV_DeathMsg( )
{
    static 
pevVictim;
    
pevVictim read_data)
    
    if( !
is_user_connectedpevVictim ) )
        return
        
    
arrayset(g_KnifeData[pevVictim], 0KNIFE_END)    
}

public 
Knife_TraceAttack(const iEntity, const iAttacker, const FloatflDamage)
{
    if( !( 
<= iAttacker <= g_iMaxPlayers ) )
        return;
        
    if( !
is_user_aliveiAttacker )  )
        return;
        
    if( 
zp_get_user_zombieiAttacker ) )
        return;

    if ( !
g_KnifeData[iAttacker][KNIFE_ACTIVE])  return
    
    if( 
get_user_weaponiAttacker ) != CSW_KNIFE )
        return
    
    
SetHamParamFloat,  flDamage KNIFE_FROST_DAMAGE );
    
    
frost_processiEntity )
}

public 
Knife_Deploy_Post(iItem)
{
    new 
iPlayer
    
    
if (CheckItem(iItemiPlayer))
    {
        if ( 
zp_get_user_zombie iPlayer )   ) return HAM_IGNORED
        
        set_pev
(iPlayerpev_viewmodel2KNIFE_V_MODEL)
        
set_pev(iPlayerpev_weaponmodel2KNIFE_P_MODEL)
    }
    
    return 
HAM_IGNORED
}

public 
EmitSound(iPlayeriChannelszSample[], FloatflVolumeFloatflAttniFlagiPitch)
{
    if (
is_user_alive(iPlayer) && g_KnifeData[iPlayer][KNIFE_ACTIVE] )
    {
        new 
iSoundType
        
        TrieGetCell
(g_ReplacedSoundsszSampleiSoundType)
        
        if (
iSoundType != SOUND_NULL)
        {
            
emit_sound(iPlayeriChannelg_KNIFESounds[iSoundType], flVolumeflAttniFlagiPitch)
            return 
FMRES_SUPERCEDE
        
}
    }
    
    return 
FMRES_IGNORED
}

public 
frost_process(pevVictim)
{
    
fm_set_rendering(pevVictimkRenderFxGlowShell0255127kRenderNormal50)

    
emit_sound(pevVictimCHAN_BODYKNIFE_SOUND_FROST1.0ATTN_NORM0PITCH_NORM)

    
message_begin(MSG_ONEget_user_msgid("ScreenFade"), _pevVictim)
    
write_short(0)
    
write_short(0)
    
write_short(FFADE_STAYOUT)
    
write_byte(0)
    
write_byte(50)
    
write_byte(200)
    
write_byte(100)
    
message_end()

    
g_iFrozen[pevVictim] = true

    set_task
(KNIFE_FROST_DURATION"remove_freeze"pevVictim)
    
}

public 
remove_freeze(pevVictim)
{
    if(!
is_user_alive(pevVictim) || !g_iFrozen[pevVictim])
        return;

    
g_iFrozen[pevVictim] = false

    fm_set_rendering
(pevVictim)

    
ExecuteHamB Ham_Player_ResetMaxSpeedpevVictim)

    
message_begin(MSG_ONEget_user_msgid("ScreenFade"), _pevVictim)
    
write_short(UNIT_SECOND)
    
write_short(0)
    
write_short(FFADE_IN)
    
write_byte(0)
    
write_byte(50)
    
write_byte(200)
    
write_byte(100)
    
message_end()

    
emit_sound(pevVictimCHAN_BODYKNIFE_SOUND_BREAK1.0ATTN_NORM0PITCH_NORM)

    static 
origin2[3]
    
get_user_origin(pevVictimorigin2)

    
message_begin(MSG_PVSSVC_TEMPENTITYorigin2)
    
write_byte(TE_BREAKMODEL)
    
write_coord(origin2[0])
    
write_coord(origin2[1])
    
write_coord(origin2[2] + 24)
    
write_coord(16)
    
write_coord(16)
    
write_coord(16)
    
write_coord(random_num(-5050))
    
write_coord(random_num(-5050))
    
write_coord(25)
    
write_byte(10)
    
write_short(g_glassSpr)
    
write_byte(10)
    
write_byte(25)
    
write_byte(BREAK_GLASS)
    
message_end()
}

public 
Player_PreThink(id)
{
    if( !
is_user_alive(id) )
        return 
HAM_IGNORED

    
if(g_iFrozen[id])
    {
        
set_pev(idpev_velocityFloat:{ 0.00.00.0 })
        
set_pev(idpev_maxspeed1.0)
    }
    
    if( 
g_KnifeData[id][KNIFE_ACTIVE]  ) 
    {
        static 
iFlags;
        static 
iWaterlvl;
        static 
FloatiVelocity]
        
        
iFlags pevidpev_flags );
        
iWaterlvl pevidpev_waterlevel );
        
        if( 
get_user_weaponid ) != CSW_KNIFE 
        {
            return 
HAM_IGNORED ;
        }
        
        if ( ( ~
iFlags FL_ONGROUND ) || iFlags FL_WATERJUMP || iWaterlvl )
        {
            return 
HAM_IGNORED;
        } 
        
        if( ( 
pevidpev_button ) & IN_JUMP ) && !( pevidpev_oldbuttons ) & IN_JUMP ) )
        {
            
pevidpev_velocityiVelocity )

            
iVelocity] += KNIFE_FROST_VELOCITY ;        

            
set_pevidpev_velocityiVelocity )
            
set_pevidpev_gaitsequence)
        }
        
set_pevidpev_maxspeedKNIFE_FROST_SPEED )
    }

    return 
HAM_IGNORED
}

CheckItem(const iItem, &iPlayer)
{
    if (
pev_valid(iItem) == 2)
    {    
        
iPlayer get_pdata_cbase(iItemm_pPlayerXTRA_OFS_WEAPON)
        
        if ( 
g_KnifeData[iPlayer][KNIFE_ACTIVE] )
        {
            return 
1
        
}
    }
    return 
0
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))


Thanks,

OciXCrom 09-29-2016 08:54

Re: [Help] Error Plugin
 
So what's the error?!

GuTo 09-29-2016 11:32

Re: [Help] Error Plugin
 
Quote:

Originally Posted by OciXCrom (Post 2457863)
So what's the error?!

is....

Quote:

//// zp_faca_survgelo.sma
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(1) : error 010: invalid function or declaration
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(47) : error 017: undefined symbol "AMXX_VERSION_NUM"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(361) : error 017: undefined symbol "get_func_id"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(364) : error 017: undefined symbol "callfunc_begin_i"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(366) : error 017: undefined symbol "callfunc_push_int"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(367) : error 017: undefined symbol "callfunc_push_int"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(368) : error 017: undefined symbol "callfunc_push_str"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(369) : error 017: undefined symbol "callfunc_end"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\hamsandwich.inc(376) : error 017: undefined symbol "set_fail_state"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\fakemeta.inc(15) : error 017: undefined symbol "AMXX_VERSION_NUM"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\include\fakemeta.inc(247) : error 070: rational number support was not enabled
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(78) : error 017: undefined symbol "TrieCreate"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(78 -- 80) : warning 213: tag mismatch
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(80) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(81) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(82) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(83) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(84) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(85) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(86) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(87) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(88) : error 017: undefined symbol "TrieSetCell"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(90) : error 017: undefined symbol "precache_model"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(90) : error 017: undefined symbol "precache_model"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(91) : error 017: undefined symbol "precache_sound"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(91) : error 017: undefined symbol "precache_sound"
// C:\Users\GUTO\Documents\GuTo\Prog\CS\Compilad or\zp_faca_survgelo.sma(97) : error 017: undefined symbol "precache_sound"
//
// Compilation aborted.
// 26 Errors.
// Could not locate output file compiled\zp_faca_survgelo.amx (compile failed).
//
// Compilation Time: 0,09 sec
// ----------------------------------------

Rigex 09-29-2016 11:42

Re: [Help] Error Plugin
 
do you have the include? #include < zombieplague >

GuTo 09-29-2016 12:03

Re: [Help] Error Plugin
 
Quote:

Originally Posted by Rigex (Post 2457909)
do you have the include? #include < zombieplague >

Yes, is included in incluide already zombieplague.inc

OciXCrom 09-29-2016 12:52

Re: [Help] Error Plugin
 
There's no error in the code. Use a different compiler.

GuTo 09-29-2016 13:38

Re: [Help] Error Plugin
 
Quote:

Originally Posted by OciXCrom (Post 2457922)
There's no error in the code. Use a different compiler.

I thought what was happening thank you


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

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