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

[ZP][TUT] Modo Aniquilación


  
 
 
Thread Tools Display Modes
Author Message
NicoNewells
Junior Member
Join Date: Mar 2012
Old 01-29-2013 , 22:23   [ZP][TUT] Modo Aniquilación
#1

Holas, bueno, este es mi primer "TUT" en AlliedModders, voy a dejar un tutorial de como hacer
el modo Aniquilación de Zombie Plague 4.2 pero en este tutorial es diferente a la fuente, y con los "php"

Fuente : http://forums.alliedmods.net/showthread.php?t=129337
Créditos : Script

Vamos a : // Game modes

Y Agregamos :

PHP Code:
 MODE_ANIQUILACION 
Quedaría :

PHP Code:
 MODE_NONE 0,
MODE_INFECTION,
MODE_NEMESIS,
MODE_SURVIVOR,
MODE_SWARM,
MODE_MULTI,
MODE_PLAGUE,
MODE_ANIQUILACION 
Ahora Vamos a // Game vars :

Agregamos :
PHP Code:
 new g_aniquilacionround // aniquilation round 
Quedaría :

PHP Code:
 new g_pluginenabled // ZP plugin enabled
new g_newround // new round starting
new g_endround // round ended
new g_nemround // nemesis round
new Float:g_teams_i // delay between Team Change messages
new g_survround // survivor round
new g_swarmround // swarm round
new g_plagueround // plague round
new g_aniquilacionround // aniquilation round 
Vamos a : // CVAR pointers

Agregamos al final :
PHP Code:
 ,cvar_aniquilacionratiocvar_aniquilacioncvar_aniquilacionchancecvar_aniquilacionminplayers 
