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

[ZP] Agregar Modo Armagedon.


  
 
 
Thread Tools Display Modes
Author Message
[S]ebaa.-
BANNED
Join Date: Sep 2009
Old 10-05-2009 , 10:26   [ZP] Agregar Modo Armagedon.
#1

1. Vamos a game modes.

Veremos esto :

PHP Code:
    MODE_NONE 0,
    
MODE_INFECTION,
    
MODE_NEMESIS,
    
MODE_SURVIVOR,
    
MODE_SWARM,
    
MODE_MULTI,
    
MODE_PLAGUE 
Nosotros lo dejaremos asi :

PHP Code:
    MODE_NONE 0,
    
MODE_INFECTION,
    
MODE_NEMESIS,
    
MODE_SURVIVOR,
    
MODE_SWARM,
    
MODE_MULTI,
    
MODE_PLAGUE,
    
MODE_ARMAGEDON 
Ahora vamos a

PHP Code:
if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_SURVIVOR) && random_num(1get_pcvar_num(cvar_survchance)) == get_pcvar_num(cvar_surv) && iPlayersnum >= get_pcvar_num(cvar_survminplayers)) || mode == MODE_SURVIVOR
Abajo de :
PHP Code:
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_SURVIVORforward_id); 
}

Tenemos que poner :

PHP Code:
else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_ARMAGEDON) && random_num(1get_pcvar_num(cvar_armagedonchance)) == get_pcvar_num(cvar_armagedon) && floatround((iPlayersnum-2)*get_pcvar_float(cvar_armagedonratio), floatround_ceil) >= && iPlayersnum >= get_pcvar_num(cvar_armagedonminplayers)) || mode == MODE_ARMAGEDON)
{
//Armagedon Mode
g_plagueround true
g_armagedonround 
true

// Turn someone into a Survivor
id fnGetRandomAlive(random_num(1iPlayersnum))
humanme(id1)

// Turn someone into a Nemesis (not the survivor!)
while (g_survivor[id]) id fnGetRandomAlive(random_num(1iPlayersnum));
zombieme(id010)

// iMaxZombies is rounded up, in case there aren't enough players
iMaxZombies floatround((iPlayersnum-2)*get_pcvar_float(cvar_plagueratio), floatround_ceil)
iZombies 0

// Randomly turn iMaxZombies players into zombies
while (iZombies iMaxZombies)
{
if (
id g_maxplayers)
id++
else
id 1

// Dead or already a zombie or survivor
if (!is_user_alive(id) || g_zombie[id] || g_survivor[id])
continue;

// Random chance
if (random_num(01))
{
// Turn into a nemesis
zombieme(id010)
iZombies++
}
}

// Turn the rest of players into humans
for (id 1id <= g_maxplayersid++)
{
// Only those of them who arent zombies or survivor
if (!is_user_alive(id) || g_zombie[id] || g_survivor[id])
continue

// Remove previous tasks and make them survivors
remove_task(id+TASK_TEAM)
humanme(id1)

/* Switch to CT
if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
{
fm_set_user_team(id, CS_TEAM_CT)
set_task(0.1+g_teams_i, "fm_set_user_team_msg", id+TASK_TEAM)
g_teams_i += 0.1; // increase teams task counter
}*/
}

// Play plague sound
PlaySound(sound_plague[random_num(0sizeof sound_plague -1)]);

// Show Plague HUD notice
set_hudmessage(050200, -1.00.1710.05.01.01.0, -1)
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"NOTICE_ARMAGEDON")

// Round start forward
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_ARMAGEDON0);

Ahora vamos a :

PHP Code:
// Game vars 
Abajo de
PHP Code:
new g_nemround // nemesis round 
Agregamos esto
PHP Code:
new g_armagedonround // armagedon round 
Vamos a
PHP Code:
// CVAR pointers 
Al lado de
PHP Code:
cvar_humanhp
agregamos :
PHP Code:
cvar_armagedonratiocvar_armagedoncvar_armagedonchancecvar_armagedonminplayers
Y nos quedaria asi no?

PHP Code:
cvar_humanhpcvar_armagedonratiocvar_armagedoncvar_armagedonchancecvar_armagedonminplayers
Ahora vamos a
PHP Code:
// Admin commands 
y agregamos :

