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

[ayu] Granada de Campo y Hielo zp 4.2


  
 
 
Thread Tools Display Modes
Author Message
XxDioSxX
Senior Member
Join Date: Nov 2012
Location: argentina
Old 12-20-2012 , 11:49   [ayu] Granada de Campo y Hielo zp 4.2
#1

hola a todos.... bueno tengo 2 problemitas y una vez resueltos termino mi zp Beta

el primero es con la granada de hielo, le saque en la parte de // Victim shouldn't take damage or victim is frozen para que cada vez que congele a un zombie pueda recibir daņo, no me funciono

PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED;
    
    
// New round starting or round ended
    
if (g_newround || g_endround)
        return 
HAM_SUPERCEDE;
    
    
// Victim shouldn't take damage or victim is frozen
    
if (g_nodamage[victim])  // aca el tuto me decia que tenia que borrar "|| g_frozen[victim]" no paso nada
        
return HAM_SUPERCEDE;
    
    
// Prevent friendly fire
    
if (g_zombie[attacker] == g_zombie[victim])
        return 
HAM_SUPERCEDE;
        
    
// Attacker is human...
    
if (!g_zombie[attacker])
    {
        
// Wesker damage x3
        
if (g_wesker[attacker] || get_user_weapon(attacker) == CSW_DEAGLE && g_weskerdeagle[attacker])
        {
            if (
g_nemesis[victim])
                
SetHamParamFloat(4damage 3)
            else
                
SetHamParamFloat(4damage 3)
        }
        
// Reward ammo packs
        
if (!g_survivor[attacker] || !g_sniper[attacker] || !g_l4d[attacker] || !g_depredador[attacker] || !g_wesker[attacker] && !get_pcvar_num(cvar_survignoreammo))
        {
            
// Store damage dealt
            
g_damagedealt[attacker] += floatround(damage)
            
            
// Get damage required to get an ammo pack
            
static ammodamage
            ammodamage 
get_pcvar_num(cvar_ammodamage)
            
            
// Reward ammo packs for every [ammo damage] dealt
            
while (g_damagedealt[attacker] >= (ammodamage / (g_happytime 1)) )
            {
                
g_ammopacks[attacker]++
                
g_ammopacks[attacker]++
                
g_damagedealt[attacker] -= ammodamage
            
}
        }
        
// Replace damage done by Sniper's weapon with the one set by the cvar
        
if (g_sniper[attacker] && g_currentweapon[attacker] == CSW_AWP)
            
SetHamParamFloat(4get_pcvar_float(cvar_sniperdamage))
            
        return 
HAM_IGNORED;
    }
    
    
// Attacker is zombie...
    
    // Prevent infection by HE grenade (bugfix)
    
if (damage_type DMG_HEGRENADE)
        return 
HAM_SUPERCEDE;
    
// Nemesis?
    
if (g_nemesis[attacker] || g_assassin[attacker] || g_alien[attacker])
    {
        
// Set nemesis damage
        
SetHamParamFloat(4get_pcvar_float(cvar_nemdamage))
        return 
HAM_IGNORED;
    }
    
    
// Last human or swarm round or plague round
    
if (g_swarmround || g_plagueround || g_nemround || g_assassinround || g_alienround || g_mutacionround || fnGetHumans() == 1)
        return 
HAM_IGNORED// human is killed
    
    // Does human armor need to be reduced before infecting?
    
if (get_pcvar_num(cvar_humanarmor))
    {
        
// Get victim armor
        
static Float:armor
        pev
(victimpev_armorvaluearmor)
        
        
// Block the attack if he has some
        
if (armor 0.0)
        {
            
engfunc(EngFunc_EmitSoundvictimCHAN_BODYsound_armorhit1.0ATTN_NORM0PITCH_NORM)
            
set_pev(victimpev_armorvaluefloatmax(0.0armor damage))
            return 
HAM_SUPERCEDE;
        }
    }
    
    
// Infection allowed
    
