Estadísticas CT Y TT
#1
Hola Buenas gente les traigo este plugin para ver en grande cuanto score lleva cada team

Para Zombie
Código PHP:
#include <amxmodx>
#include <engine>
#include <zombieplague>

#define PLUGIN "[ZP] Team win score"
#define VERSION "1.3"
#define AUTHOR "Ryokin"

new g_zombiescoreg_humanscoreg_NoOneWing_hudcolor,g_hudposition g_hudmsg

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_think("msg","ForwardThink")
    
register_event("TextMsg""RestartRound""a""2&#Game_C""2&#Game_w")
    
g_NoOneWin register_cvar"zp_winnoone_score""1")
    
g_hudcolor register_cvar"zp_teamscore_hudcolor""255 255 255")
    
g_hudposition register_cvar"zp_teamscore_hudposition""-1.0 0.02")
    
g_hudmsg CreateHudSyncObj()
    new 
iEnt create_entity("info_target")
    
entity_set_string(iEntEV_SZ_classname"msg")
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 2.0)
}

public 
zp_round_ended(team)
{
    switch(
team)
    {
        case 
WIN_ZOMBIESg_zombiescore ++ 
        
        case 
WIN_HUMANSg_humanscore ++ 
        
        case 
WIN_NO_ONE
            if (
get_pcvar_num(g_NoOneWin))
                
g_humanscore ++
    }
}

public 
ForwardThink(iEnt)
{
    
show_hud()
        
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 2.0)
}

public 
show_hud()
{
    static 
hud_red,hud_green,hud_blueFloat:hud_xFloat:hud_y

    hudmsgcolor
(hud_red,hud_green,hud_blue)
    
hudmsgpos(hud_x,hud_y)

    
set_hudmessage(hud_redhud_greenhud_bluehud_xhud_y__4.0__4)
    
ShowSyncHudMsg(0g_hudmsg"/[Estadisticas]\^n/[Zombies]  [Humanos]\^n/--------[%s%d] -- [%s%d]--------\",g_zombiescore >= 10 ? "" : "0",g_zombiescore,g_humanscore >= 10 ? "" : "0", g_humanscore )
}

public RestartRound()
{
    g_zombiescore = 0
    g_humanscore = 0
}

public hudmsgcolor(&hud_red,&hud_green,&hud_blue)
{
    new color[16], red[4], green[4], blue[4]
    get_pcvar_string(g_hudcolor, color, 15)
    parse(color, red, 3, green, 3, blue, 3)
        
    hud_red = str_to_num(red)
    hud_green = str_to_num(green)
    hud_blue = str_to_num(blue)
}

public hudmsgpos(&Float:hud_x,&Float:hud_y)
{
    new Position[19], PositionX[6], PositionY[6]
    get_pcvar_string(g_hudposition, Position, 18)
    parse(Position, PositionX, 6, PositionY, 6)
    
    hud_x = str_to_float(PositionX)
    hud_y = str_to_float(PositionY)


Para Modo normal

Código PHP:
#include <amxmodx>
#include <engine>
#include <cstrike>

// EL codigo fue creado por Ryokin y fue editado por mi Rispek
#define PLUGIN "EStadisticas de ronda"
#define VERSION "1.0"
#define AUTHOR "Ryokin"

new g_ttscoreg_ctscoreg_NoOneWing_hudcolor,g_hudposition g_hudmsg

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_think("msg","ForwardThink")
    
register_event("TextMsg""RestartRound""a""2&#Game_C""2&#Game_w")
    
g_NoOneWin register_cvar"cs_winnoone_score""1")
    
g_hudcolor register_cvar"cs_teamscore_hudcolor""255 255 255")
    
g_hudposition register_cvar"cs_teamscore_hudposition""-1.0 0.02")
    
g_hudmsg CreateHudSyncObj()
    new 
iEnt create_entity("info_target")
    
entity_set_string(iEntEV_SZ_classname"msg")
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 2.0)
}

