AlliedModders

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

B7PK 05-11-2016 11:05

[HELP] Error climber
 
hello guys.

i have Error in complete this zombie class please help me

Full code:-
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}
/*
Wallclimb v1.0f by Python1320
Plagued Version 0.22 by Dabbi

Allows Poison Zombie to Climb Walls in Zombie Plague [3.62]

CVARS:    zp_wallclimb 0 = Off / 1 = Hold USE / 2 = Hold JUMP and DUCK  (Default 1)
    zp_wallclimb_nemesis 0 = Disable wallclimb during nemesis round. / 1 = Enable (Default 1)
    zp_wallclimb_survivor 0 = Disable wallclimb during survivor round. / 1 = Enable (Default 0)
    
Changes:
    0.22
        Made the function wallclimb return a value.
        Put plugin version to a cvar.
    0.21
        Added cvars to enable disable wallclimb durin survivor/nemesis round
    0.2
        Added cvar to enable / disable Walllclimb Plugin
    0.1
        First release.
*/

#include <amxmodx>
// #include <engine>
#include <fakemeta>
#include <hamsandwich>

#include <cstrike>
#include <zombieplague.inc>

//#include <fakemeta_util>
#define STR_T           33

// Stuff taken from fakemeta_util
#define fm_get_user_button(%1) pev(%1, pev_button)    
/* stock fm_get_user_button(index)
    return pev(index, pev_button) */

#define fm_get_entity_flags(%1) pev(%1, pev_flags)
/* stock fm_get_entity_flags(index)
    return pev(index, pev_flags) */

stock fm_set_user_velocity(entity, const Float:vector[3]) {
    
set_pev(entitypev_velocityvector);

    return 
1;
}
//End of stuff from fakemeta_util
//new STR_T[32]
new bool:g_WallClimb[33]
new 
Float:g_wallorigin[32][3]
new 
cvar_zp_wallclimbcvar_zp_wallclimb_nemesiscvar_zp_wallclimb_survivor
new g_zclass_climb
new g_ovr_dmg[33]
new 
cvar_dmg2stop

// Climb Zombie Atributes
new const zclass_name[] = { "Climb Zombie" // name
new const zclass_info[] = { "HP-- Speed+ Jump+ Knockback++" // description
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 1200 // health
const zclass_speed 220 // speed
const Float:zclass_gravity 0.8 // gravity
const Float:zclass_knockback 1.5 // knockback

public plugin_init() 
{
    
register_plugin("[ZP] Wallclimb ""1.0""WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi")
    
register_forward(FM_Touch,         "fwd_touch")
    
register_forward(FM_PlayerPreThink,     "fwd_playerprethink")
    
//register_forward(FM_PlayerPostThink,     "fwd_playerpostthink")
    
register_event("DeathMsg","EventDeathMsg","a")
    
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)
    
cvar_dmg2stop register_cvar("zp_smoker_dmg2stop""2")
    
cvar_zp_wallclimb register_cvar("zp_wallclimb""1")
    
cvar_zp_wallclimb_survivor register_cvar("zp_wallclimb_survivor""0")
    
cvar_zp_wallclimb_nemesis register_cvar("zp_wallclimb_nemesis""0")
        
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
}

public 
plugin_precache()
{
    
g_zclass_climb zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}

public 
EventDeathMsg()    
{
    new 
id read_data(2)
    
g_WallClimb[id] = true
    
return PLUGIN_HANDLED
}

public 
client_connect(id) {
    
g_WallClimb[id] = true    
}

public 
fwd_touch(idworld)
{
    if(!
is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id))
        return 
FMRES_IGNORED

    
new player STR_T
    
if (!player)
        return 
FMRES_IGNORED
        
    
new classname[STR_T]
    
pev(worldpev_classnameclassname, (STR_T))
    
    if(
equal(classname"worldspawn") || equal(classname"func_wall") || equal(classname"func_breakable"))
        
pev(idpev_origing_wallorigin[id])

    return 
FMRES_IGNORED
}