PHP Code:
register_concmd("zp_armagedon""cmd_armagedon"ACCESS_FLAG" - start mode  armagedon"
Vamos aca :
PHP Code:
    // New round starting
    
g_newround true
    g_endround 
false
    g_survround 
false
    g_nemround 
false
    g_swarmround 
false
    g_plagueround 
false
    g_raptorround 
false
    g_synapsisround 
false
    g_sniperround 
false
    g_assaround 
false 
ahi agregamos :


PHP Code:
    // New round starting
    
g_newround true
    g_endround 
false
    g_survround 
false
    g_nemround 
false
    g_armagedonround 
false       <--- nustro armagedon
    g_swarmround 
false
    g_plagueround 
false
    g_raptorround 
false
    g_synapsisround 
false
    g_sniperround 
false
    g_assaround 
false 
vamos a [Admin Commands] abajo de "zp_swarm"

agregamos :

PHP Code:
// zp_armagedon
public cmd_armagedon(idlevelcid)
{
    
// Check for access flag
    
if (!cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED;
    
    
// Swarm mode not allowed
    
if (!allowed_swarm())
    {
        
client_print(idprint_console"[ZP] %L"id"CMD_NOT")
        return 
PLUGIN_HANDLED;
    }
    
    
command_armagedon(id)
    
    return 
PLUGIN_HANDLED;

ahora vamos a // Reset Player Vars

ahi agregamos
PHP Code:
g_armagedon[id] = false 
ahora // Admin Command. zp_swarm

PHP Code:
command_armagedon(id)
{
    static 
name1[32]
    
get_user_name(idname1sizeof name1 1)
    
    
// Show activity?
    
switch (get_pcvar_num(cvar_showactivity))
    {
        case 
1client_print(0print_chat"ADMIN - %L"LANG_PLAYER"CMD_ARMAGEDON")
        case 
2client_print(0print_chat"ADMIN %s - %L"name1LANG_PLAYER"CMD_ARMAGEDON")
    }
    
    
// Log to Zombie Plague log file?
    
if (get_pcvar_num(cvar_logcommands))
    {
        static 
logdata[100], authid[32], ip[16]
        
get_user_authid(idauthidsizeof authid 1)
        
get_user_ip(idipsizeof ip 11)
        
formatex(logdatasizeof logdata 1"ADMIN %s <%s><%s> - %L (Players: %d/%d)"name1authidipLANG_SERVER"CMD_ARMAGEDON"fnGetPlaying(), g_maxplayers)
        
log_to_file("zombieplague.log"logdata)
    }
    
    
// Call Swarm Mode
    
remove_task(TASK_MAKEZOMBIE)
    
make_a_zombie(MODE_ARMAGEDON0)

Vamos a // Player vars

y agregamos esto:

PHP Code:
new g_armagedon[33// is armagedon 
Despues vamos a // CVARS - Swarm Mode

y agregamos esto :

PHP Code:
    // CVARS - Armagedon Mode
    
cvar_armagedon register_cvar("zp_armagedon_enabled""1")
    
cvar_armagedonchance register_cvar("zp_armagedon_chance""30")
    
cvar_armagedonminplayers register_cvar("zp_armagedon_min_players""0"
Probablemente ahi nos tire warnign o algo asi xD asi que :

Vamos a


PHP Code:
public plugin_natives() 
y agregamos
PHP Code:
register_native("zp_get_user_armagedon""native_get_user_armagedon"1
Luego a // Round natives

y agregamos :
PHP Code:
register_native("zp_is_armagedon_round""native_is_armagedon_round"1
Vamos a
PHP Code:
// Native: zp_get_user_survivor 
y agregamos

PHP Code:
// Native: zp_get_user_armagedon
public native_get_user_armagedon(id)
{
    return 
g_armagedon[id];

Por ultimo :

PHP Code:
// Native: zp_is_armagedon_round
public native_is_armagedon_round()
{
    return 
g_armagedonround;

Fin del tuto

Last edited by [S]ebaa.-; 10-05-2009 at 11:09.
[S]ebaa.- is offline
DaRkBiOhAzArD
Senior Member
Join Date: May 2009
Location: Tijuana, Mexico
Old 10-05-2009 , 12:27   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#2

buen tuto pero no lo voe a hacer porque ya lo tengo en mi ZP ademas
me ganaste al poner el tuto armagedon

;)

__________________
DaRkBiOhAzArD is offline
Send a message via MSN to DaRkBiOhAzArD Send a message via Skype™ to DaRkBiOhAzArD
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 10-05-2009 , 16:45   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#3

Me da la impresión de que apenas sabes lo que posteaste. ¿Tan difícil es hacer un switch y hacer nemesis a los T y survivor a los CT? :/
__________________
"There is no knowledge, that is not power"
fezh is offline
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 10-05-2009 , 17:03   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#4

esta bien el tuto, si no ven ningun error lo hago y veo haber que onda


EDIT:

fijate al final te falto donde hiba el ultimo code

hice el tuto 0 errores me salio, asique bien
ahora me tiran 2 warnings de loose identation y aunque le pase el auto indeting no se quieren ir jaja
PHP Code:
// Turn someone into a Nemesis (not the survivor!)
  
while (g_survivor[id]) id fnGetRandomAlive(random_num(1iPlayersnum));
   
zombieme(id010)
 
  
// iMaxZombies is rounded up, in case there aren't enough players
  
iMaxZombies floatround((iPlayersnum-2)*get_pcvar_float(cvar_plagueratio), floatround_ceil)
  
iZombies 

en

PHP Code:
zombieme(id010
y

PHP Code:
iMaxZombies floatround((iPlayersnum-2)*get_pcvar_float(cvar_plagueratio), floatround_ceil


Otra consulta porque siempre cuando paso el auto identing del pawn studio de va borrando la ultima letra del

#endif

que esta al final :S
siempre la tengo que estar completando, me embola

Last edited by TucanN#; 10-05-2009 at 17:30.
TucanN# is offline
Send a message via MSN to TucanN#
Kiske
Veteran Member
Join Date: May 2009
Old 10-05-2009 , 17:21   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#5

Quote:
Originally Posted by fezh View Post
Me da la impresión de que apenas sabes lo que posteaste. ¿Tan difícil es hacer un switch y hacer nemesis a los T y survivor a los CT? :/
Yo lo hize asi, pero tambien le hize una CHANCE.
Xq si no siempre le toca Survivor a los CTs.

Entonces hize un "Random_Num" entre 1 y 2.
Si toca 1.
Los CTs son Survivors y los TTs son Nemesis.
Si toca 2.
Los TTs son Survivors y los CTs son Nemesis.

Es para que la gente no crea que cuando sea CT, va a ser Survivor.
__________________

Kiske is offline
Send a message via Skype™ to Kiske
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 10-05-2009 , 17:34   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#6

cuando inicio el mod se me re traba el cs u.u

PD: ya saque los loose identation


ahora probe con el server y se me palma la pc se muere jaja

Last edited by TucanN#; 10-05-2009 at 17:44.
TucanN# is offline
Send a message via MSN to TucanN#
Troyano
Senior Member
Join Date: Aug 2009
Old 10-05-2009 , 18:20   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#7

Quote:
Originally Posted by TucanN# View Post
cuando inicio el mod se me re traba el cs u.u

PD: ya saque los loose identation


ahora probe con el server y se me palma la pc se muere jaja
Seguramente es porque inicias el modo con 1 solo player
__________________
MSN:
[email protected]
[IMG]http://img27.**************/img27/9373/randomviolence.gif[/IMG]
Troyano is offline
Send a message via MSN to Troyano
ELRAYO
BANNED
Join Date: Sep 2009
Old 10-05-2009 , 18:49   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#8

bueno muy bueno tus post bien explicado hasta lo entendi copilo dio el amxx pero los datos del copiled dan 2 warnings observa

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

Warning: Loose indentation on line 1472
Warning: Loose indentation on line 1477
Header size:           6192 bytes
Code size:           227372 bytes
Data size:           140476 bytes
Stack/heap size:      16384 bytes; max. usage is unknown, due to recursion
Total requirements:  390424 bytes

2 Warnings.
Done.
si saven por que es problema post por favor la solucion como se arregla pro favor expliquenme
ELRAYO is offline
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 10-05-2009 , 18:58   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#9

si inicio el modo con una sola persona :s

ahora pruebo gracias troyano!


RAYO

ese error nos pasa a todos fijate en donde te tira el error hacelo mas atras juntalo con el que esta arriba:

PHP Code:
 
// Turn someone into a Nemesis (not the survivor!)
while (g_survivor[id]) id fnGetRandomAlive(random_num(1iPlayersnum));
zombieme(id010
TucanN# is offline
Send a message via MSN to TucanN#
ELRAYO
BANNED
Join Date: Sep 2009
Old 10-05-2009 , 19:00   Re: [ES][TUTO][ZP] Agregar Modo Armagedon.
#10

pero diganme como hago que el modo aparesca en el menu por que no me aparece tucan como hiciste por que a ti te aparecieron los mismos errores y si te sirvio
ELRAYO 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 11:08.


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