Raised This Month: $51 Target: $400
 12% 

Intentado hacer AP Frost y Fire


  
 
 
Thread Tools Display Modes
Author Message
Shion
Senior Member
Join Date: Dec 2008
Old 09-12-2011 , 16:49   Intentado hacer AP Frost y Fire
#1

Bueno Obviamente mas de uno me va a decir algo por intentar hacer la AP Frost y la Fire pero weno...
Cree 2 bools, 1 para la ap fire y otro para la frost, Bueno ise todo lo qe tendria que hacer para que la AP Frost Congele y la AP Fire Prenda fuego...
Pero al testear me doy cuenta de que no funca, Compila Perfecto, 0 errores 0 warnings ni nada. Yo pienso que el error viene de aca :

PHP Code:
        switch (get_user_weapon(attacker))
        {
            case 
CSW_AWP:
            {
                if (
g_apfrost[attacker])
                {
                
frost_man(victim)
                }
                if (
g_apfire[attacker])
                {
                
fire_player(victim)
                }
            }
        } 
Algo esta mal ?
En caso de que no este mal Posteare mas de lo que hice para ver en QUE me equivoqe.

Espero su respuesta.
__________________
Shion is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 09-12-2011 , 21:06   Re: Intentado hacer AP Frost y Fire
#2

frost_man?

muestre esas 2 funciones.
XINLEI is offline
Shion
Senior Member
Join Date: Dec 2008
Old 09-13-2011 , 21:41   Re: Intentado hacer AP Frost y Fire
#3

jjajaja las saqe del zbug

PHP Code:
frost_man(victim)
{
    
// Get origin
    
static Float:originF[3]
    
pev(victimpev_originoriginF)
    
    
// Frost nade explode sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_WEAPONgrenade_frost[random_num(0sizeof grenade_frost 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Only effect alive unfrozen zombies
    
if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nodamage[victim])
        return;
    
    
// Freeze icon?
    
if (get_pcvar_num(cvar_hudicons))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_DROWN// damage type - DMG_FREEZE
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Light blue glow while frozen
    #if defined HANDLE_MODELS_ON_SEPARATE_ENT
    
fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell0150250kRenderNormal1)
    
#else
    
fm_set_rendering(victimkRenderFxGlowShell0150250kRenderNormal1)
    
#endif
    
    // Freeze sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_BODYgrenade_frost_player[random_num(0sizeof grenade_frost_player 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Get freeze duration setting
    
static Float:freezeduration
    freezeduration 
get_pcvar_float(cvar_freezeduration)
    
    
// Add a blue tint to their screen
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_victim)
    
