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

[ES][TUT][zp]crear bomba de antidoto dentro del zp


  
 
 
Thread Tools Display Modes
Author Message
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-30-2010 , 18:21   [ES][TUT][zp]crear bomba de antidoto dentro del zp
#1

Aun no es un buen tuto xD,a medida q valla aprendiendo yo mismo, voy agregando info.
---------------------------------------------------------------
code by AfteR.
Crear bomba de antidoto dentro del zp.

*1:
Vamos a :
PHP Code:
// pev_ field used to store custom nade types and their values 
Tendran algo similar a esto:
PHP Code:
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_INFECTION 1111
const NADE_TYPE_NAPALM 2222
const NADE_TYPE_FROST 3333
const NADE_TYPE_FLARE 4444
const PEV_FLARE_COLOR pev_punchangle 
Bueno aqui agregamos la constante de la grenada.
PHP Code:
const NADE_TYPE_ANTIDOTEBOMB 5555  //si tienen utilizado ese valor pongan orto como 6666. 
Y quedaria asi:
PHP Code:
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_INFECTION 1111
const NADE_TYPE_NAPALM 2222
const NADE_TYPE_FROST 3333
const NADE_TYPE_FLARE 4444
const NADE_TYPE_ANTIDOTEBOMB 5555
const PEV_FLARE_COLOR pev_punchangle 
*2
Buscamos el siguiente if:
PHP Code:
else if (equal(model[7], "w_fl"
Luego reemplazan todo lo que este abajo del if por esto:
PHP Code:
if(!g_zombie[pev(entitypev_owner)] && g_antidote_bomb[pev(entitypev_owner)])
 {
  
fm_set_rendering(entitykRenderFxGlowShell255500kRenderNormal16)
 
  
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
  
write_byte(TE_BEAMFOLLOW// TE id
  
write_short(entity// entity
  
write_short(g_trailSpr// sprite
  
write_byte(10// life
  
write_byte(10// width
  
write_byte(255// r
  
write_byte(128// g
  
write_byte(0// b
  
write_byte(200// brightness
  
message_end()
 
  
set_pev(entitypev_flTimeStepSoundNADE_TYPE_ANTIDOTEBOMB)
 }
 else
 {
  
// Give it a glow
  
fm_set_rendering(entitykRenderFxGlowShell0100200kRenderNormal16);
 
  
// And a colored trail
  
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
  
write_byte(TE_BEAMFOLLOW// TE id
  
write_short(entity// entity
  
write_short(g_trailSpr// sprite
  
write_byte(10// life
  
write_byte(10// width
  
write_byte(0// r
  
write_byte(100// g
  
write_byte(200// b
  
write_byte(200// brightness
  
message_end()
 
  
// Set grenade type on the thrown grenade entity
  
set_pev(entityPEV_NADE_TYPENADE_TYPE_FROST)
 } 
pd:no se olviden de cerrar el "{"

*3
Ahora buscamos esta linea:
PHP Code:
// Check if it's one of our custom nades 
Y abajo de case NADE_TYPE_FROST agregan esto:
PHP Code:
case NADE_TYPE_ANTIDOTEBOMB:
  {
   
antidote_explode(entity// llamamos a la entidad de la antidote bomb
  

Quedaria asi:
PHP Code:
 // Check if it's one of our custom nades
 
switch (pev(entityPEV_NADE_TYPE))
 {
  case 
NADE_TYPE_INFECTION// Infection Bomb
  
{
   
infection_explode(entity)
  }
  case 
NADE_TYPE_NAPALM// Napalm Grenade
  
{
   
fire_explode(entity)
  }
 
  case 
NADE_TYPE_FROST// Frost Grenade
  
{
   
frost_explode(entity)
  }
  case 
NADE_TYPE_ANTIDOTEBOMB:
  {
   
antidote_explode(entity// llamamos a la entidad de la antidote bomb
  

*4
Una ves echo eso vamos al final de todo el plugin y agregamos esto:
PHP Code:
// Antidote Bomb
public give_item_antidote_bomb(id)
{
    
g_antidote_bomb[id] = true // seteamos la variable a true
    
give_item(id,"weapon_flashbang")
}
public 
antidote_explode(ent)
{
 static 
Float:originF[3]
 
pev(entpev_originoriginF)
 
 
create_blast5(originF)
 
 
//engfunc(EngFunc_EmitSound, ent, CHAN_WEAPON, grenade_infect[random_num(0, sizeof grenade_infect - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
 
 
static attacker
 attacker 
pev(entpev_owner)
 
 
g_antidote_bomb[attacker] = false
 
static victim
 victim 
= -1
 
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFRADIUS)) != 0)
 {
  if (!
is_user_alive(victim) || !g_zombie[victim] || g_nemesis[victim] || g_firstzombie[victim] ||  g_lastzombie[victim])
   continue
 
  
SendDeathMsg(attackervictim)
  
FixDeadAttrib(victim)
  
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect), 11)
  
humanme(victim0)
  
g_ammopacks[attacker] = g_ammopacks[attacker] + get_pcvar_num(cvar_ammoinfect)
  
fm_set_user_health(attackerpev(attackerpev_health)+get_pcvar_num(cvar_humanbonushp))
 
 }
 
 
engfunc(EngFunc_RemoveEntityent)
}
public 
create_blast5(const Float:originF[3])
{
 
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
 
write_byte(TE_BEAMCYLINDER// TE id
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y
 
engfunc(EngFunc_WriteCoordoriginF[2]) // z
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
 
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
 
write_short(g_exploSpr// sprite
 
write_byte(0// startframe
 
write_byte(0// framerate
 
write_byte(4// life
 
write_byte(60// width
 
write_byte(0// noise
 
write_byte(255// red
 
write_byte(128// green
 
write_byte(0// blue
 
write_byte(200// brightness
 
write_byte(0// speed
 
message_end()
 
 
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
 
write_byte(TE_BEAMCYLINDER// TE id
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y
 
engfunc(EngFunc_WriteCoordoriginF[2]) // z
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
 
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
 
write_short(g_exploSpr// sprite
 
write_byte(0// startframe
 
write_byte(0// framerate
 
write_byte(4// life
 
write_byte(60// width
 
write_byte(0// noise
 
write_byte(255// red
 
write_byte(164// green
 
write_byte(0// blue
 
write_byte(200// brightness
 
write_byte(0// speed
 
message_end()
 
 
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
 
write_byte(TE_BEAMCYLINDER// TE id
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y
 
engfunc(EngFunc_WriteCoordoriginF[2]) // z
 
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
 
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
 
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
 
write_short(g_exploSpr// sprite
 
write_byte(0// startframe
 
write_byte(0// framerate
 
write_byte(4// life
 
write_byte(60// width
 
write_byte(0// noise
 
write_byte(255// red
 
write_byte(200// green
 
write_byte(0// blue
 
write_byte(200// brightness
 
write_byte(0// speed
 
message_end()

*5
Volvemos al comienzo del plugin.
Abajo de los include agregamos esto.
PHP Code:
// antidote bomb
new g_antidote_bomb[33]
new 
cvar_humanbonushp
new const Float:RADIUS 240.0 
*6
Vamos a:
PHP Code:
public plugin_init() 
Y agregamos esto:
PHP Code:
// Antidote Bomb
register_clcmd("antidote_bomb""give_item_antidote_bomb")
cvar_humanbonushp register_cvar("zp_antidote_bomb_extra_hp","10"
*7
Luego a:
PHP Code:
public client_disconnect(id
Agregamos:
PHP Code:
// antidote bomb
g_antidote_bomb[id] = false 
*8
esta ves van a:
PHP Code:
public replace_models(id
Y en el case:
PHP Code:
case CSW_FLASHBANG// Frost grenade 
Reenplazan todo lo q este dentro por:
PHP Code:
if(g_antidote_bomb[id])
  
set_pev(idpev_viewmodel2model_grenade_infect)
 else
  
set_pev(idpev_viewmodel2model_grenade_frost
Quedaria asi:
PHP Code:
case CSW_FLASHBANG// Frost grenade
{
 if(
g_antidote_bomb[id])
  
set_pev(idpev_viewmodel2model_grenade_infect)
 else
  
set_pev(idpev_viewmodel2model_grenade_frost)

*9
Por utlimo van a:
PHP Code:
public event_round_start() 
y agregen esto:
PHP Code:
 for (new 1<= g_maxplayersi++)
 {
  if (
is_user_connected(i))
  {
   
g_antidote_bomb[i] = false
  
}
 } 
A compilar y probar!!!

pd:esto va mas dedicado a los q no le funca el plugin de la antidote bomb,como me paso ami xD

Last edited by Destro-; 08-30-2010 at 21:15.
Destro- is offline
Nameles-s
BANNED
Join Date: Aug 2010
Location: Cordoba
Old 08-30-2010 , 18:25   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#2

En donde esta el tutorial. ?
Nameles-s is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-30-2010 , 18:25   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#3

1 _ para que registras un clcmd ?
2 _
PHP Code:
new const Float:RADIUS 240.0 
=>

const Float:Radius = 240.0
__________________
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
Niiqo
Veteran Member
Join Date: Feb 2010
Location: Bs As, Argentina
Old 08-30-2010 , 18:26   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#4

piola y se le pone de model el cosito de vidrio azul del antidoto del virus T xd
Niiqo is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-30-2010 , 18:33   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#5

Quote:
Originally Posted by lucas_7_94 View Post
1 _ para que registras un clcmd ?
2 _
PHP Code:
new const Float:RADIUS 240.0 
=>

const Float:Radius = 240.0
1_ porq no se lo qeria dejar tan fasil,q porlomenos se molesten en ver el tuto de crear un extra item simple
2_yo lo estraje del antidote_bomb
Destro- is offline
KoliArce
Member
Join Date: Feb 2010
Old 08-30-2010 , 19:31   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#6

Es una forma muy ciruja y muy poco prolija de hacerlo."No es por menospreciar tu trabajo", ni nada por el estilo pero cualquiera con cabeza puede hacer un copy paste de la antidote bomb.Igual si recien empesaste esta bien, ojala q vallas mejorando.

PD: El Foro Others De AlliedModders Ya Se Esta Poniendo Pesado Y Aburrido
__________________
"Un Grande En El Recuerdo De Todos"

KoliArce is offline
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 08-30-2010 , 19:32   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#7

PHP Code:
const NADE_TYPE_INFECTION 1111
const NADE_TYPE_NAPALM 2222
const NADE_TYPE_FROST 3333
const NADE_TYPE_FLARE 4444
const NADE_TYPE_ANTIDOTEBOMB 5555 

PHP Code:
enum (+=1111) {
    
NADE_TYPE_INFECTION 1111,
    
NADE_TYPE_NAPALM,
    
NADE_TYPE_FROST,
    
NADE_TYPE_FLARE,
    
NADE_TYPE_ANTIDOTEBOMB

Aunque es igual supongo.

PHP Code:
case CSW_FLASHBANG// Frost grenade
{
 if(
g_antidote_bomb[id])
  
set_pev(idpev_viewmodel2model_grenade_infect)
 else
  
set_pev(idpev_viewmodel2model_grenade_frost)


PHP Code:
case CSW_FLASHBANG// Frost grenade
{
  
set_pev(idpev_viewmodel2g_antidote_bomb[id] ? model_grenade_infect model_grenade_frost)

__________________
Oh hell no this shit is awesome !!!

Last edited by shinoda; 08-30-2010 at 19:54.
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
Calaverazo
Senior Member
Join Date: Dec 2009
Old 08-30-2010 , 19:35   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#8

me gustaria un tuto de agregar un item extra dentro del zp
Calaverazo is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-30-2010 , 19:42   Re: [ES][TUT][zp]crear bomba de antidoto dentro del zp
#9

Le iva a poner el extra item,pero como dije no se la qeria dejar tan facil,o q porlomenos agan el extra item en un plugins exterior q es re facil
Destro- 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 13:37.


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