Ahora vamos a : public plugin_natives() (// Round natives)

Agregamos :

PHP Code:
 register_native("zp_is_aniquilacion_round""native_is_aniquilacion_round"1
Ahora vamos a :
// CVARS - Survivor

y debajo de
PHP Code:
 cvar_survignoreammo register_cvar("zp_surv_ignore_rewards""0"
o
PHP Code:
 cvar_survweapon register_cvar("zp_surv_weapon""weapon_m249"
Agregamos :

PHP Code:
 // CVARS - Aniquilacion Mode
cvar_aniquilacion register_cvar("zp_aniquilacion_enabled""1"
cvar_aniquilacionchance register_cvar("zp_aniquilacion_chance""30")
cvar_aniquilacionminplayers register_cvar("zp_aniquilacion_min_players""0")
cvar_aniquilacionratio register_cvar("zp_aniquilacion_ratio""1.0"
Ahora vamos a : // Event Round Start

Abajo de
PHP Code:
 g_plagueround false 
agregamos
PHP Code:
 g_aniquilacionround false 
Vamos a : // zp_plague

Abajo de ese public agregamos :

PHP Code:
 public cmd_aniquilacion(idlevelcid)
{
          if (!
get_user_flags(id) && ADMIN_RCON)
          return 
PLUGIN_HANDLED

// Check for access flag
          
if (!cmd_access(idlevelcid1))
          return 
PLUGIN_HANDLED;

// Swarm mode not allowed
          
if (!allowed_swarm())
{
          
client_print(idprint_console"[ZA] %L"id"CMD_NOT")
          return 
PLUGIN_HANDLED;
}


command_aniquilacion(id)

return 
PLUGIN_HANDLED;

Ahora vamos a : // Get prevent consecutive modes setting

Debajo de :
PHP Code:
 g_plagueround false 
Agregamos :
PHP Code:
 g_aniquilacionround false 
Ahora vamos a
PHP Code:
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_MULTI) && random_num(1get_pcvar_num(cvar_multichance)) == get_pcvar_num(cvar_multi) && floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil) >= && floatround(iPlayersnum*get_pcvar_float(cvar_multiratio), floatround_ceil) < iPlayersnum && iPlayersnum >= get_pcvar_num(cvar_multiminplayers)) || mode == MODE_MULTI
y debajo de
PHP Code:
 ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_MULTI0); 
Agregamos

PHP Code:
 else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_ANIQUILACION) && random_num(1get_pcvar_num(cvar_aniquilacionchance)) == get_pcvar_num(cvar_aniquilacion) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_aniquilacionratio), floatround_ceil) >= && iPlayersnum >= get_pcvar_num(cvar_aniquilacionminplayers)) || mode == MODE_ANIQUILACION)
{
g_aniquilacionround true

server_cmd
("zp_deathmatch 2")

id fnGetRandomAlive(random_num(1iPlayersnum))
new 
name[33]
get_user_name(idname32)

set_hudmessage(25500HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
ShowSyncHudMsg(0g_MsgSync"Modo Aniquilacion!^nInfectado: %s"name)
zombieme(id001)

// Remaining players should be humans (CTs)
for (id 1id <= g_maxplayersid++)
{
// Not alive
if (!is_user_alive(id))
continue;

message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
write_short(UNIT_SECOND*100// amplitude
write_short(UNIT_SECOND*5// duration
write_short(UNIT_SECOND*120// frequency
message_end()

// First zombie/nemesis
if (g_zombie[id])
continue;

// Remove previous tasks
remove_task(id+TASK_TEAM)

// Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT// need to change team?
{
fm_set_user_team(idCS_TEAM_CT)
fm_user_team_update(id)
}
}

PlaySound(sound_plague[random_num(0sizeof sound_plague -1)]);
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_ANIQUILACION0);

Ahora vamos a
PHP Code:
 // Admin Command. zp_zombie 
y debajo de esa linea ponemos :

PHP Code:
 {
// Call Swarm Mode
console_print(id"Modo Aniquilacion")
remove_task(TASK_MAKEZOMBIE)
make_a_zombie(MODE_ANIQUILACION0)

Ahora por ultimo vamos a :
PHP Code:
 // Native: zp_is_plague_round 
Y abajo del public ponemos :

PHP Code:
 // Native: zp_is_aniquilacion_round
public native_is_aniquilacion_round()
{
return 
g_aniquilacionround;


Last edited by NicoNewells; 01-29-2013 at 23:38.
NicoNewells is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 01-29-2013 , 22:28   Re: [ES][ZP][TUT] Modo Aniquilación
#2

server_cmd("zp_deathmatch 2")

un adm lo puede cambiar y chau, busca otra manera.
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
NicoNewells
Junior Member
Join Date: Mar 2012
Old 01-29-2013 , 22:30   Re: [ES][ZP][TUT] Modo Aniquilación
#3

No creo que en un buen server los admines tengan acceso a cvars.. sería cualquier cosa.. las cvars como en este caso un zp solo tienen acceso los Staff / Dueños
NicoNewells is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 01-29-2013 , 22:45   Re: [ES][ZP][TUT] Modo Aniquilación
#4

igualmente es mejor prevenir no?
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
NicoNewells
Junior Member
Join Date: Mar 2012
Old 01-29-2013 , 22:47   Re: [ES][ZP][TUT] Modo Aniquilación
#5

Si es cierto, la cosa es como dije en otro post.. Soy nuevo mucho aún no entiendo, voy a ver la forma de como cambiarle eso y edito, saludos!
NicoNewells is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-29-2013 , 23:12   Re: [ES][ZP][TUT] Modo Aniquilación
#6

Buscá que pasa cuando zp_deathmatch está en 2, creá un bool y ponele que cuando sea verdadero pase lo mismo que cuando zp_deathmatch está en 2.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
KermesS
Senior Member
Join Date: Jan 2013
Location: Amsterdam
Old 01-29-2013 , 23:28   Re: [ES][ZP][TUT] Modo Aniquilación
#7

Pequeñisimo errorsito:

PHP Code:
ew g_aniquilacionround // aniquilation round 
KermesS is offline
NicoNewells
Junior Member
Join Date: Mar 2012
Old 01-29-2013 , 23:38   Re: [ES][ZP][TUT] Modo Aniquilación
#8

Quote:
Originally Posted by KermesS View Post
Pequeñisimo errorsito:

PHP Code:
ew g_aniquilacionround // aniquilation round 
Gracias , ya lo arreglo
NicoNewells is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 01-30-2013 , 10:44   Re: [ES][ZP][TUT] Modo Aniquilación
#9

Porque utilizas allowed_swarm ?

No puedes crear otro, allowed_aniquilacion ?

Creo que faltan más cosas...
baneado is offline
KermesS
Senior Member
Join Date: Jan 2013
Location: Amsterdam
Old 01-30-2013 , 15:54   Re: [ES][ZP][TUT] Modo Aniquilación
#10

porque utiliza de base el swarm, ya que no es necesario hacer otro nuevo y ahorrar un poco mas de memoria... creo que era algo asi, yo habia hecho un modo left 4 dead para mi zp y utilize como base el swarm, esto no me habia dado ningun problema
KermesS 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 12:00.


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