Hola gente, les vengo a traer una guia que hice recien que estaba aburrido
Es una guia de logros por frags. Al completar un logro ganas ammopacks
Empezamos:
Logros por Frags
Paso 1:
Paso 2:
Paso 3:
Paso 4:
Bueno hasta ahi estarian listo los logros, si tube algun error por favor avisarme abajo, lo adapte del sistema de logros de I'mBuggimen
No lo probe, pero compila perfecto.
Despues agregare 2 guias mas (una con hud, y otra con guardado adv_vault)
Creditos:
I'mBuggimen [sistema de logros]
NkkI [Ayudarme a solucionar un problema]
Es una guia de logros por frags. Al completar un logro ganas ammopacks
Empezamos:
Logros por Frags
Paso 1:
Abajo de los includes agregamos:
Código PHP:
enum _:_STRUCT_LOGROS { LOGRO_NAME[ 90 ], LOGRO_INFO[ 90 ], LOGRO_REQUIRED, LOGRO_REWARD };
enum _:_FRAGS_LOGROS { CT, T };
new const g_iszCLogros[ ][ _STRUCT_LOGROS ] =
{
//NOMBRE DE LOGRO / FRAGS / GANANCIA
{ "Mi Primera Sangre", "Mata 5 Zombie", 5, 5 },
{ "Aprendiz De Humano", "Mata 10 Zombie", 10, 10 },
{ "Umbrella", "Mata 40 Zombie", 40, 40 },
{ "Last Man Standing", "Mata 100 Zombie", 100, 100 }
};
new const g_iszTLogros[ ][ _STRUCT_LOGROS ] =
{
{ "Mi Primera Masacre", "Infecta a 5 Humanos", 5, 5 },
{ "Aprendiz de Zombie", "Infecta a 10 Humanos", 10, 10 },
{ "I Will Destroy", "Infecta a 40 Humanos", 40, 40 },
{ "Dominating Our Wolrd!", "Infecta a 200 Humanos", 200, 200 }
};
new g_frags[ 33 ][ _FRAGS_LOGROS ];
new g_szText[ 500 ];
Paso 2:
En plugin_init() nos dirijimos a // Client commands y abajo del todo agregamos
Quedaria asi:
Código PHP:
register_clcmd("say /logros", "clcmd_logros")
Quedaria asi:
Código PHP:
// Client commands
register_clcmd("say zpmenu", "clcmd_saymenu")
register_clcmd("say /zpmenu", "clcmd_saymenu")
register_clcmd("say unstuck", "clcmd_sayunstuck")
register_clcmd("say /unstuck", "clcmd_sayunstuck")
register_clcmd("nightvision", "clcmd_nightvision")
register_clcmd("drop", "clcmd_drop")
register_clcmd("buyammo1", "clcmd_buyammo")
register_clcmd("buyammo2", "clcmd_buyammo")
register_clcmd("chooseteam", "clcmd_changeteam")
register_clcmd("jointeam", "clcmd_changeteam")
register_clcmd("say /logros", "clcmd_logros")
Paso 3:
En public fw_PlayerKilled(victim, attacker, shouldgib) nos dirijimos abajo de // Get nightvision give setting y agregamos:
Y para chequear los logros agregamos:
Quedaria asi:
Código PHP:
if(!g_zombie[attacker] && g_zombie[victim])
{
g_frags[ attacker ][ CT ] += 1
}
if(g_zombie[attacker] && !g_zombie[victim])
{
g_frags[ attacker ][ T ] += 1
}
Y para chequear los logros agregamos:
Código PHP:
get_logro(attacker)
Quedaria asi:
Código PHP:
public fw_PlayerKilled(victim, attacker, shouldgib)
{
// Last Zombie Check
set_task(0.1, "fnCheckLastZombie")
// Enable dead players nightvision
set_task(0.2, "spec_nvision", victim)
// Get nightvision give setting
static nvggive
nvggive = get_pcvar_num(cvar_nvggive)
if(!g_zombie[attacker] && g_zombie[victim])
{
g_frags[ attacker ][ CT ] += 1
}
if(g_zombie[attacker] && !g_zombie[victim])
{
g_frags[ attacker ][ T ] += 1
}
// Disable nightvision when killed (bugfix)
if (nvggive == 0 && g_nvision[victim])
{
if (g_nvisionenabled[victim] && !get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim, 0)
g_nvision[victim] = false
g_nvisionenabled[victim] = false
}
// Turn off nightvision when killed (bugfix)
if (nvggive == 2 && g_nvision[victim] && g_nvisionenabled[victim])
{
if (!get_pcvar_num(cvar_cnvg)) set_user_gnvision(victim, 0)
g_nvisionenabled[victim] = false
}
// Stop bleeding/burning when killed
if (g_zombie[victim])
remove_task(victim+TASK_BLOOD)
// Nemesis explodes!
if (g_nemesis[victim])
SetHamParamInteger(3, 2)
// Get deathmatch mode status and whether the player killed himself
static deathmatch, selfkill
deathmatch = get_pcvar_num(cvar_deathmatch)
selfkill = (victim == attacker || !is_user_connected(attacker)) ? true : false
// Respawn if deathmatch is enabled
if (deathmatch)
{
// Respawn on suicide?
if (selfkill && !get_pcvar_num(cvar_respawnonsuicide))
return;
// Respawn if only the last human is left?
if (!get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() == 1)
return;
// Respawn as zombie?
if (deathmatch == 2 || (deathmatch == 3 && random_num(0, 1)) || (deathmatch == 4 && fnGetZombies() < fnGetAlive()/2))
g_respawn_as_zombie[victim] = true
// Set the respawn task
set_task(get_pcvar_float(cvar_spawndelay), "respawn_player", victim+TASK_SPAWN)
}
// Killed by a non-player entity or self killed
if (selfkill) return;
// Ignore Nemesis/Survivor Frags?
if ((g_nemesis[attacker] && get_pcvar_num(cvar_nemignorefrags)) || (g_survivor[attacker] && get_pcvar_num(cvar_survignorefrags)))
RemoveFrags(attacker, victim)
// Zombie/nemesis killed human, reward ammo packs
if (g_zombie[attacker] && (!g_nemesis[attacker] || !get_pcvar_num(cvar_nemignoreammo)))
g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect)
// Get frag rewards for humans and zombies
static fragskill, fragsinfect
fragskill = get_pcvar_num(cvar_fragskill)
fragsinfect = get_pcvar_num(cvar_fragsinfect)
// Human killed zombie, add up the extra frags for kill
if (!g_zombie[attacker] && fragskill > 1)
UpdateFrags(attacker, victim, fragskill-1, 0, 0)
// Zombie killed human, add up the extra frags for kill
if (g_zombie[attacker] && fragsinfect > 1)
UpdateFrags(attacker, victim, fragsinfect-1, 0, 0)
get_logro(attacker)
}
Paso 4:
Abajo del todo agregamos lo siguiente:
Código PHP:
public clcmd_logros( index )
{
new Team = get_user_team( index );
switch( Team )
{
case CS_TEAM_CT: LogrosC( index );
case CS_TEAM_T: LogrosT( index );
}
return PLUGIN_HANDLED;
}
public LogrosC( index )
{
new iMenu = menu_create( "Viendo Logros Humanos", "Handler_LogrosC" );
for( new num = 0; num < sizeof( g_iszCLogros ); num++ )
{
formatex( g_szText, charsmax( g_szText ), ( g_frags[ index ][ CT ] >= g_iszCLogros[ num ][ LOGRO_REQUIRED ] ) ? "%s \y[ \wCOMPLETADO \y]":"%s",
g_iszCLogros[ num ][ LOGRO_NAME ], g_iszCLogros[ num ][ LOGRO_NAME ] );
menu_additem( iMenu, g_szText, _, _, menu_makecallback( "get_LogroC" ) );
}
menu_display( index, iMenu, 0 );
}
public LogrosT( index )
{
new iMenu = menu_create( "Viendo Logros Zombie", "Handler_LogrosT" );
for( new num = 0; num < sizeof( g_iszTLogros ); num++ )
{
formatex( g_szText, charsmax( g_szText ), ( g_frags[ index ][ T ] >= g_iszTLogros[ num ][ LOGRO_REQUIRED ] ) ? "%s \y[ \wCOMPLETADO \y]":"%s",
g_iszTLogros[ num ][ LOGRO_NAME ], g_iszTLogros[ num ][ LOGRO_NAME ] );
menu_additem( iMenu, g_szText, _, _, menu_makecallback( "get_LogroT" ) );
}
menu_display( index, iMenu, 0 );
}
public Handler_LogrosT( index , iMenu, iItem )
{
formatex( g_szText, charsmax( g_szText ), "\yLogro: \w%s^n\yInfo: \w%s^n^n\yHumanos Infectados: \w%d\r/\w%d^n^n\rRecompensa: \y%d",
g_iszTLogros[ iItem ][ LOGRO_NAME ], g_iszTLogros[ iItem ][ LOGRO_INFO ], g_frags[ index ][ T ], g_iszTLogros[ iItem ][ LOGRO_REQUIRED ],
g_iszTLogros[ iItem ][ LOGRO_REWARD ] );
new iMenu = menu_create( g_szText, "LogrosInfo" );
menu_additem( iMenu, "Salir" );
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_display( index, iMenu, 0 );
}
public Handler_LogrosC( index , iMenu, iItem )
{
formatex( g_szText, charsmax( g_szText ), "\yLogro: \w%s^n\yInfo: \w%s^n^n\yZombie Matados: \w%d\r/\w%d^n^n\rRecompensa: \y%d",
g_iszCLogros[ iItem ][ LOGRO_NAME ], g_iszCLogros[ iItem ][ LOGRO_INFO ], g_frags[ index ][ CT ], g_iszCLogros[ iItem ][ LOGRO_REQUIRED ],
g_iszCLogros[ iItem ][ LOGRO_REWARD ] );
new iMenu = menu_create( g_szText, "LogrosInfo" );
menu_additem( iMenu, "Salir" );
menu_setprop( iMenu, MPROP_EXIT, MEXIT_NEVER );
menu_display( index, iMenu, 0 );
}
public LogrosInfo( index, iMenu, iItem ) menu_destroy( iMenu );
public get_LogroC( index, iMenu, iItem ) return g_frags[ index ][ CT ] >= g_iszCLogros[ iItem ][ LOGRO_REQUIRED ] ? ITEM_DISABLED : ITEM_ENABLED;
public get_LogroT( index, iMenu, iItem ) return g_frags[ index ][ T ] >= g_iszTLogros[ iItem ][ LOGRO_REQUIRED ] ? ITEM_DISABLED : ITEM_ENABLED;
public get_logro( index )
{
new Teams = get_user_team( index );
switch( Teams )
{
case CS_TEAM_CT:
{
for( new n = 0; n < sizeof( g_iszCLogros ); n++ )
{
if( g_frags[ index ][ CT ] == g_iszCLogros[ n ][ LOGRO_REQUIRED ] )
{
zp_colored_print( index, "^x04[ZP]^x01 Logro completado:^x03 %s^x01. Ganaste^x04 %d^x01 Ammopacks ", g_iszCLogros[ n ][ LOGRO_NAME ], g_iszCLogros[ n ][ LOGRO_REWARD ] );
g_ammopacks[ index ] += g_iszCLogros[ n ][ LOGRO_REWARD ];
}
}
}
case CS_TEAM_T:
{
for( new num = 0; num < sizeof( g_iszTLogros ); num++ )
{
if( g_frags[ index ][ T ] == g_iszTLogros[ num ][ LOGRO_REQUIRED ] )
{
zp_colored_print( index, "^x04[ZP]^x01 Logro completado:^x03 %s^x01. Ganaste^x04 %d^x01 Ammopacks ", g_iszTLogros[ num ][ LOGRO_NAME ], g_iszTLogros[ num ][ LOGRO_REWARD ] );
g_ammopacks[ index ] += g_iszTLogros[ num ][ LOGRO_REWARD ];
}
}
}
}
}
Bueno hasta ahi estarian listo los logros, si tube algun error por favor avisarme abajo, lo adapte del sistema de logros de I'mBuggimen
No lo probe, pero compila perfecto.
Despues agregare 2 guias mas (una con hud, y otra con guardado adv_vault)
Creditos:
I'mBuggimen [sistema de logros]
NkkI [Ayudarme a solucionar un problema]
[GUIA] [ZP] Logros por frags
[APORTE] Sistema de Frags + Shop + Top15 + Menu + Guardado (adv_vault)
[APORTE] Base Builder + Niveles v1.0
[APORTE] Top10 Knife
[APORTE] Top10 por Banderas ( ctf )
APRENDIENDO...
[APORTE] Sistema de Frags + Shop + Top15 + Menu + Guardado (adv_vault)
[APORTE] Base Builder + Niveles v1.0
[APORTE] Top10 Knife
[APORTE] Top10 por Banderas ( ctf )
APRENDIENDO...