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

[ZP] Tutorial para agregar un modo!


  
 
 
Thread Tools Display Modes
Author Message
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 09-13-2009 , 02:02   [ZP] Tutorial para agregar un modo!
#1

Como crear un mod [ZP] By Raddish v1.1

Primero agarramos un ZP Virgen

zp_plugin_42.zip (285.0 KB, 244 views) ( VIRGEN )

osea, virgen es que nunca lo tocaron, un ejemplo ideal seria Pw.- (Alexis) o Fraancooo, los 2 son virgen. bueno comensemos,

Primero, enseñare a hacer el modo wesker, que me ayudo a hacerlo FranckitowOw, El lo hiso en mi pc por teamviewer y yo con lo que me acuerdo hago el tutorial, ya hice varios modos. y ninguno con errores hasta ahora :E

1.vamos a
PHP Code:
// Player Models (randomly chosen if more than one) 
y abajo de
PHP Code:
new const model_admin_zombie[][] = { "zombie_source" // Admin (zombie) 
ponemos
PHP Code:
new const model_wesker[][] = { "leet" // wesker 
quedaria

PHP Code:
new const model_admin_zombie[][] = { "zombie_source" // Admin (zombie)
new const model_wesker[][] = { "leet" // wesker 
2.Ahora vamos a
PHP Code:
// Sounds (randomly chosen if more than one) 
y abajo de
PHP Code:
new const sound_swarm[][] = { "ambience/the_horror2.wav" 
ponemos
PHP Code:
new const sound_wesker[][] = { "zombie_plague/survivor1.wav" 
Querdaria
PHP Code:
new const sound_swarm[][] = { "ambience/the_horror2.wav" }
new const 
sound_wesker[][] = { "zombie_plague/survivor1.wav" 
3. Ahora vamos a
PHP Code:
// Dynamic Stuff Limiters (increase if needed) 
abajo de
PHP Code:
const MAX_MODELS_ADM_ZOMBIE 10 
ponemos
PHP Code:
const MAX_MODELS_WESKER 
quedaria
PHP Code:
const MAX_MODELS_ADM_ZOMBIE 10
const MAX_MODELS_WESKER 
4. Ahora vamos a
PHP Code:
// Game modes 
Donde dice
PHP Code:
MODE_PLAGUE 
Le agregamos una coma quedaria asi
PHP Code:
MODE_PLAGUE
ahora, abajo de el ponemos
PHP Code:
MODE_WESKER 
Quedaria
PHP Code:
    MODE_PLAGUE,
    
MODE_WESKER 
5.Ahora buscamos
PHP Code:
// Player vars 
y abajo de
PHP Code:
new g_survivor[33// is survivor 
ponemos
PHP Code:
new g_wesker[33// is wesker 
Quedaria
PHP Code:
new g_survivor[33// is surivor
new g_wesker[33// is wesker 
6.Ahora vamos a
PHP Code:
// Game vars 
buscamos
PHP Code:
new g_survround // survivor round 
y abajo de el ponemos
PHP Code:
new g_weskerround // wesker round 
quedaria
PHP Code:
new g_survround // survivor round
new g_weskerround // wesker round 
7.Ahora vamos a
PHP Code:
// Precached model indexes 
Buscamos
PHP Code:
new g_modelindex_survivor[MAX_MODELS_SURVIVOR
y abajo de el ponemos
PHP Code:
new g_modelindex_wesker[MAX_MODELS_WESKER
Quedaria
PHP Code:
new g_modelindex_survivor[MAX_MODELS_SURVIVOR]
new 
g_modelindex_wesker[MAX_MODELS_WESKER
8.Ahora vamos a
PHP Code:
// CVAR pointers 
Ojo, esto es lo mas complicado siempre puede tirar uno que otro error aca.
vamos a la ultima parte de las cvars
PHP Code:
cvar_nvgcolor[3], cvar_nemnvgcolor[3], cvar_humnvgcolor[3], cvar_flashcolor[3
Vallan ala primera cvar de esa linea
PHP Code:
cvar_nvgcolor 
y borren asta que quede en la linea de arriba asi.
PHP Code:
cvar_hudiconscvar_flashshowallcvar_nvgcolor[3], cvar_nemnvgcolor[3], cvar_humnvgcolor[3], cvar_flashcolor[3
Y le agregamos una coma al final y abrimos una linea para abajo y ponemos
PHP Code:
cvar_weskercvar_weskerchancecvar_weskerminplayerscvar_weskergravitycvar_weskerhpcvar_weskerspd 
Les quedaria
PHP Code:
cvar_hudiconscvar_flashshowallcvar_nvgcolor[3], cvar_nemnvgcolor[3], cvar_humnvgcolor[3], cvar_flashcolor[3],
cvar_weskercvar_weskerchancecvar_weskerminplayerscvar_weskergravitycvar_weskerhpcvar_weskerspd 
9 Parte 1/2.Vamos a
PHP Code:
// Player specific natives 
y abajo de
PHP Code:
    register_native("zp_get_user_survivor""native_get_user_survivor"1
ponemos
PHP Code:
    register_native("zp_get_user_wesker""native_get_user_wesker"1
Quedaria
PHP Code:
    register_native("zp_get_user_survivor""native_get_user_survivor"1)
    
register_native("zp_get_user_wesker""native_get_user_wesker"1
9 Parte 2/2. Buscamos mas abajo
PHP Code:
// Round natives 
y abajo de
PHP Code:
    register_native("zp_is_survivor_round""native_is_survivor_round"1
ponemos
PHP Code:
    register_native("zp_is_wesker_round""native_is_wesker_round"1
Quedaria
PHP Code:
    register_native("zp_is_survivor_round""native_is_survivor_round"1)
    
register_native("zp_is_wesker_round""native_is_wesker_round"1
10.Ahora vamos a
PHP Code:
// Custom player models 
abajo de
PHP Code:
    for (0sizeof model_survivori++)
    {
        
formatex(playermodelsizeof playermodel 1"models/player/%s/%s.mdl"model_survivor[i], model_survivor[i])
        
g_modelindex_survivor[i] = engfunc(EngFunc_PrecacheModelplayermodel)
    } 
Ponemos
PHP Code:
    for (0sizeof model_weskeri++)
    {
        
formatex(playermodelsizeof playermodel 1"models/player/%s/%s.mdl"model_wesker[i], model_wesker[i])
        
g_modelindex_wesker[i] = engfunc(EngFunc_PrecacheModelplayermodel)
    } 
Quedaria
PHP Code:
    for (0sizeof model_survivori++)
    {
        
formatex(playermodelsizeof playermodel 1"models/player/%s/%s.mdl"model_survivor[i], model_survivor[i])
        
g_modelindex_survivor[i] = engfunc(EngFunc_PrecacheModelplayermodel)
    }
    for (
0sizeof model_weskeri++)
    {
        
formatex(playermodelsizeof playermodel 1"models/player/%s/%s.mdl"model_wesker[i], model_wesker[i])
        
g_modelindex_wesker[i] = engfunc(EngFunc_PrecacheModelplayermodel)
    } 
11.Ahora vamos a
PHP Code:
// Custom sounds 
Abajo de
PHP Code:
    for (0sizeof sound_multii++)
        
engfunc(EngFunc_PrecacheSoundsound_multi[i]) 
Ponemos
PHP Code:
    for (0sizeof sound_weskeri++)
        
engfunc(EngFunc_PrecacheSoundsound_wesker[i]) 
Quedaria
PHP Code:
    for (0sizeof sound_multii++)
        
engfunc(EngFunc_PrecacheSoundsound_multi[i])
    for (
0sizeof sound_weskeri++)
        
engfunc(EngFunc_PrecacheSoundsound_wesker[i]) 
12. Ahora vamos a
PHP Code:
// Admin commands 
abajo de
PHP Code:
     register_concmd("zp_survivor""cmd_survivor"ACCESS_FLAG"<target> - Turn someone into a Survivor"
ponemos
PHP Code:
    register_concmd("zp_wesker""cmd_wesker"ACCESS_FLAG"<target> - Turn someone into a Wesker"
13. ahora vamos a
PHP Code:
    // CVARS - Survivor 
Y abajo de
PHP Code:
    // CVARS - Survivor
    
cvar_surv register_cvar("zp_surv_enabled""1")
    
cvar_survchance register_cvar("zp_surv_chance""20")
    
cvar_survminplayers register_cvar("zp_surv_min_players""0")
    
cvar_survhp register_cvar("zp_surv_health""0")
    
cvar_survbasehp register_cvar("zp_surv_base_health""0")
    
cvar_survspd register_cvar("zp_surv_speed""230")
    
cvar_survgravity register_cvar("zp_surv_gravity""1.25")
    
cvar_survglow register_cvar("zp_surv_glow""1")
    
cvar_survaura register_cvar("zp_surv_aura""1")
    
cvar_survpainfree register_cvar("zp_surv_painfree""1")
    
cvar_survignorefrags register_cvar("zp_surv_ignore_frags""1")
    
cvar_survignoreammo register_cvar("zp_surv_ignore_rewards""1")
    
cvar_survweapon register_cvar("zp_surv_weapon""weapon_m249"
Ponemos
PHP Code:
    // CVARS - Wesker
        
cvar_wesker register_cvar("zp_wesker_enabled""1")
        
cvar_weskerchance register_cvar("zp_wesker_chance""20")
        
cvar_weskerminplayers register_cvar("zp_wesker_min_players""0")
        
cvar_weskerhp register_cvar("zp_wesker_health""5000")
        
cvar_weskerspd register_cvar("zp_wesker_speed""300")
        
cvar_weskergravity register_cvar("zp_wesker_gravity""0.50"
Quedaria
PHP Code:
    // CVARS - Survivor
    
cvar_surv register_cvar("zp_surv_enabled""1")
    
cvar_survchance register_cvar("zp_surv_chance""20")
    
cvar_survminplayers register_cvar("zp_surv_min_players""0")
    
cvar_survhp register_cvar("zp_surv_health""0")
    
cvar_survbasehp register_cvar("zp_surv_base_health""0")
    
cvar_survspd register_cvar("zp_surv_speed""230")
    
cvar_survgravity register_cvar("zp_surv_gravity""1.25")
    
cvar_survglow register_cvar("zp_surv_glow""1")
    
cvar_survaura register_cvar("zp_surv_aura""1")
    
cvar_survpainfree register_cvar("zp_surv_painfree""1")
    
cvar_survignorefrags register_cvar("zp_surv_ignore_frags""1")
    
cvar_survignoreammo register_cvar("zp_surv_ignore_rewards""1")
    
cvar_survweapon register_cvar("zp_surv_weapon""weapon_m249")

    
// CVARS - Wesker
        
cvar_wesker register_cvar("zp_wesker_enabled""1")
        
cvar_weskerchance register_cvar("zp_wesker_chance""20")
        
cvar_weskerminplayers register_cvar("zp_wesker_min_players""0")
        
cvar_weskerhp register_cvar("zp_wesker_health""5000")
        
cvar_weskerspd register_cvar("zp_wesker_speed""300")
        
cvar_weskergravity register_cvar("zp_wesker_gravity""0.50"
14.Ahora vamos a
PHP Code:
// New round starting 
y abajo de
PHP Code:
    g_survround false 
ponemos
PHP Code:
    g_weskerround false 
quedaria
PHP Code:
    g_survround false
    g_weskerround 
false 
15.Vamos a
PHP Code:
    // Set Player MaxSpeed 
Y remplazamos todo lo de ahi abajo hasta
PHP Code:
    // Should Leap? 
Quedaria
PHP Code:
    // Set Player MaxSpeed
    
if (g_frozen[id])
    {
        
set_pev(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
        
set_pev(idpev_maxspeed1.0// prevent from moving
    
}
    else if (!
g_freezetime)
    {
        if (
g_zombie[id])
        {
            if (
g_nemesis[id])
                
set_pev(idpev_maxspeedget_pcvar_float(cvar_nemspd))
            else
                
set_pev(idpev_maxspeedfloat(g_zclass_spd[g_zombieclass[id]]))
        }
        else
        {
            if (
g_wesker[id])
                
set_pev(idpev_maxspeedget_pcvar_float(cvar_weskerspd))
            else if (
g_survivor[id])
                
set_pev(idpev_maxspeedget_pcvar_float(cvar_survspd))
            else
                
set_pev(idpev_maxspeedget_pcvar_float(cvar_humanspd))
        }
    }
    
    
// Should Leap? 
16.Ya estamos por terminar, Vamos ahora a
PHP Code:
// zp_survivor [target] 
y abajo de
PHP Code:
// zp_survivor [target]
public cmd_survivor(idlevelcid)
{
    
// Check for access flag
    
if (!cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    
// Retrieve arguments
    
static arg[32], player
    read_argv
(1argsizeof arg 1)
    
player cmd_target(idargCMDTARGET_ONLY_ALIVE CMDTARGET_ALLOW_SELF)
    
    
// Invalid target
    
if (!player) return PLUGIN_HANDLED;
    
    
// Target not allowed to be survivor
    
if (!allowed_survivor(player))
    {
        
client_print(idprint_console"[ZP] %L"id"CMD_NOT")
        return 
PLUGIN_HANDLED;
    }
    
    
command_survivor(idplayer)
    
    return 
PLUGIN_HANDLED;

Ponemos
PHP Code:
// zp_wesker [target]
public cmd_wesker(idlevelcid)
{
    
// Check for access flag
    
if (!cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    
// Retrieve arguments
    
static arg[32], player
    read_argv
(1argsizeof arg 1)
    
player cmd_target(idargCMDTARGET_ONLY_ALIVE CMDTARGET_ALLOW_SELF)
    
    
// Invalid target
    
if (!player) return PLUGIN_HANDLED;
    
    
// Target not allowed to be survivor
    
if (!allowed_wesker(player))
    {
        
client_print(idprint_console"[ZP] %L"id"CMD_NOT")
        return 
PLUGIN_HANDLED;
    }
    
    
command_wesker(idplayer)
    
    return 
PLUGIN_HANDLED;

Quedaria
PHP Code:
// zp_survivor [target]
public cmd_survivor(idlevelcid)
{
    
// Check for access flag
    
if (!cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    
// Retrieve arguments
    
static arg[32], player
    read_argv
(1argsizeof arg 1)
    
player cmd_target(idargCMDTARGET_ONLY_ALIVE CMDTARGET_ALLOW_SELF)
    
    
// Invalid target
    
if (!player) return PLUGIN_HANDLED;
    
    
// Target not allowed to be survivor
    
if (!allowed_survivor(player))
    {
        
client_print(idprint_console"[ZP] %L"id"CMD_NOT")
        return 
PLUGIN_HANDLED;
    }
    
    
command_survivor(idplayer)
    
    return 
PLUGIN_HANDLED;
}

// zp_wesker [target]
public cmd_wesker(idlevelcid)
{
    
// Check for access flag
    
if (!cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    
// Retrieve arguments
    
static arg[32], player
    read_argv
(1argsizeof arg 1)
    
player cmd_target(idargCMDTARGET_ONLY_ALIVE CMDTARGET_ALLOW_SELF)
    
    
// Invalid target
    
if (!player) return PLUGIN_HANDLED;
    
    
// Target not allowed to be survivor
    
if (!allowed_wesker(player))
    {
        
client_print(idprint_console"[ZP] %L"id"CMD_NOT")
        return 
PLUGIN_HANDLED;
    }
    
    
command_wesker(idplayer)
    
    return 
PLUGIN_HANDLED;

17.Vamos a
PHP Code:
// Round starting 
Y abajo de
PHP Code:
    g_nemround false 
Ponemos
PHP Code:
    g_weskerround false 
quedaria
PHP Code:
    g_nemround false
    g_weskerround 
false 
18. Ahora vamos a
PHP Code:
        // Round start forward 
Y abajo de
PHP Code:
        // Round start forward
        
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_SURVIVORforward_id);
    } 
Ponemos
PHP Code:
    else if ((mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_WESKER) && random_num(1get_pcvar_num(cvar_weskerchance)) == get_pcvar_num(cvar_wesker) && iPlayersnum >= get_pcvar_num(cvar_weskerminplayers)) || mode == MODE_WESKER)
    {
        
// wesker Mode
        
g_survround false
        g_weskerround 
true
        g_lastmode 
MODE_WESKER
    
        
// Choose player randomly?
        
id fnGetRandomAlive(random_num(1iPlayersnum))        
    
        
// Remember id for calling our forward later
        
forward_id id
    
        g_survivor
[id] = false
        g_wesker
[id] = true
        humanme
(id1)
    
        
fm_strip_user_weapons(id)
        
fm_give_item(id"weapon_knife")
        
fm_give_item(id"weapon_deagle")
        
        
fm_set_rendering(idkRenderFxGlowShell2522023kRenderNormal8)
        
        static 
weskerhealth
        weskerhealth 
get_pcvar_num(cvar_weskerhp)
        
fm_set_user_health(idweskerhealth)
    
        
set_pev(idpev_gravityget_pcvar_float(cvar_weskergravity))
    
        
// Turn the rest of players into a zombie
        
for (id 1id <= g_maxplayersid++)
        {
            
// Not alive
            
if (!is_user_alive(id))
                continue;
        
            
// Survivor or already a zombie
            
if (g_survivor[id] || g_zombie[id])
                continue;
        
            
// Turn into a zombie
            
zombieme(id001)
        }
    
        
// Play swarm sound
        
PlaySound(sound_wesker[random_num(0sizeof sound_wesker -1)]);
        
// Get player's name
        
get_user_name(forward_idnamesizeof name 1)
    
        
// Show wesker HUD notice
        
set_hudmessage(18513515HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"NOTICE_WESKER"name)
    
        
// Round start forward
        
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_WESKERforward_id);    
    } 
Quedaria
PHP Code:
        // Round start forward
        
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_SURVIVORforward_id);
    }
    else if ((
mode == MODE_NONE && (!preventconsecutive || g_lastmode != MODE_WESKER) && random_num(1get_pcvar_num(cvar_weskerchance)) == get_pcvar_num(cvar_wesker) && iPlayersnum >= get_pcvar_num(cvar_weskerminplayers)) || mode == MODE_WESKER)
    {
        
// wesker Mode
        
g_survround false
        g_weskerround 
true
        g_lastmode 
MODE_WESKER
    
        
// Choose player randomly?
        
id fnGetRandomAlive(random_num(1iPlayersnum))        
    
        
// Remember id for calling our forward later
        
forward_id id
    
        g_survivor
[id] = false
        g_wesker
[id] = true
        humanme
(id1)
    
        
fm_strip_user_weapons(id)
        
fm_give_item(id"weapon_knife")
        
fm_give_item(id"weapon_deagle")
        
        
fm_set_rendering(idkRenderFxGlowShell2522023kRenderNormal8)
        
        static 
weskerhealth
        weskerhealth 
get_pcvar_num(cvar_weskerhp)
        
fm_set_user_health(idweskerhealth)
    
        
set_pev(idpev_gravityget_pcvar_float(cvar_weskergravity))
    
        
// Turn the rest of players into a zombie
        
for (id 1id <= g_maxplayersid++)
        {
            
// Not alive
            
if (!is_user_alive(id))
                continue;
        
            
// Survivor or already a zombie
            
if (g_survivor[id] || g_zombie[id])
                continue;
        
            
// Turn into a zombie
            
zombieme(id001)
        }
    
        
// Play swarm sound
        
PlaySound(sound_wesker[random_num(0sizeof sound_wesker -1)]);
        
// Get player's name
        
get_user_name(forward_idnamesizeof name 1)
    
        
// Show wesker HUD notice
        
set_hudmessage(18513515HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"NOTICE_WESKER"name)
    
        
// Round start forward
        
ExecuteForward(g_fwRoundStartg_fwDummyResultMODE_WESKERforward_id);    
    } 
19. Falta poquitoo!!!!, Ahora vamos a
PHP Code:
// Reset Player Vars 
abajo de
PHP Code:
    g_survivor[id] = false 
ponemos
PHP Code:
    g_wesker[id] = false 
Quedaria
PHP Code:
    g_survivor[id] = false
    g_wesker
[id] = false 
20. Ahora vamos a
PHP Code:
    // Format the classname 
y remplazamos todo hasta
PHP Code:
     // Spectating someone else? 
por
PHP Code:
    // Format the classname
    
static class[32], redgreenblue
    
    
if (g_zombie[id]) // zombies
    
{
        
red 200
        green 
250
        blue 
0
        
        
if (g_nemesis[id])
            
formatex(class, sizeof class - 1"%L"ID_SHOWHUD,"CLASS_NEMESIS")
        else
            
copy(class, sizeof class - 1g_zclass_name[g_zombieclass[id]])
    }
    else 
// humans
    
{
        
red 0
        green 
0
        blue 
255
        
        
if (g_wesker[id])
            
formatex(class, sizeof class - 1"%L"ID_SHOWHUD,"CLASS_WESKER")
        else if (
g_survivor[id])
            
formatex(class, sizeof class - 1"%L"ID_SHOWHUD,"CLASS_SURVIVOR")
        else
            
formatex(class, sizeof class - 1"%L"ID_SHOWHUD,"CLASS_HUMAN")
    }
    
    
// Spectating someone else? 
21.Dos cosas mas y terminamos ;), Ahora vamos a
PHP Code:
// Checks if a player is allowed to be survivor 
y abajo de
PHP Code:
// Checks if a player is allowed to be survivor
allowed_survivor(id)
{
    if (
g_endround || !g_newround || !is_user_alive(id) || !get_pcvar_num(cvar_surv) || task_exists(TASK_WELCOMEMSG) || fnGetAlive() < get_pcvar_num(cvar_survminplayers))
        return 
false;
    
    return 
true;

ponemos
PHP Code:
// Checks if a player is allowed to be wesker
allowed_wesker(id)
{
    if (
g_endround || !g_newround || !is_user_alive(id) || !get_pcvar_num(cvar_wesker) || task_exists(TASK_WELCOMEMSG) || fnGetAlive() < get_pcvar_num(cvar_weskerminplayers))
        return 
false;
    
    return 
true;

Quedaria
PHP Code:
// Checks if a player is allowed to be survivor
allowed_survivor(id)
{
    if (
g_endround || !g_newround || !is_user_alive(id) || !get_pcvar_num(cvar_surv) || task_exists(TASK_WELCOMEMSG) || fnGetAlive() < get_pcvar_num(cvar_survminplayers))
        return 
false;
    
    return 
true;
}

// Checks if a player is allowed to be wesker
allowed_wesker(id)
{
    if (
g_endround || !g_newround || !is_user_alive(id) || !get_pcvar_num(cvar_wesker) || task_exists(TASK_WELCOMEMSG) || fnGetAlive() < get_pcvar_num(cvar_weskerminplayers))
        return 
false;
    
    return 
true;

22.Ahora vamos a
PHP Code:
// Admin Command. zp_survivor 
y abajo de
PHP Code:
// Admin Command. zp_survivor
command_survivor(idplayer)
{
    static 
name1[32], name2[32]
    
get_user_name(idname1sizeof name1 1)
    
get_user_name(playername2sizeof name2 1)
    
    
// Show activity?
    
switch (get_pcvar_num(cvar_showactivity))
    {
        case 
1client_print(0print_chat"ADMIN - %s %L"name2LANG_PLAYER"CMD_SURVIVAL")
        case 
2client_print(0print_chat"ADMIN %s - %s %L"name1name2LANG_PLAYER"CMD_SURVIVAL")
    }
    
     
// 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> - %s %L (Players: %d/%d)"name1authidipname2LANG_SERVER,"CMD_SURVIVAL"fnGetPlaying(), g_maxplayers)
        
log_to_file("zombieplague.log"logdata)
    }
    
    
// Turn into a Survivor
    
remove_task(TASK_MAKEZOMBIE)
    
make_a_zombie(MODE_SURVIVORplayer)

ponemos
PHP Code:
// Admin Command. zp_wesker
command_wesker(idplayer)
{
    static 
name1[32], name2[32]
    
get_user_name(idname1sizeof name1 1)
    
get_user_name(playername2sizeof name2 1)
    
    
// Show activity?
    
switch (get_pcvar_num(cvar_showactivity))
    {
        case 
1client_print(0print_chat"ADMIN - %s %L"name2LANG_PLAYER"CMD_WESKER")
        case 
2client_print(0print_chat"ADMIN %s - %s %L"name1name2LANG_PLAYER"CMD_WESKER")
    }
    
     
// 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> - %s %L (Players: %d/%d)"name1authidipname2LANG_SERVER,"CMD_WESKER"fnGetPlaying(), g_maxplayers)
        
log_to_file("zombieplague.log"logdata)
    }
    
    
// Turn into a Survivor
    
remove_task(TASK_MAKEZOMBIE)
    
make_a_zombie(MODE_WESKERplayer)

Quedaria
PHP Code:
// Admin Command. zp_survivor
command_survivor(idplayer)
{
    static 
name1[32], name2[32]
    
get_user_name(idname1sizeof name1 1)
    
get_user_name(playername2sizeof name2 1)
    
    
// Show activity?
    
switch (get_pcvar_num(cvar_showactivity))
    {
        case 
1client_print(0print_chat"ADMIN - %s %L"name2LANG_PLAYER"CMD_SURVIVAL")
        case 
2client_print(0print_chat"ADMIN %s - %s %L"name1name2LANG_PLAYER"CMD_SURVIVAL")
    }
    
     
// 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> - %s %L (Players: %d/%d)"name1authidipname2LANG_SERVER,"CMD_SURVIVAL"fnGetPlaying(), g_maxplayers)
        
log_to_file("zombieplague.log"logdata)
    }
    
    
// Turn into a Survivor
    
remove_task(TASK_MAKEZOMBIE)
    
make_a_zombie(MODE_SURVIVORplayer)
}

// Admin Command. zp_wesker
command_wesker(idplayer)
{
    static 
name1[32], name2[32]
    
get_user_name(idname1sizeof name1 1)
    
get_user_name(playername2sizeof name2 1)
    
    
// Show activity?
    
switch (get_pcvar_num(cvar_showactivity))
    {
        case 
1client_print(0print_chat"ADMIN - %s %L"name2LANG_PLAYER"CMD_WESKER")
        case 
2client_print(0print_chat"ADMIN %s - %s %L"name1name2LANG_PLAYER"CMD_WESKER")
    }
    
     
// 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> - %s %L (Players: %d/%d)"name1authidipname2LANG_SERVER,"CMD_WESKER"fnGetPlaying(), g_maxplayers)
        
log_to_file("zombieplague.log"logdata)
    }
    
    
// Turn into a Survivor
    
remove_task(TASK_MAKEZOMBIE)
    
make_a_zombie(MODE_WESKERplayer)

23. Ante ultima cosa vamos a
PHP Code:
// Native: zp_get_user_survivor 
Y abajo de
PHP Code:
// Native: zp_get_user_survivor
public native_get_user_survivor(id)
{
    return 
g_survivor[id];

Ponemos
PHP Code:
// Native: zp_get_user_wesker
public native_get_user_wesker(id)
{
    return 
g_wesker[id];

Quedaria
PHP Code:
// Native: zp_get_user_survivor
public native_get_user_survivor(id)
{
    return 
g_survivor[id];
}

// Native: zp_get_user_wesker
public native_get_user_wesker(id)
{
    return 
g_wesker[id];

24. ULTIMA Vamos a
PHP Code:
// Native: zp_is_survivor_round 
y abajo de
PHP Code:
// Native: zp_is_survivor_round
public native_is_survivor_round()
{
    return 
g_survround;

ponemos
PHP Code:
// Native: zp_is_wesker_round
public native_is_wesker_round()
{
    return 
g_weskerround;

Quedaria
PHP Code:
// Native: zp_is_survivor_round
public native_is_survivor_round()
{
    return 
g_survround;
}

// Native: zp_is_wesker_round
public native_is_wesker_round()
{
    return 
g_weskerround;

Fin, Tenemos nuestro MODO!! ;D
Si no pudieron o tienen algun error, aca se los dejo echo.
Attached Files
File Type: sma Get Plugin or Get Source (zpconmodwesker.sma - 2399 views - 254.1 KB)

Last edited by Raddish; 10-13-2009 at 14:11.
Raddish is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 09-13-2009 , 02:03   Re: [ES][ZP] Tutorial para agregar modos!
#2

Bueno hago doble post, me re esmere loco pense q no iba a entrar xD,
Saludos es como hacer un mod para zp en 24 Partes.

Last edited by Raddish; 10-04-2009 at 18:22.
Raddish is offline
Kiske
Veteran Member
Join Date: May 2009
Old 09-13-2009 , 02:39   Re: [ES][ZP] Tutorial para agregar un modo!
#3

Registras el MODEL y todo, pero nunca lo usas :S
O sea, nunca le seteas el Model.
__________________

Kiske is offline
Send a message via Skype™ to Kiske
Fraancooo-.
BANNED
Join Date: Aug 2009
Location: CLICK HERE
Old 09-13-2009 , 08:35   Re: [ES][ZP] Tutorial para agregar un modo!
#4

Quote:
Originally Posted by Raddish View Post
un ejemplo ideal seria Pw.- (Alexis) o Fraancooo, los 2 son virgen.
Te zarpaste flogger feo :E
PD: Esta muy bueno el tuto
Fraancooo-. is offline
Send a message via MSN to Fraancooo-.
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 09-13-2009 , 08:46   Re: [ES][ZP] Tutorial para agregar un modo!
#5

Se nota que te esforzaste
3 urras para Raddish!

PD: 1 hora despues... cri cri cri XD
__________________
alan_el_more is offline
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 09-13-2009 , 09:34   Re: [ES][ZP] Tutorial para agregar un modo!
#6

bien capo
TucanN# is offline
Send a message via MSN to TucanN#
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 09-13-2009 , 10:10   Re: [ES][ZP] Tutorial para agregar un modo!
#7

Buen tutorial.
Segui Asi.
__________________
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
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 09-13-2009 , 10:56   Re: [ES][ZP] Tutorial para agregar un modo!
#8

Quote:
Pw.- (Alexis) o Fraancooo, los 2 son virgen


jjajajaajjjjajaajajaajjaa
TucanN# is offline
Send a message via MSN to TucanN#
Old 09-13-2009, 12:59
VenganZa
This message has been deleted by VenganZa. Reason: Ya paso [Como 2 meses ]
Old 09-13-2009, 13:05
Asd'
This message has been deleted by Asd'.
Old 09-13-2009, 13:27
VenganZa
This message has been deleted by VenganZa. Reason: Ya paso [Como 2 meses ]
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 09-13-2009 , 13:42   Re: [ES][ZP] Tutorial para agregar un modo!
#9

Quote:
Originally Posted by VenganZa View Post
Pero se puede hacer con el 4.2?.

Y con ese zp que posteo cree el modo terminator que es parecido
pero noce porque siempre me salen 26 errores despues de que creo algo!
y no me sale ningun error con el modo terminator pero por esos 26 errores que no tienen que ver con el modo no lo puedo compilar siempre me salen estos errores:

//// zombie_plague40.sma
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(631) : error 017: undefined symbol "native_register_extra_item2"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(632) : error 017: undefined symbol "native_register_extra_item2"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(633) : error 017: undefined symbol "native_register_extra_item2"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(634) : error 017: undefined symbol "native_register_extra_item2"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(636) : error 017: undefined symbol "native_register_extra_item2"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1197) : error 017: undefined symbol "load_spawns"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1307) : error 017: undefined symbol "fm_get_user_team"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1313) : error 017: undefined symbol "save_stats"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1334) : error 017: undefined symbol "fnGetZombies"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1341) : error 017: undefined symbol "PlaySound"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1341) : error 088: number of arguments does not match definition
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1347) : error 017: undefined symbol "fnGetHumans"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1354) : error 017: undefined symbol "PlaySound"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1354) : error 088: number of arguments does not match definition
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1365) : error 017: undefined symbol "PlaySound"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1365) : error 088: number of arguments does not match definition
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1423) : error 017: undefined symbol "reset_vars"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1426) : error 017: undefined symbol "load_stats"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1456) : error 017: undefined symbol "check_round"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1459) : error 017: undefined symbol "save_stats"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1507) : error 017: undefined symbol "fm_get_user_team"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1517) : error 017: undefined symbol "do_random_spawn"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1530) : error 017: undefined symbol "reset_vars"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1531) : error 017: undefined symbol "zombieme"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1536) : error 017: undefined symbol "reset_vars"
// C:\Archivos de programa\valve\cstrike\addons\amxmodx\scripti ng\zombie_plague4
0.sma(1539) : error 017: undefined symbol "fm_set_user_health"

Como dije antes siempre me salen esos errores !!!!!
Es porque no cierras bien las llaves.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 09-13-2009 , 14:19   Re: [ES][ZP] Tutorial para agregar un modo!
#10

Quote:
Es porque no cierras bien las llaves.
eso mismo a mi me pasaba lo mismo siempre

anda haciendo linea por linea no copy paste de todo entero asi seguro no te funca

y las llaves seguro alguna que terminaba 2 llaves te abra faltado 1 o algo asi
TucanN# is offline
Send a message via MSN to TucanN#
 


Thread Tools
Display Modes

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 05:09.


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