public 
ronda_estadisticas(team)
{
    switch(
team)
    {
        case 
WIN_TTg_terrorscore ++ 
        
        case 
WIN_CTg_counterctscore ++ 
        
        case 
WIN_NO_ONE
            if (
get_pcvar_num(g_NoOneWin))
                
g_humanscore ++
    }
}

public 
ForwardThink(iEnt)
{
    
show_hud()
        
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 2.0)
}

public 
show_hud()
{
    static 
hud_red,hud_green,hud_blueFloat:hud_xFloat:hud_y

    hudmsgcolor
(hud_red,hud_green,hud_blue)
    
hudmsgpos(hud_x,hud_y)

    
set_hudmessage(hud_redhud_greenhud_bluehud_xhud_y__4.0__4)
    
ShowSyncHudMsg(0g_hudmsg"/[Estadisticas]\^n/-[TT] - [CT]---\^n/--------[%s%d] -- [%s%d]--------\",g_ttscore >= 10 ? "" : "0",g_ttscore,g_ctscore >= 10 ? "" : "0", g_ctscore )
}

public RestartRound()
{
    g_ttscore = 0
    g_ctscore = 0
}

public hudmsgcolor(&hud_red,&hud_green,&hud_blue)
{
    new color[16], red[4], green[4], blue[4]
    get_pcvar_string(g_hudcolor, color, 15)
    parse(color, red, 3, green, 3, blue, 3)
        
    hud_red = str_to_num(red)
    hud_green = str_to_num(green)
    hud_blue = str_to_num(blue)
}

public hudmsgpos(&Float:hud_x,&Float:hud_y)
{
    new Position[19], PositionX[6], PositionY[6]
    get_pcvar_string(g_hudposition, Position, 18)
    parse(Position, PositionX, 6, PositionY, 6)
    
    hud_x = str_to_float(PositionX)
    hud_y = str_to_float(PositionY)

Responder
#2
Está todo bien con qué tengas ganas de aportar algo al foro, pero hace las cosas bien.

Está muy mal echo el plugin en sí.

PD I: Modo normal (?

Código PHP:
public zp_round_ended(team)
{
    switch(
team)
    {
        case 
WIN_TTg_terrorscore ++ 
        
        case 
WIN_CTg_counterctscore ++ 
        
        case 
WIN_NO_ONE
            if (
get_pcvar_num(g_NoOneWin))
                
g_humanscore ++
    }


PD II:
(18/09/2017, 12:42 AM)Treki escribió: La descripción de la sección es "Aportes de códigos, funciones o stocks útiles". El tuyo comparado con el resto ¿Es mas eficiente? ¿Tiene mas funcionalidades? ¿Es mas seguro? ¿Usa un guardado que el resto no?.

Saludos #tocayo. Crab
Responder
#3
dudo que de normal sirva xd
gracias por el aporte we, nada más ambos ya existen.


de igual manera está bien que quieras aportar, siguele echando ganas! pacman
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#4
(02/04/2018, 11:41 PM)Hypnotize escribió: dudo que de normal sirva xd
gracias por el aporte we, nada más ambos ya existen.


de igual manera está bien que quieras aportar, siguele echando ganas! pacman

gracias pero soy un poco novato y se muy poco pawn pero le echare ganas y así aprender cada vez un poco
Responder
#5
Para que es este case? o:

Código PHP:
case WIN_NO_ONE
            if (
get_pcvar_num(g_NoOneWin))
                
g_humanscore ++ 
(13/08/2018, 07:59 PM)KrR10VnZl escribió: Usted tiene un retraso de otro mundo, pon de tu parte coño, como es posible que preguntes cual código? muchacho mongólico si dice código, él se refiere al SMA del CTF, dios mio y si no te gusta que te digan que tienes un retraso magistral, astral del otro mundo pon de tú parte y no hagas preguntas tontas.
Responder
#6
(04/04/2018, 01:06 PM)Yoshi Saw escribió: Para que es este case? o:

Código PHP:
case WIN_NO_ONE
            if (
get_pcvar_num(g_NoOneWin))
                
g_humanscore ++ 

Para saber si no ganó nadie que se cumpla cierta función

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)