[ZP] RESUELTO Clase humana escalador se agarra pero no sube paredes
#1
Intente crear una clase de humano que escala paredes igual que la clase zombie, pero tiene un problema, cuando intento subir las paredes se agarra y no sube solo se mueve por la pared hacia bajo lento, es decir no funcciona igual que la clase zombie, me pueden echar un ojo al sma?


Archivos adjuntos
.sma   Descargar AMXX / zpxp_15_humano_escalador.sma (Tamaño: 3.93 KB / Descargas: 37)
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Responder
#2
mira ami me funciona perfecto yo abia echo esto hace mucho tiempo con el zombie climb pero modifique el .sma a zombie xp dime si te funciona aca te dejo el code

Código PHP:
#include <amxmodx>

//#include <engine>

#include <fakemeta>

#include <zombiexp>



#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_hclass_climb



// Human Attributes

new const hclass_name[] = { "Escalador" // name

new const hclass_info[] = { "Deagle, Elite y Fiveseven" // description

new const hclass_model[] = { "sas" // model

new const hclass_weapons[] = { WEAPON_DEAGLEWEAPON_ELITEWEAPON_FIVESEVEN // weapons

const hclass_health 100 // health

const hclass_speed 240 // speed

const Float:hclass_gravity 1.0 // gravity

const hclass_level 15 // level required to use



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_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")

    

}



public 
plugin_precache()

{

    
g_hclass_climb zpxp_register_human_class(hclass_namehclass_infohclass_modelhclass_weaponshclass_healthhclass_speedhclass_gravityhclass_level)

}



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 
fwd_playerprethink(id

{

    if(!
g_WallClimb[id] || !zp_get_user_human(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_human_class(id) == g_hclass_climb)) //Use button = climb

    
wallclimb(idbutton)

    else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_human_class(id) == g_hclass_climb)) //Jump + Duck = climb

    
wallclimb(idbutton)



    return 
FMRES_IGNORED


dime sy te funciona Tímido
Responder
#3
(16/10/2013, 11:23 PM)PerfecScore escribió: mira ami me funciona perfecto yo abia echo esto hace mucho tiempo con el zombie climb pero modifique el .sma a zombie xp dime si te funciona aca te dejo el code

Código PHP:
#include <amxmodx>

//#include <engine>

#include <fakemeta>

#include <zombiexp>



#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_hclass_climb



// Human Attributes

new const hclass_name[] = { "Escalador" // name

new const hclass_info[] = { "Deagle, Elite y Fiveseven" // description

new const hclass_model[] = { "sas" // model

new const hclass_weapons[] = { WEAPON_DEAGLEWEAPON_ELITEWEAPON_FIVESEVEN // weapons

const hclass_health 100 // health

const hclass_speed 240 // speed

const Float:hclass_gravity 1.0 // gravity

const hclass_level 15 // level required to use



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_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")

    

}



public 
plugin_precache()

{

    
g_hclass_climb zpxp_register_human_class(hclass_namehclass_infohclass_modelhclass_weaponshclass_healthhclass_speedhclass_gravityhclass_level)

}



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 
fwd_playerprethink(id

{

    if(!
g_WallClimb[id] || !zp_get_user_human(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_human_class(id) == g_hclass_climb)) //Use button = climb

    
wallclimb(idbutton)

    else if((
get_pcvar_num(cvar_zp_wallclimb) == 2) && (button IN_JUMP) && button IN_DUCK && (zp_get_user_human_class(id) == g_hclass_climb)) //Jump + Duck = climb

    
wallclimb(idbutton)



    return 
FMRES_IGNORED


dime sy te funciona Tímido



Funcciona perfectamente, gracias, avia un error al copilar en la linea 119 y cambie esto:

Código PHP:
if(!g_WallClimb[id] || !zp_get_user_human(id)) 



por esto otro:

Código PHP:
if(!g_WallClimb[id] || !zp_get_user_human_class(id)) 
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Responder
#4
no me fije esk ya lo tenia y no vi el code mucho tiempo solo lo pase como el tuyo pero a xp
Responder
#5
(17/10/2013, 02:16 AM)PerfecScore escribió: no me fije esk ya lo tenia y no vi el code mucho tiempo solo lo pase como el tuyo pero a xp



Gracias Gran sonrisa
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Responder
#6
(17/10/2013, 05:34 AM)Tig escribió:
(17/10/2013, 02:16 AM)PerfecScore escribió: no me fije esk ya lo tenia y no vi el code mucho tiempo solo lo pase como el tuyo pero a xp



Gracias Gran sonrisa



Si pones extra de escalada seguramente te falle por eso. Quitalo.
Responder
#7
(17/10/2013, 02:41 PM)xPecie escribió:
(17/10/2013, 05:34 AM)Tig escribió:
(17/10/2013, 02:16 AM)PerfecScore escribió: no me fije esk ya lo tenia y no vi el code mucho tiempo solo lo pase como el tuyo pero a xp



Gracias Gran sonrisa



Si pones extra de escalada seguramente te falle por eso. Quitalo.



No tiene porque, simplente coges la clase de humano escalador y cambias de nombre la variable y los cvar y va todo de lujo y no se cruzan el item con la clase por ningun lado
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)