Raised This Month: $32 Target: $400
 8% 

[ZP] Crear Niveles por AmmoPacks


  
 
 
Thread Tools Display Modes
<-----(MATIAS)----->
Senior Member
Join Date: Aug 2009
Location: Argentina - Entre Rios
Old 04-02-2010 , 22:30   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#71

Quote:
Originally Posted by Kiske View Post
Pasa el Codigo del TakeDamage.
PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
 static 
plrWeapId
 
if (is_user_connected(attacker))
  
plrWeapId get_user_weapon(attacker)
 
// 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])  
  return 
HAM_SUPERCEDE;  
 
 
// Prevent friendly fire
 
if (g_zombie[attacker] == g_zombie[victim])
  return 
HAM_SUPERCEDE;
 
 
// Attacker is human...
 
if (!g_zombie[attacker])
 {
  
damage *= get_pcvar_float(cvar_zombiearmor)
  switch (
plrWeapId)
  {
   case (
CSW_MP5NAVY): damage *= 14.0
   
case (CSW_FAMAS): damage *= 140.0 
   
case (CSW_AWP): damage *= 275.0
   
case (CSW_AUG): damage *= 190.0
   
case (CSW_SG552): damage *= 52.0
   
case (CSW_AK47): damage *= 280.0
   
case (CSW_M4A1): damage *= 210.0
   
case (CSW_XM1014): damage *= 61.0
   
case (CSW_G3SG1): damage *= 300.0
   
case (CSW_SG550): damage *= 165.0
   
case (CSW_DEAGLE): damage *= 90.0
   
case (CSW_ELITE): damage *= 64.0
   
case (CSW_M249): damage *= 90.0
   
case (CSW_UMP45): damage *= 3.0
   
case (CSW_GALIL): damage *= 41.0
   
case (CSW_M3): damage *= 20.0
   
case (CSW_SCOUT): damage *= 80.0
   
case (CSW_P90): damage *= 1.5
   
case (CSW_P228): damage *=  35.0
  
}
  
SetHamParamFloat(4damage)
 
  
// Armor multiplier for the final damage on normal zombies
  
if (!g_nemesis[victim])
  {
   
damage *= get_pcvar_float(cvar_zombiearmor)
   
SetHamParamFloat(4damage)
  }
 
  
// Reward ammo packs
  
if (!g_survivor[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)
   {
    if (
is_user_admin(attacker))
    {
     if (
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 6
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
     else if (!
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
    }
    else
    {
     if (
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
     else if (!
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
update_ap(attacker10)
       
g_damagedealt[attacker] -= ammodamage
      
}
     }
    }
    if(
g_ammopacks[attacker] < max_ammo)
    {
     
update_ap(attacker10)
     
g_damagedealt[attacker] -= ammodamage
    
}
   }
   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])
 {
  
// 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 || 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
 
update_ap(attackerget_pcvar_num(cvar_ammoinfect), 0// 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;

__________________
Zombie Assassin video:
Models:
IP: 201.212.2.13:27016

Last edited by <-----(MATIAS)----->; 04-02-2010 at 22:34.
<-----(MATIAS)-----> is offline
Send a message via MSN to <-----(MATIAS)----->
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 04-02-2010 , 22:33   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#72

todo eso de is_user_admin y todo eso se puede resumir a ..

PHP Code:
g_ammopacks[id] += is_user_admin(id) ? 
ahi , ganaria doble si es admin.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
<-----(MATIAS)----->
Senior Member
Join Date: Aug 2009
Location: Argentina - Entre Rios
Old 04-02-2010 , 22:35   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#73

ahah, lo que pasa es que yo no se optimizar
__________________
Zombie Assassin video:
Models:
IP: 201.212.2.13:27016
<-----(MATIAS)-----> is offline
Send a message via MSN to <-----(MATIAS)----->
tomjz
Senior Member
Join Date: Dec 2009
Old 04-20-2010 , 11:06   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#74

perdon por revivir, pero alguien podria tomarse el trabajo de explicarme como poner mi nivel en el hud? gracias.

al compilar me tira este error:

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

Error: Invalid function or  declaration on line 6733

1 Error.
la linea 6733 es:

PHP Code:
return update_ap(idg_ammopacks[id] + amount0
__________________

Last edited by tomjz; 04-20-2010 at 11:10.
tomjz is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 04-20-2010 , 11:10   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#75

Quote:
Originally Posted by tomjz View Post
perdon por revivir, pero alguien podria tomarse el trabajo de explicarme como poner mi nivel en el hud? gracias.

al compilar me tira este error:

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

Error: Invalid function or  declaration on line 6733

1 Error.
Could not locate output file  C:\Documents and  Settings\Administrador.COLOSO\Escritorio\zombie_plague40.amx (compile  failed).
la linea 6733 es:

PHP Code:
return update_ap(idg_ammopacks[id] + amount0
Quote:
Originally Posted by Kiske View Post

Se responderan Dudas siempre y cuando:
  • Se pregunte algo acorde al Tema.
  • Se pregunte algo Logico y Entendible.
No se responderan Dudas cuando:
  • Se pregunte algo que no tenga que ver con el Tutorial.
  • Se pregunte algo que no se entiende o que no tiene sentido.

Como por ejemplo:
No me sube de Nivel. ¿ Por Que ? [Esto Sera Respondido]

Yo quiero que aparesca mi Nivel en el Hud. ¿ Como Hago ? [Esto NO Sera Respondido porque aqui solo Explica como CREAR Niveles.] Yo por mi parte, preguntas de estas no las voy a responder, si otro quiere, puede hacerlo.



Esto Fue Todo!
Lee .
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
tomjz
Senior Member
Join Date: Dec 2009
Old 04-20-2010 , 11:19   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#76

Quote:
Originally Posted by lucas_7_94 View Post
Quote:
Originally Posted by tomjz
perdon por revivir, pero alguien podria tomarse el trabajo de explicarme como poner mi nivel en el hud? gracias.

al compilar me tira este error:

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

Error: Invalid function or declaration on line 6733

1 Error.
Could not locate output file C:\Documents and Settings\Administrador.COLOSO\Escritorio\zomb ie_plague40.amx (compile failed).
la linea 6733 es:

PHP Code:
return update_ap(id, 0 - g_ammopacks[id] + amount, 0)



Quote:
Originally Posted by Kiske

Se responderan Dudas siempre y cuando:
  • Se pregunte algo acorde al Tema.
  • Se pregunte algo Logico y Entendible.
No se responderan Dudas cuando:
  • Se pregunte algo que no tenga que ver con el Tutorial.
  • Se pregunte algo que no se entiende o que no tiene sentido.

Como por ejemplo:
No me sube de Nivel. ¿ Por Que ? [Esto Sera Respondido]

Yo quiero que aparesca mi Nivel en el Hud. ¿ Como Hago ? [Esto NO Sera Respondido porque aqui solo Explica como CREAR Niveles.] Yo por mi parte, preguntas de estas no las voy a responder, si otro quiere, puede hacerlo.



Esto Fue Todo!


Lee .
si otro quiere puede hacerlo, y yo puse: perdon por revivir, pero alguien podria tomarse el trabajo de explicarme como poner mi nivel en el hud? gracias.

o acaso puse Kiske de mi vida me decis como pongo el nivel en el hud? gracias s2. infeliz
__________________
tomjz is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 04-20-2010 , 11:22   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#77

Bueno , pone la variable de tu level en el hud , y como % pone %d

Hehe , Retard.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 04-20-2010 , 19:22   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#78

Quote:
Originally Posted by <-----(MATIAS)-----> View Post
PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
 static 
plrWeapId
 
if (is_user_connected(attacker))
  
plrWeapId get_user_weapon(attacker)
 
// 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])  
  return 
HAM_SUPERCEDE;  
 
 
// Prevent friendly fire
 
if (g_zombie[attacker] == g_zombie[victim])
  return 
HAM_SUPERCEDE;
 
 
// Attacker is human...
 
if (!g_zombie[attacker])
 {
  
damage *= get_pcvar_float(cvar_zombiearmor)
  switch (
plrWeapId)
  {
   case (
CSW_MP5NAVY): damage *= 14.0
   
case (CSW_FAMAS): damage *= 140.0 
   
case (CSW_AWP): damage *= 275.0
   
case (CSW_AUG): damage *= 190.0
   
case (CSW_SG552): damage *= 52.0
   
case (CSW_AK47): damage *= 280.0
   
case (CSW_M4A1): damage *= 210.0
   
case (CSW_XM1014): damage *= 61.0
   
case (CSW_G3SG1): damage *= 300.0
   
case (CSW_SG550): damage *= 165.0
   
case (CSW_DEAGLE): damage *= 90.0
   
case (CSW_ELITE): damage *= 64.0
   
case (CSW_M249): damage *= 90.0
   
case (CSW_UMP45): damage *= 3.0
   
case (CSW_GALIL): damage *= 41.0
   
case (CSW_M3): damage *= 20.0
   
case (CSW_SCOUT): damage *= 80.0
   
case (CSW_P90): damage *= 1.5
   
case (CSW_P228): damage *=  35.0
  
}
  
SetHamParamFloat(4damage)
 
  
// Armor multiplier for the final damage on normal zombies
  
if (!g_nemesis[victim])
  {
   
damage *= get_pcvar_float(cvar_zombiearmor)
   
SetHamParamFloat(4damage)
  }
 
  
// Reward ammo packs
  
if (!g_survivor[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)
   {
    if (
is_user_admin(attacker))
    {
     if (
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 6
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
     else if (!
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
    }
    else
    {
     if (
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 4
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
     }
     else if (!
g_happytime)
     {
      if (
Lvl[attacker] < 60)
      {
       
g_ammopacks[attacker] += 2
       g_damagedealt
[attacker] -= ammodamage
      
}
      else
      {
       
update_ap(attacker10)
       
g_damagedealt[attacker] -= ammodamage
      
}
     }
    }
    if(
g_ammopacks[attacker] < max_ammo)
    {
     
update_ap(attacker10)
     
g_damagedealt[attacker] -= ammodamage
    
}
   }
   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])
 {
  
// 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 || 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
 
update_ap(attackerget_pcvar_num(cvar_ammoinfect), 0// 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;


no entiendo por que hacer un switch en el takedamage en cuanto a la arma cuando lo puedes hacer facilmente con el evento cur weapon y hay le especificas el daño en una variable global y listo...
__________________
capostrike93 is offline
Niiqo
Veteran Member
Join Date: Feb 2010
Location: Bs As, Argentina
Old 04-20-2010 , 19:25   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#79

Quote:
Originally Posted by capostrike93 View Post
no entiendo por que hacer un switch en el takedamage en cuanto a la arma cuando lo puedes hacer facilmente con el evento cur weapon y hay le especificas el daño en una variable global y listo...
Pero ya lo tiene hecho asi xD, es mas facil dejarlo que ponerse a hacer otro, "La ley del menos esfuerzo "
Niiqo is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 04-20-2010 , 19:27   Re: [ES][ZP][TUT] Crear Niveles por AmmoPacks [Forma Completa y Buena]
#80

-.-"

la ley del flojo..

y no es nada dificil solo es copiar y pegar
__________________
capostrike93 is offline
Old 04-20-2010, 20:09
nikolas
This message has been deleted by Kiske. Reason: Parece que vamos a tener a otro Baneado...
 



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 22:15.


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