AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with a class of zombie (https://forums.alliedmods.net/showthread.php?t=89717)

alan_el_more 04-09-2009 16:50

Problem with a class of zombie
 
i have this:

PHP Code:

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

#define PLUGIN "[ZP] Clase : Zombie Incandescente"
#define VERSION "1.0"
#define AUTHOR "alan_el_more"

new g_zclaseaura[33], g_maxplayers

// Zombie Attributes
new const zclass_name[] = { "Zombie Incandescente" // nombre
new const zclass_info[] = { "Aura" // descripcion
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // model de las manos
const zclass_health 5000 // vida
const zclass_speed // velocidad
const Float:zclass_gravity 1.0 // gravedad
const Float:zclass_knockback 1.0 // knockback
const zclass_infecthp 500 // vida extra por infeccion

public plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_PlayerPreThink"FwdPrethink")
    
register_event("DeathMsg""player_die""a")
    
g_maxplayers get_maxplayers()
}
public 
plugin_precache()
{
    
g_zclase zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
}

public 
zp_user_infected_post(playerinfector)
{
    if (
zp_get_user_zombie_class(player) == g_zclase)
        
aura[player] = true
}

public 
zp_user_humanized_post(id)
{
    if(
aura[id])
        
aura[id] = false
}
public 
player_die()
{
    for(new 
idid <= g_maxplayersid++)
    if(
aura[id])
        
aura[id] = false
}

public 
FwdPrethink(id)
{
    if(!
aura[id] || !is_user_alive(id))
        return
    
    if (
zp_get_user_zombie_class(id) == g_zclase)    
    {
        static 
Float:originF[3]            
        
pev(idpev_originoriginF)
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT)
        
engfunc(EngFunc_WriteCoordoriginF[0])
        
engfunc(EngFunc_WriteCoordoriginF[1])
        
engfunc(EngFunc_WriteCoordoriginF[2])
        
write_byte(10// radio
        
write_byte(255// rojo
        
write_byte(0// verde
        
write_byte(0)  // azul
        
write_byte(2)
        
write_byte(0)
        
message_end()
    }


The problem is that the zombie does not move.
Does anyone i could solve?
Thanks in advance :D

Anggara_nothing 04-09-2009 21:10

Re: Problem with a class of zombie
 
Quote:

Originally Posted by alan_el_more (Post 801760)
i have this:

PHP Code:

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

#define PLUGIN "[ZP] Clase : Zombie Incandescente"
#define VERSION "1.0"
#define AUTHOR "alan_el_more"

new g_zclaseaura[33], g_maxplayers

// Zombie Attributes
new const zclass_name[] = { "Zombie Incandescente" // nombre
new const zclass_info[] = { "Aura" // descripcion
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // model de las manos
const zclass_health 5000 // vida
const zclass_speed // velocidad
const Float:zclass_gravity 1.0 // gravedad
const Float:zclass_knockback 1.0 // knockback
const zclass_infecthp 500 // vida extra por infeccion

public plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_PlayerPreThink"FwdPrethink")
    
register_event("DeathMsg""player_die""a")
    
g_maxplayers get_maxplayers()
}
public 
plugin_precache()
{
    
g_zclase zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
}

public 
zp_user_infected_post(playerinfector)
{
    if (
zp_get_user_zombie_class(player) == g_zclase)
        
aura[player] = true
}

public 
zp_user_humanized_post(id)
{
    if(
aura[id])
        
aura[id] = false
}
public 
player_die()
{
    for(new 
idid <= g_maxplayersid++)
    if(
aura[id])
        
aura[id] = false
}

public 
FwdPrethink(id)
{
    if(!
aura[id] || !is_user_alive(id))
        return
    
    if (
zp_get_user_zombie_class(id) == g_zclase)    
    {
        static 
Float:originF[3]            
        
pev(idpev_originoriginF)
        
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_DLIGHT)
        
engfunc(EngFunc_WriteCoordoriginF[0])
        
engfunc(EngFunc_WriteCoordoriginF[1])
        
engfunc(EngFunc_WriteCoordoriginF[2])
        
write_byte(10// radio
        
write_byte(255// rojo
        
write_byte(0// verde
        
write_byte(0)  // azul
        
write_byte(2)
        
write_byte(0)
        
message_end()
    }


The problem is that the zombie does not move.
Does anyone i could solve?
Thanks in advance :D

because, you set speed is 1.
Quote:

const zclass_speed = 1

alan_el_more 04-09-2009 21:28

Re: Problem with a class of zombie
 
I had not seen him, thank you :D

Anggara_nothing 04-09-2009 21:38

Re: Problem with a class of zombie
 
Quote:

Originally Posted by alan_el_more (Post 801888)
I had not seen him, thank you :D

oh, no problem. i like to helping people.


All times are GMT -4. The time now is 02:22.

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