write_short(UNIT_SECOND*1// duration
    
write_short(floatround(UNIT_SECOND*freezeduration)) // hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
// Prevent from jumping
    
if (pev(victimpev_flags) & FL_ONGROUND)
        
set_pev(victimpev_gravity999999.9// set really high
    
else
        
set_pev(victimpev_gravity0.000001// no gravity
    
    // Set a task to remove the freeze
    
g_frozen[victim] = true;
    
set_task(freezeduration/2"remove_freeze"victim)
}

fire_player(victim)
{
    
// Get origin
    
static Float:originF[3]
    
pev(victimpev_originoriginF)
    
    
// Fire nade explode sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_WEAPONgrenade_fire_player[random_num(0sizeof grenade_fire_player 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Only effect alive zombies
    
if (!is_user_alive(victim) || !g_zombie[victim] || g_nodamage[victim])
        return;
    
    
// Heat icon?
    
if (get_pcvar_num(cvar_hudicons))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_BURN// damage type
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Our task params
    
static params[1]
    
    if (
g_nemesis[victim]) // fire duration (nemesis takes less)
        
params[0] = get_pcvar_num(cvar_fireduration)
    else
    
params[0] = get_pcvar_num(cvar_fireduration)*5
    
    
// Set burning task on victim
    
set_task(0.1"burning_flame"victim+TASK_BLOODparamssizeof params)

__________________
Shion is offline
091231238123
BANNED
Join Date: Aug 2011
Old 09-13-2011 , 22:30   Re: Intentado hacer AP Frost y Fire
#4

yo tengo asi y me anda
PHP Code:
 fire_player(victim)
{
    
// Get origin
    
static Float:originF[3]
    
pev(victimpev_originoriginF)
    
    
// Fire nade explode sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_WEAPONgrenade_fire_player[random_num(0sizeof grenade_fire_player 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Only effect alive zombies
    
if (!is_user_alive(victim) || !g_zombie[victim] || g_nodamage[victim])
        return;
    
    
// Heat icon?
    
if (get_pcvar_num(cvar_hudicons))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_BURN// damage type
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Our task params
    
static params[1]
    
    if (
g_nemesis[victim]) // fire duration (nemesis takes less)
        
params[0] = get_pcvar_num(cvar_fireduration)
    else
    
params[0] = get_pcvar_num(cvar_fireduration)*5
    
    
// Set burning task on victim
    
set_task(0.1"burning_flame"victim+TASK_BLOODparamssizeof params)
}

frost_man(victim)
{
    
// Nemesis shouldn't be frozen
    
if (g_nemesis[victim])
    {
        
// Get player's origin
        
static Float:origin2F[3]
        
pev(victimpev_originorigin2F)
            
        
// Broken glass sound
        
engfunc(EngFunc_EmitSoundvictimCHAN_BODYgrenade_frost_break[random_num(0sizeof grenade_frost_break 1)], 1.0ATTN_NORM0PITCH_NORM)
            
        
// Glass shatter
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYorigin2F0)
        
write_byte(TE_BREAKMODEL// TE id
        
engfunc(EngFunc_WriteCoordorigin2F[0]) // x
        
engfunc(EngFunc_WriteCoordorigin2F[1]) // y
        
engfunc(EngFunc_WriteCoordorigin2F[2]+24.0// z
        
write_coord(16// size x
        
write_coord(16// size y
        
write_coord(16// size z
        
write_coord(random_num(-5050)) // velocity x
        
write_coord(random_num(-5050)) // velocity y
        
write_coord(25// velocity z
        
write_byte(10// random velocity
        
write_short(g_glassSpr// model
        
write_byte(10// count
        
write_byte(25// life
        
write_byte(BREAK_GLASS// flags
        
message_end()

    }
        
    
// Get origin
    
static Float:originF[3]
    
pev(victimpev_originoriginF)
    
    
// Frost nade explode sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_WEAPONgrenade_frost[random_num(0sizeof grenade_frost 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Only effect alive unfrozen zombies
    
if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nodamage[victim])
        return;
    
    
// Freeze icon?
    
if (get_pcvar_num(cvar_hudicons))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_DROWN// damage type - DMG_FREEZE
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Light blue glow while frozen
    #if defined HANDLE_MODELS_ON_SEPARATE_ENT
    
fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell0150250kRenderNormal1)
    
#else
    
fm_set_rendering(victimkRenderFxGlowShell0150250kRenderNormal1)
    
#endif
    
    // Freeze sound
    
engfunc(EngFunc_EmitSoundvictimCHAN_BODYgrenade_frost_player[random_num(0sizeof grenade_frost_player 1)], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Get freeze duration setting
    
static Float:freezeduration
    freezeduration 
get_pcvar_float(cvar_freezeduration)
    
    
// Add a blue tint to their screen
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_victim)
    
write_short(UNIT_SECOND*1// duration
    
write_short(floatround(UNIT_SECOND*freezeduration)) // hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
// Prevent from jumping
    
if (pev(victimpev_flags) & FL_ONGROUND)
        
set_pev(victimpev_gravity999999.9// set really high
    
else
        
set_pev(victimpev_gravity0.000001// no gravity
    
    // Set a task to remove the freeze
    
g_frozen[victim] = true;
    
set_task(freezeduration/2"remove_freeze"victim)

y en takedamage
PHP Code:
        if (get_user_weapon(attacker) == CSW_AWP)
        {
            if (!
g_nemesis[victim])
            {
                if (
freezerifle[attacker])
                {
                    
frost_man(victim)
                }
            }
            if (
fire_rifle[attacker])
            {
                
fire_player(victim)
            }
        } 
091231238123 is offline
Shion
Senior Member
Join Date: Dec 2008
Old 09-13-2011 , 23:09   Re: Intentado hacer AP Frost y Fire
#5

Sige sin funcar :S

puede ser qe este mal aca ?

switch (selection)
{
case 19: g_apfire[id] = true
}
switch (selection)
{
case 20: g_apfrost[id] = true
}

Puede ser qe sea por qe no lo tengo en el lugar 20 a la ap frost o fire ?


Edit: Puse las aps en los lugares 20 y 21 y no funca :S
__________________

Last edited by Shion; 09-13-2011 at 23:20.
Shion is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 09-14-2011 , 02:46   Re: Intentado hacer AP Frost y Fire
#6

PHP Code:
switch(selection)
{
    case 
19:
    case 
20:

Stereo is offline
XCristiaNX
Veteran Member
Join Date: Dec 2009
Old 09-14-2011 , 10:06   Re: Intentado hacer AP Frost y Fire
#7

Quote:
Originally Posted by Shion View Post
PHP Code:
        switch (get_user_weapon(attacker))
        {
            case 
CSW_AWP:
            {
                if (
g_apfrost[attacker])
                {
                           
frost_man(victim)
                }
                else if (
g_apfire[attacker])
                {
                           
fire_player(victim)
                }
            }
        } 
O es 1 o es el otro...no creo que quieras que sean los dos al mismo tiempo

PD: Que es lo que no funciona?...no lo congela, no lo quema, las dos juntas?

Saludos
XCristiaNX is offline
Shion
Senior Member
Join Date: Dec 2008
Old 09-14-2011 , 12:36   Re: Intentado hacer AP Frost y Fire
#8

No qema ni congela, era por lo de las cases mepa, por qe ahora acomode las cases como dijo Stereo y me dice undefined simbol para Victim y para attacker... como hago para que no tire ese error ?

EDIT: ahi agregue
static victim
static attacker

y ahora compila todo biem pero sigue sin congelar :/
__________________

Last edited by Shion; 09-14-2011 at 12:46.
Shion is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 09-14-2011 , 12:40   Re: Intentado hacer AP Frost y Fire
#9

Usa las funciones del zp de mercy no uses las del zbug, además, la idea sería hacer
case x: variable = tal
case x2: variable = tal2

y después ahí de acuerdo a la opción elegis la función
__________________
Massive Infection:: Piu-Games
Desktop is offline
Shion
Senior Member
Join Date: Dec 2008
Old 09-14-2011 , 14:46   Re: Intentado hacer AP Frost y Fire
#10

Algo aca esta mal:

PHP Code:
        if (get_user_weapon(attacker) == CSW_AWP)
        {
            if (!
g_nemesis[victim])
        {
            if (
g_apfrost[attacker])
            {
                
frost_man(victim)
            }
        }
        if (
g_apfire[attacker])
        {
            
fire_player(victim)
        }
        } 
no me doy cuenta que, me doy cuenta que es asi por que le setie un model y compila perfecto y me pide el model cuando abro el zp, pero cuando entro y la elijo el arma no tiene el model de apfrost. aveer una ayuda gl
__________________

Last edited by Shion; 09-14-2011 at 14:49.
Shion is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:06.


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