SendDeathMsg(attackervictim// send death notice
    
FixDeadAttrib(victim// fix the "dead" attrib on scoreboard
    
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect), 11// add corresponding frags and deaths
    
    
zombieme(victimattacker00// turn into zombie
    
g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect// ammo packs given to zombie for infection
    
fm_set_user_health(attackerpev(attackerpev_health)+get_pcvar_num(cvar_zombiebonushp)) // attacker gets bonus HP for the infection
    
    
return HAM_SUPERCEDE;

el segundo es con el campo.... quiero que el nemesis lo atraviese junto otras clases de otros modos...
le saque en la parte de la public entity_touch(touched, toucher) el g_nemesis[toucher] tampoco me funciono, es del tuto de Fail! la granada de campo..

PHP Code:

// Touch bomb bubble
public entity_touch(touchedtoucher// entidad cuando un zombie o nemesis la toca
{
    
    if(
g_zombie[toucher]) // aca le saque la del neme || g_nemesis[toucher]
    
{
        new 
Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power get_pcvar_float(cvar_bubblepush// intensidad de rechazo
        
        
pev(touchedpev_originpos_ptr// nose que es
        
pev(toucherpev_originpos_ptd// nose que es
        
        
for(new 03i++)
        {
            
pos_ptd[i] -= pos_ptr[i// nose que es
            
pos_ptd[i] *= push_power // poder cuando lo tocamos y nos rechaza
        
}
        
set_pev(toucherpev_velocitypos_ptd// velocidad del rechazo
        
set_pev(toucherpev_impulsepos_ptd// impulso del rechazo
    
}
}

// Hook bubble bomb
public hook_curwpn(id)
{
    if(!
is_user_alive(id)) // cliente muerto no recibe =D
        
return PLUGIN_CONTINUE;
    
    if(
g_bubble_bomb[id] && !g_zombie[id]) // la bomba solo la puede adquirir un humano
    
{
        new 
wID read_data(2)
        if(
wID == CSW_SMOKEGRENADE// toma el lugar de la smoke grenade
            
set_pev(idpev_viewmodel2model_grenade// modelo de la grana
    
}
    
    return 
PLUGIN_CONTINUE;
}

// Give bubble item / hacemos que nos de el campo
public give_item_bubble(id)
{
    
g_bubble_bomb[id] = true // seteamos la variable a true
    
fm_give_item(id,"weapon_smokegrenade"// le pedimos una smoke ya que el campo la remplaza
}

// Remove Entity / removemos la entidad con el task
public DeleteEntity(entity)
{
    if(
is_valid_ent(entity )) // hacemos valida la entidad
        
remove_entity(entity// la removemos...

saludos....

_____________________________________________ ___
Gracias Allied Modders
Video: Menu de Granadas, Efectos, Lanza Granadas
http://www.youtube.com/watch?v=2RmAOPBGvuM

Last edited by XxDioSxX; 12-20-2012 at 12:12.
XxDioSxX is offline
Send a message via MSN to XxDioSxX Send a message via Skype™ to XxDioSxX
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 12-20-2012 , 11:55   Re: [ayu] Granada de Campo y Hielo
#2

posteame el code
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
XxDioSxX
Senior Member
Join Date: Nov 2012
Location: argentina
Old 12-20-2012 , 12:03   Re: [ayu] Granada de Campo y Hielo
#3

ahi la postie

Last edited by XxDioSxX; 12-20-2012 at 12:08.
XxDioSxX is offline
Send a message via MSN to XxDioSxX Send a message via Skype™ to XxDioSxX
GalaxyA
BANNED
Join Date: Sep 2012
Location: Noob Member
Old 12-20-2012 , 12:07   Re: [ayu] Granada de Campo y Hielo
#4

Quote:
Originally Posted by XxDioSxX View Post
esta es la de campo
PHP Code:
    if(g_zombie[toucher] && !g_nemesis[toucher]) // aca le saque la de nemesis
    
{
        new 
Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power get_pcvar_float(cvar_bubblepush// intensidad de rechazo
        
        
pev(touchedpev_originpos_ptr// nose que es
        
pev(toucherpev_originpos_ptd// nose que es
       
. ...............................................code 
GalaxyA is offline
Send a message via MSN to GalaxyA
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 12-20-2012 , 12:17   Re: [ayu] Granada de Campo y Hielo zp 4.2
#5

1 -https://forums.alliedmods.net/showthread.php?p=1849399#post1849399
2- proba lo de galaxya
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
XxDioSxX
Senior Member
Join Date: Nov 2012
Location: argentina
Old 12-20-2012 , 12:36   Re: [ayu] Granada de Campo y Hielo zp 4.2
#6

de 10.... me andubieron las 2... gracias son unos genios...




_____________________________________________ ___
Gracias Allied Modders
Video: Menu de Granadas, Efectos, Lanza Granadas
http://www.youtube.com/watch?v=2RmAOPBGvuM
XxDioSxX is offline
Send a message via MSN to XxDioSxX Send a message via Skype™ to XxDioSxX
GalaxyA
BANNED
Join Date: Sep 2012
Location: Noob Member
Old 12-20-2012 , 12:51   Re: [ayu] Granada de Campo y Hielo zp 4.2
#7

Quote:
Originally Posted by XxDioSxX View Post
de 10.... me andubieron las 2... gracias son unos genios...
Por decirte :
PHP Code:
//g_zombie[%1] es una variable que mete a g_nemesis[%1]... entonces en ese if de la buble te decia que
 
if(g_zombie[toucher]) // osea si es zombie el que toca la buble (tambien es para g_nemesis) entonces 
//solo tienes que decir que no quieres que sea el nemesis y tu haces esto entonce xd:
if(g_zombie[toucher] && !g_nemesis[toucher]) // si es zombie y NO es nemesis, para en la bubble. 
Esto lo han repetido 1000 veces
! = Negador
if = condicion
&& = y
|| = ķ

Last edited by GalaxyA; 12-20-2012 at 12:53.
GalaxyA is offline
Send a message via MSN to GalaxyA
 



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 03:06.


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