PHP Code:
/* Plugin de la Seccion de Español de AlliedMods
*
* Changelog:
*
* v1.0 = Usuario AlgoChikitito crea el plugin con el comando /hola
* v1.1 = Uusario Kiske arregla el comando
* v1.2 = Usuario Destro- agrega el comando/idea
* v1.3 = Usuario Chaato agrega Colorchat
* v1.4 = - Usuario Asd' agrega sistema de niveles, junto a shinoda y KillLikoe modifican este sistema
* - !Morte le agrega un HUD con la informacion del jugador
* - stickcs agrega rangos
* v1.5 = - Asdito'^ modifica el sistema de rangos
* - Chaato agrega un menu
* v1.6 = Internel agrega sistema de puntos (como los ammo packs) y agrega el changelog
*/
#include <amxmodx>
#include <hamsandwich>
#include <colorchat>
const TASK_HUD = 1654;
new g_Autores[] = "AlgoChikitito, Kiske, Destro-, Chaato, Asd', shinoda, KillLikoe, !Morte, stickcs, Asdito', Chaato e Internel"
#define ADMIN_FLAG ADMIN_CVAR
#define ID_HUD ( TaskID - TASK_HUD )
new Kills[ 33 ];
new Levels[ 33 ];
new g_rounds[33];
new g_rango[33];
new g_puntos[33];
new pcvar_puntos, pcvar_puntosganados
new const rangos[][] = { "Junior Member", "Sub-Member", "AM Member", "Senior Member", "Advanced Member", "Extreme Member", "Vip Member", "Gold Member" }
new const RoundsNecesaries[] = { 4, 10, 22, 40, 66, 98, 105, 124 }
new Synchronized_Hud;
new g_MaxPlayers;
public plugin_init()
{
register_plugin( "AlliedModders" , "1.6" , "AlliedModders" );
RegisterHam( Ham_Killed, "player", "Forward_PlayerKilled", 1 );
register_clcmd( "say /Hi" , "Command_Hi" )
register_clcmd( "say /Idea" , "Command_Idea" );
register_clcmd( "say /Suggest" , "Command_Suggests" );
register_clcmd( "say /Compras" , "Command_Compras" );
register_logevent("logevent_round_end", 2, "1=Round_End")
pcvar_puntos = register_cvar("puntos_partida", "15")
pcvar_puntosganados = register_cvar("puntos_pormuerte", "10")
Synchronized_Hud = CreateHudSyncObj();
g_MaxPlayers = get_maxplayers( );
}
public client_putinserver( Index )
{
set_task( 1.0, "Function_Hud", Index+TASK_HUD, _, _, "b" )
g_puntos[Index] = get_pcvar_num(pcvar_puntos)
}
public Forward_PlayerKilled( Victim, Attacker, ShouldGibs )
{
if( Victim == Attacker )
return HAM_IGNORED;
while( ++Kills[ Attacker ] >= ( 1 + Levels[ Attacker ] ) * 10 )
{
Levels[ Attacker ]++;
g_puntos[Attacker] += get_pcvar_num(pcvar_puntosganados)
client_print_color( Attacker, DontChange, "^4[AMXX] ^1Has subido de nivel, tu nivel es: %i.", Levels[ Attacker ] );
}
set_task( 3.0, "Function_RespawnPlayer", Victim );
return HAM_IGNORED;
}
public Function_RespawnPlayer( Index )
{
if( !is_user_connected( Index ) )
return;
ExecuteHamB( Ham_CS_RoundRespawn, Index );
}
public Function_Hud( TaskID )
{
static Index; Index = ID_HUD
set_hudmessage( 255, 255, 255, 0.02, 0.15, 1, 6.0, 1.1, 0.0, 0.0, -1 )
ShowSyncHudMsg( ID_HUD, Synchronized_Hud, "Nivel: %d - Kills: %d - Status: %s", Levels[ Index ], Kills[ Index ], rangos[g_rango[ Index ] ])
}
public Command_Hi( Index )
{
client_print_color( Index, DontChange, "^4[AMXX] ^1Hola, este plugin ha sido creado por la seccion Spanish de AlliedModders" );
}
public Command_Idea( Index )
{
client_print_color( Index , DontChange, "^4[AMXX] ^1Hagamos un nuevo mod entre todos!" );
}
public Command_Suggests( Index )
{
client_print_color( Index, DontChange, "^4[AMXX] ^1Otras sugerencias como la de Destro?" );
}
public logevent_round_end()
{
static Index ;
for( Index = 1; Index <= g_MaxPlayers; Index++ )
{
if ( get_user_flags( Index ) & ADMIN_FLAG)
g_rounds[ Index ] += 2
else
g_rounds[ Index ]++
check_rango( Index )
}
}
public check_rango( Index )
{
while(g_rounds[ Index ] >= RoundsNecesaries[g_rango[ Index ]])
{
if (g_rango[ Index ] >= sizeof rangos)
client_print_color( Index, DontChange, "^4[AMXX] ^1Felicidades alcancaste el rango mayor AM")
else
{
g_rango[ Index ]++
client_print_color( Index, DontChange, "^4[AMXX] !Has subido al RANGO: %s", rangos[g_rango[ Index ]])
}
}
}
public Command_Compras(id)
{
if(is_user_alive(id))
{
new Menu = menu_create("\r AlliedModders\y Spanish Seccion\w Compras.", "Compras_handle")
menu_additem(Menu, "Compra 1" , "1" ,0)
menu_additem(Menu, "Compra 2" , "2" ,0)
menu_additem(Menu, "Compra 3" , "3" ,0)
menu_additem(Menu, "Compra 4" , "4" ,0)
menu_additem(Menu, "Compra 5" , "6" ,0)
menu_additem(Menu, "\rINFO PLUG" , "7" ,0)
menu_setprop(Menu,MPROP_EXITNAME,"Salir.")
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, Menu, 0)
}
else
{
chat_color(id, "!g[AMXX]!t No eres de la seccion: !g Spanish XD.")
}
}
public Compras_handle(id, Menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu, item, iAccess , iData, 5, iName , 63, iCallback)
switch (str_to_num(iData))
{
case 1:
{
//AÑADIR OPCION Y/O COMPRA
}
case 2:
{
//AÑADIR OPCION Y/O COMPRA
}
case 3:
{
//AÑADIR OPCION Y/O COMPRA
}
case 4:
{
//AÑADIR OPCION Y/O COMPRA
}
case 5:
{
//AÑADIR OPCION Y/O COMPRA
}
case 6:
{
//AÑADIR OPCION Y/O COMPRA
}
case 7:
{
chat_color(id, "!g[AMXX]!y Este plugin fue creado por la seccion!g Spanish!y de!g AlliedModders")
chat_color(id, "!g[AMXX] !tAutores:!g %s", g_Autores)
}
}
return PLUGIN_HANDLED;
}