public 
fw_TakeDamage(victiminflictorattackerFloat:damage// if take damage drag off
{
    if (
is_user_alive(attacker) && (get_pcvar_num(cvar_dmg2stop) > 0))
    {
        
g_ovr_dmg[victim] = g_ovr_dmg[victim] + floatround(damage)
        if (
g_ovr_dmg[victim] >= get_pcvar_num(cvar_dmg2stop))
        {
            
g_ovr_dmg[victim] = 0
            g_WallClimb
[victim]
            return 
HAM_IGNORED;
        }
    }

    return 
HAM_IGNORED;
}

public 
wallclimb(idbutton)
{
    static 
Float:origin[3]
    
pev(idpev_originorigin)

    if(
get_distance_f(origing_wallorigin[id]) > 25.0)
        return 
FMRES_IGNORED  // if not near wall
    
    
if(fm_get_entity_flags(id) & FL_ONGROUND)
        return 
FMRES_IGNORED
        
    
if(button IN_FORWARD)
    {
        static 
Float:velocity[3]
        
velocity_by_aim(id120velocity)
        
fm_set_user_velocity(idvelocity)
    }
    else if(
button IN_BACK)
    {
        static 
Float:velocity[3]
        
velocity_by_aim(id, -120velocity)
        
fm_set_user_velocity(idvelocity)
    }
    return 
FMRES_IGNORED
}    

new 
g_damagedealt[33];
new 
bool:g_can_climb[33];

public 
fw_TakeDamage(victiminflictorattackerFloat:damage// if take damage drag off
{
    if (!
is_user_connected(attacker) || victim == attacker || !attacker)
        return 
HAM_IGNORED;
    
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_dmg2stop))
    {
        
g_can_climb[victim] = false
        g_damagedealt
[attacker] -= get_pcvar_num(cvar_dmg2stop)
    }

    
g_damagedealt[attacker] += floatround(damage)
        
    return 
HAM_IGNORED;
}

public 
fwd_playerprethink(id
{
    if(!
g_WallClimb[id] || !zp_get_user_zombie(id)) 
        return 
FMRES_IGNORED
        
    
if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0)
        return 
FMRES_IGNORED
        
    
if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0)
        return 
FMRES_IGNORED
    
    
new button fm_get_user_button(id)
    
    if((
get_pcvar_num(cvar_zp_wallclimb) == 1) && (button IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb))
    {
        
wallclimb(idbutton)
        
g_can_climb[id] = true;
    }else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) { //Jump + Duck = climb
        
wallclimb(idbutton)
        
g_can_climb[id] = true;
    }

    return 
FMRES_IGNORED



Artifact 05-11-2016 12:30

Re: [HELP] Error climber
 
1. You can not add 2 same functions, in this case this is fw_TakeDamage
2. In code you post on AlliedMods you got
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
   
    // Add your code here...
}

Solve that and that's it

B7PK 05-11-2016 14:07

Re: [HELP] Error climber
 
sry i Be aware not of this now i have just 1 Error

Code:

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

Warning: Loose indentation on line 79
Warning: Expression has no effect on line 127
Error: Symbol already defined: "fw_TakeDamage" on line 165

1 Error.
Could not locate output file C:\Users\abood\Desktop\zoz_class_climber.amx (compile failed).


siriusmd99 05-11-2016 16:00

Re: [HELP] Error climber
 
You joined the same 2 plugins :
I fixed it so it doesnt give error but it won't work properly in game...

PHP Code:

#include <amxmodx> 
// #include <engine> 
#include <fakemeta> 
#include <hamsandwich> 

#include <cstrike> 
#include <zombieplague.inc> 

//#include <fakemeta_util> 
#define STR_T           33 

// Stuff taken from fakemeta_util 
#define fm_get_user_button(%1) pev(%1, pev_button)     
/* stock fm_get_user_button(index) 
    return pev(index, pev_button) */ 

#define fm_get_entity_flags(%1) pev(%1, pev_flags) 
/* stock fm_get_entity_flags(index) 
    return pev(index, pev_flags) */ 

