necesito un comando para dar niveles
#1
Hola hay alguna manera de ponerle un comando para dar niveles y exp?
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <nfvault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "AlberthXD"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Web[] = "AMXMODX-ES.COM"  // Se Muestra en HUD
new const Prefijo[] = "!g[RANGOS]!y" // Prefijo en say
new const Sonido[] = "rango/up.wav" // Sonido Rango UP
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[30],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"1"100 },
    { 
"2"200 },
    { 
"3"300 },
    { 
"4"500 },
    { 
"5"700 },
    { 
"6"800 },
    { 
"7"900 },
    { 
"8"1000 },
    { 
"9"1200 },
    { 
"10"1300 },
    { 
"11"1400 },
    { 
"12"1500 },
    { 
"13"1700 },
    { 
"14"1800 },
    { 
"15"1900 },
    { 
"16"2000 },
    { 
"17"2100 },
    { 
"18"2300 },
    { 
"19"2500 },
    { 
"20"2700 },
    { 
"21"2900 },
    { 
"22"3100 },
    { 
"23"3400 },
    { 
"24"3700 },
    { 
"25"4000 },
    { 
"26"4300 },
    { 
"27"4600 },
    { 
"28"5000 },
    { 
"29"5400 },
    { 
"30"5800 },
    { 
"31"6200 },
    { 
"32"6600 },
    { 
"33"7000 },
    { 
"34"7400 },
    { 
"35"7800 },
    { 
"36"8200 },
    { 
"37"8600 },
    { 
"38"9000 },
    { 
"39"9500 },
    { 
"40"10000 },
    { 
"41"10500 },
    { 
"42"11000 },
    { 
"43"11500 },
    { 
"44"12000 },
    { 
"45"12500 },
    { 
"46"13500 },
    { 
"47"14000 },
    { 
"48"14500 },
    { 
"49"15000 },
    { 
"50"15600 },
    { 
"51"16200 },
    { 
"52"16800 },
    { 
"53"17400 },
    { 
"54"18000 },
    { 
"55"18600 },
    { 
"56"19200 },
    { 
"57"19800 },
    { 
"58"20400 },
    { 
"59"21000 },
    { 
"60"21600 },
    { 
"61"22200 },
    { 
"62"22800 },
    { 
"63"23400 },
    { 
"64"24100 },
    { 
"65"24800 },
    { 
"66"25500 },
    { 
"67"26200 },
    { 
"68"26900 },
    { 
"69"27600 },
    { 
"70"28300 },
    { 
"71"29000 },
    { 
"72"29800 },
    { 
"73"30600 },
    { 
"74"31400 },
    { 
"75"32200 },
    { 
"76"33000 },
    { 
"77"33800 },
    { 
"78"34600 },
    { 
"79"35400 },
    { 
"80"36300 },
    { 
"81"37200 },
    { 
"82"38100 },
    { 
"83"39000 },
    { 
"84"39900 },
    { 
"85"40800 },
    { 
"86"41700 },
    { 
"87"42600 },
    { 
"88"43500 },
    { 
"89"44400 },
    { 
"90"45300 },
    { 
"91"46200 },
    { 
"92"47100 },
    { 
"93"48000 },
    { 
"94"48900 },
    { 
"95"49800 },
    { 
"96"50700 },
    { 
"97"51600 },
    { 
"98"52500 },
    { 
"99"53400 },
    { 
"100"54300 },
    { 
"101"55200 },
    { 
"102"56100 },
    { 
"103"57000 },
    { 
"104"57900 },
    { 
"105"58800 },
    { 
"106"59700 },
    { 
"107"60600 },
    { 
"108"61600 },
    { 
"109"62600 },
    { 
"110"63600 },
    { 
"111"64600 },
    { 
"112"65600 },
    { 
"113"66600 },
    { 
"114"67600 },
    { 
"115"68600 },
    { 
"116"69600 },
    { 
"117"70600 },
    { 
"118"71600 },
    { 
"119"72600 },
    { 
"120"73600 },
    { 
"121"74600 },
    { 
"122"75600 },
    { 
"123"76600 },
    { 
"124"77600 },
    { 
"125"78600 },
    { 
"126"79600 },
    { 
"127"80600 },
    { 
"128"81700 },
    { 
"129"82800 },
    { 
"130"83900 },
    { 
"131"85000 },
    { 
"132"86100 },
    { 
"134"87200 },
         { 
"135"88300 },
    { 
"136"89400 },
    { 
"137"90500 },
    { 
"138"91600 },
    { 
"139"92700 },
    { 
"140"93800 },
    { 
"141"94900 },
    { 
"142"96000 },
    { 
"143"97100 },
    { 
"144"98200 },
    { 
"145"99300 },
    { 
"146"100400 },
    { 
"147"101600 },
    { 
"148"102800 },
    { 
"149"104000 },
    { 
"150"105200 },
    { 
"151"106400 },
    { 
"152"107600 },
    { 
"153"108800 },
    { 
"154"110000 },
    { 
"155"111200 },
    { 
"156"112400 },
    { 
"157"113600 },
    { 
"158"114800 },
    { 
"159"116000 },
    { 
"160"117200 },
    { 
"161"118400 },
    { 
"162"119600 },
    { 
"163"120800 },
    { 
"164"122000 },
    { 
"165"123300 },
    { 
"166"124600 },
    { 
"167"125900 },
    { 
"168"127200 },
    { 
"169"128500 },
    { 
"170"129800 },
    { 
"171"131100 },
    { 
"1000"10000000 }
}

/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/

/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)
new VaultRango[128], szRangos[180], szKey[30]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""0")    // 1 - x2 frags con knife | 0 - ÑO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""0")        // 1 - x2 frags de HeadShot | 0 - ÑO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
nfv_file("Ranguitos"VaultRangocharsmax(VaultRango))
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache() 
    
precache_sound(Sonido)
/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Nivel: %s  ||  Exp: %d/%d"Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]][FRAGS])
    } else {
        
set_hudmessage(302002550.350.9016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Nivel: %s  ||  Exp: %d/%d"Rangos[g_rango[id]][NOMBRE], g_frags[id], Rangos[g_rango[id]][FRAGS])
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    if(
XDGuardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++) {
        if(
XD
            
Guardar(id); 
    }
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '/' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
formatex(szRangoscharsmax(szRangos), "%d %d"g_frags[id], g_rango[id])
    
    
nfv_set_data(VaultRangoszKeyg_playername[id], szRangos)
}

Cargar(id) {
    new 
g_load_c1[25], g_load_c2[25]
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
    if(!
nfv_get_data(VaultRangoszKeyg_playername[id], szRangossizeof(szRangos) - 1)) return; 
   
    
parse(szRangosg_load_c1charsmax(g_load_c1), g_load_c2charsmax(g_load_c2))
    
    
g_frags[id] = str_to_num(g_load_c1)
    
g_rango[id] = str_to_num(g_load_c2)

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang21514\\ f0\\ fs16 \n\\ par }
*/ 
Responder
#2
(22/05/2019, 02:59 PM)kikizon2 escribió: No saben programar pero si saben cambiar el autor hijos de la vergaRoflmao

Código PHP:
new const AUTHOR[] = "AlberthXD" 
Responder
#3
(03/07/2019, 08:37 PM)Pan Bimbo (? escribió:
(22/05/2019, 02:59 PM)kikizon2 escribió: No saben programar pero si saben cambiar el autor hijos de la vergaRoflmao

Código PHP:
new const AUTHOR[] = "AlberthXD" 
El plugin lo encontre en youtube hace mucho antes de encontrar esta pagina...
disculpa cualquier malentendido
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)