stock fm_set_user_velocity(entity, const Float:vector[3]) { 
    
set_pev(entitypev_velocityvector); 

    return 
1

//End of stuff from fakemeta_util 
//new STR_T[32] 
new g_damagedealt[33]; 
new 
bool:g_can_climb[33]; 

new 
bool:g_WallClimb[33
new 
Float:g_wallorigin[32][3
new 
cvar_zp_wallclimbcvar_zp_wallclimb_nemesiscvar_zp_wallclimb_survivor 
new g_zclass_climb 
new g_ovr_dmg[33
new 
cvar_dmg2stop 

// Climb Zombie Atributes 
new const zclass_name[] = { "Climb Zombie" // name 
new const zclass_info[] = { "HP-- Speed+ Jump+ Knockback++" // description 
new const zclass_model[] = { "zombie_source" // model 
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model 
const zclass_health 1200 // health 
const zclass_speed 220 // speed 
const Float:zclass_gravity 0.8 // gravity 
const Float:zclass_knockback 1.5 // knockback 

public plugin_init()  

    
register_plugin("[ZP] Wallclimb ""1.0""WallClimb by Python1320/Cheap_Suit, Plagued by Dabbi"
    
register_forward(FM_Touch,         "fwd_touch"
    
register_forward(FM_PlayerPreThink,     "fwd_playerprethink"
    
//register_forward(FM_PlayerPostThink,     "fwd_playerpostthink") 
    
register_event("DeathMsg","EventDeathMsg","a"
    
//register_cvar("zp_wallclimb_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY) 
    
cvar_dmg2stop register_cvar("zp_smoker_dmg2stop""2"
    
cvar_zp_wallclimb register_cvar("zp_wallclimb""1"
    
cvar_zp_wallclimb_survivor register_cvar("zp_wallclimb_survivor""0"
    
cvar_zp_wallclimb_nemesis register_cvar("zp_wallclimb_nemesis""0"
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage"
     


public 
plugin_precache() 

    
g_zclass_climb zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback


public 
EventDeathMsg()     

    new 
id read_data(2
    
g_WallClimb[id] = true 
    
return PLUGIN_HANDLED 


public 
client_connect(id) { 
    
g_WallClimb[id] = true     


public 
fwd_touch(idworld

    if(!
is_user_alive(id) || !g_WallClimb[id] || !pev_valid(id)) 
        return 
FMRES_IGNORED 

    
new player STR_T 
    
if (!player
        return 
FMRES_IGNORED 
         
    
new classname[STR_T
    
pev(worldpev_classnameclassname, (STR_T)) 
     
    if(
equal(classname"worldspawn") || equal(classname"func_wall") || equal(classname"func_breakable")) 
        
pev(idpev_origing_wallorigin[id]) 

    return 
FMRES_IGNORED 


public 
wallclimb(idbutton

    static 
Float:origin[3
    
pev(idpev_originorigin

    if(
get_distance_f(origing_wallorigin[id]) > 25.0
        return 
FMRES_IGNORED  // if not near wall 
     
    
if(fm_get_entity_flags(id) & FL_ONGROUND
        return 
FMRES_IGNORED 
         
    
if(button IN_FORWARD
    { 
        static 
Float:velocity[3
        
velocity_by_aim(id120velocity
        
fm_set_user_velocity(idvelocity
    } 
    else if(
button IN_BACK
    { 
        static 
Float:velocity[3
        
velocity_by_aim(id, -120velocity
        
fm_set_user_velocity(idvelocity
    } 
    return 
FMRES_IGNORED 
}     


public 
fw_TakeDamage(victiminflictorattackerFloat:damage// if take damage drag off 


    if (
is_user_alive(attacker) && (get_pcvar_num(cvar_dmg2stop) > 0)) 
    { 
        
g_ovr_dmg[victim] = g_ovr_dmg[victim] + floatround(damage
        if (
g_ovr_dmg[victim] >= get_pcvar_num(cvar_dmg2stop)) 
        { 
            
g_ovr_dmg[victim] = 
            g_WallClimb
[victim
            return 
HAM_IGNORED
        } 
    }

    if (!
is_user_connected(attacker) || victim == attacker || !attacker
        return 
HAM_IGNORED
     
    while (
g_damagedealt[attacker] > get_pcvar_num(cvar_dmg2stop)) 
    { 
        
g_can_climb[victim] = false 
        g_damagedealt
[attacker] -= get_pcvar_num(cvar_dmg2stop
    } 

    
g_damagedealt[attacker] += floatround(damage

    return 
HAM_IGNORED


public 
fwd_playerprethink(id)  

    if(!
g_WallClimb[id] || !zp_get_user_zombie(id))  
        return 
FMRES_IGNORED 
         
    
if(zp_is_survivor_round() && get_pcvar_num(cvar_zp_wallclimb_survivor) == 0
        return 
FMRES_IGNORED 
         
    
if(zp_is_nemesis_round() && get_pcvar_num(cvar_zp_wallclimb_nemesis) == 0
        return 
FMRES_IGNORED 
     
    
new button fm_get_user_button(id
     
    if((
get_pcvar_num(cvar_zp_wallclimb) == 1) && (button IN_USE) && (zp_get_user_zombie_class(id) == g_zclass_climb)) 
    { 
        
wallclimb(idbutton
        
g_can_climb[id] = true
    }else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_zombie_class(id) == g_zclass_climb)) { //Jump + Duck = climb 
        
wallclimb(idbutton
        
g_can_climb[id] = true
    } 

    return 
FMRES_IGNORED 



B7PK 05-11-2016 17:09

Re: [HELP] Error climber
 
What benefit if it did not work :/
i want it work in server


All times are GMT -4. The time now is 18:45.

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