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

Rank exp and reset


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
Maickol_22
BANNED
Join Date: Dec 2015
Location: https://t.me/pump_upp
Old 11-21-2018 , 22:07   Rank exp and reset
Reply With Quote #1

Rank Exp + Resets

Spoiler


Guardado: Guardado


PHP Code:
#include <amxmodx> 
#include <hamsandwich>
#include <fun>
#include <amxmisc>
#include <adv_vault>

#define HUD (taskid-Task) /*[ Definimos el id del hud :3 ]*/

/*************************************\
***************************************
    Armas a la que le daremos damage
***************************************
\*************************************/
new Armas [ ] [ ] = {

CSW_P228,       
CSW_SCOUT,   
CSW_HEGRENADE,       
CSW_XM1014,       
CSW_C4,           
CSW_MAC10,       
CSW_AUG,           
CSW_SMOKEGRENADE,    
CSW_ELITE,        
CSW_FIVESEVEN,        
CSW_UMP45,       
CSW_SG550,        
CSW_GALIL,        
CSW_FAMAS,        
CSW_USP,            
CSW_GLOCK18,        
CSW_AWP,            
CSW_MP5NAVY,        
CSW_M249,       
CSW_M3,            
CSW_M4A1,        
CSW_TMP,            
CSW_G3SG1,       
CSW_FLASHBANG,      
CSW_DEAGLE,        
CSW_SG552,        
CSW_AK47,        
CSW_KNIFE,        
CSW_P90           

}

/*************************************\
***************************************
            Variables Globales...
***************************************
\*************************************/
new g_nombre33 ] [ 32 ], g_vaultGuardRankGuardExpGuardRsRHUDS;

const 
Task 2323

new g_Plugin [ ] = "Rangos Exp + Reset"//Ranos x Frags
new g_version[ ] = "1.0";//Version
new g_Autor  [ ] = "Alejandro-."//Autor
new g_Tag      [ ] = "!g[::!tSG!g::]"//Tag de tu servidor
new Rank_up  [ ] = "rank_up.mp3"//Solo mp3 :3
new Reset_up [ ] = "reset_up.mp3"//Solo mp3 :3
new FileMax     [ ] = "RangosMaximos.ini";
new 
RanksDar [ ] = "amx_Rango.ini";
new 
ResetMax [ ] = "ResetMaximos.ini";
new 
g_MAX_RANGOS 29;

enum _:DATA_RANGOS  {     NAME 32 ],     Kill,     KillHS,     HP,     AMMO    }
/*************************************\
***************************************
   Aqui podemos editar cada rango :3
***************************************
\*************************************/
new g_Rangos [ ] [ DATA_RANGOS ] =  

{
/*    [NOMBRE]                          [Kills] [Kills Hs][HP][CHALECO]    */
  
{    "Recluta",                             20,           30,     100,     100        },
  {    
"Soldado Raso",                   18,           28,     102,     104        },
  {    
"Cabo",                               16,           24,     105,     110        },
  {    
"Cabo Grado 1",                   14,           22,     108,     116        },
  {    
"Sargento",                         12,               20,     110,     120        },
  {    
"Sargento Grado 1",             10,           17,     112,     124        },
  {    
"Sargento Grado 2",              8,               15,         116,     132        },
  {    
"Subteniente",                       6,               10,     120,     140        },
  {    
"Subteniente Grado 1",           4,               8,         124,     148        },
  {    
"Subteniente Grado 2",            4,               8,         126,     152        },
  {    
"Capitán",                             4,               8,         130,     160        },
  {    
"Mayor",                               4,               8,         136,     172        },
  {    
"Teniente Coronel",             4,               8,         140,     180        },
  {    
"Teniente Coronel Grado 1",    2,               5,         145,     190        },
  {    
"Teniente Coronel Grado 2",    2,               5,        150,     200        },
  {    
"Comandante",                     2,               5,         155,     210        },
  {    
"Coronel",                             2,               5,         160,     220        },
  {    
"Brigada",                             2,               5,         165,     230        },
  {    
"Brigada Grado 1",                2,               5,         170,     240        },
  {    
"Brigada Grado 2",                2,               5,         175,     250        },
  {    
"Brigada Grado 3",                2,               5,         180,     260        },
  {    
"General",                             2,               4,         185,     270        },
  {    
"Leyenda",                             2,               3,         190,     280        },
  {    
"Mítico",                             2,               3,         195,     290        },
  {    
"Noble",                               2,               3,         196,     292        },
  {    
"Nova",                               2,               3,         197,     294        },
  {    
"Nova Grado 1",                   2,               3,         198,     296        },
  {    
"Nova Grado 2",                   2,               3,         199,     298        },
  {    
"Reclamador",                       2,               3,         200,     300        },
  {    
"Heredero",                         1,              2,        200,    300        }, //Los rangos seran contados hata aqui este es el numero 29 y comienza desde el 0...
  
{    "RANGO MAXIMO",                   0,              0,        200,    300        // Este rango es para el bug del hud de Siguiente Rango: MAXIMO RANGO y de ay no pasara :3

}

/*************************************\
***************************************
  Aqui editamos el damage del reset
***************************************
\*************************************/
new Float:ResetDamage[ ] = { 1.01.11.21.31.41.51.61.82.02.2,2.5  //10 Damages de 10 resets

new g_Rango 33 ], g_exp 33 ], g_rest33 ];

/*************************************\
***************************************
  Parcheamos los sonidos de rango
  y reset.
***************************************
\*************************************/
public plugin_precache( ) 
{
    
precache_sound(Rank_up)
    
precache_sound(Reset_up)

}

/*************************************\
***************************************
  Iniciamos el plugin
***************************************
\*************************************/
public plugin_init ( )
{
register_pluging_Pluging_versiong_Autor )
register_event"DeathMsg""EventFrags""a" );
RegisterHam(Ham_TakeDamage"player""DamageR"0)
RegisterHamHam_Spawn,"player","RoundR",)

register_clcmd"say /rango""cmd_rango" )
register_clcmd"say /reset""Verific" )

register_concmd("amx_rango","dar_rango"ADMIN_CVAR" ^"name^" ^"NUMERO DEL RANGO^"")

register_clcmd("say""fw__HookSay")

g_vault adv_vault_open("RangosEspeciales"false),
GuardRank adv_vault_register_field(g_vault"Rango"DATATYPE_ARRAY5);
GuardExp adv_vault_register_field(g_vault"Exp"DATATYPE_ARRAY5);
GuardRs adv_vault_register_field(g_vault"Resets"DATATYPE_ARRAY5);
adv_vault_init(g_vault)

RHUDS CreateHudSyncObj() 

}

/*************************************\
***************************************
  Mensaje al que tipee say /Rango
***************************************
\*************************************/
public cmd_rango id )
{

    
ColorChatid"!yTu rangos es: !g( !t%s !g) !yy Exp. !g%d%%"g_Rangos g_Rango id ] ] [ NAME ], g_exp id ] )

}

/*************************************\
***************************************
  Exp x Frags :3
***************************************
\*************************************/
public EventFrags()
{
new 
Atacante read_data(1);
new 
cabeza read_data(3);

new 
Nombre [33]; 

get_user_name(AtacanteNombrecharsmax(Nombre));

if( 
100 g_exp Atacante ] ){

if(
is_user_alive(Atacante)) 
{

g_exp Atacante ] += g_Rangos g_Rango Atacante ] ] [ Kill ]

if(
cabeza)
{

g_exp Atacante ] += g_Rangos g_Rango Atacante ] ] [ KillHS ]

}

}

}

Chequeo Atacante )




/*************************************\
***************************************
  Chequeamos si ya puede aumentar de 
  rangosi el user ya tiene los 100 de 
  exp de cada rango, tendra su aumento.
***************************************
\*************************************/
public Chequeo id )
{
    new 
Nombre 33 ];
    
get_user_name(idNombre32)

    if ( 
g_exp id ] >= 100 )
    {
        if( 
g_MAX_RANGOS g_Rango id ])
        {
            
g_Rango id ] ++
            
g_exp id ] -= 100
            client_cmd
(id"mp3 play sound/%s"Rank_up)
            
ColorChat0"!yEl jugador [ !t%s !y] aumento al rango: !g( !t%s !g)"Nombreg_Rangos g_Rango id ] ] [ NAME ] )

        }
        else {
            
client_print(idprint_console,"( %s ) Ya tienes el maximo de rangos, no puedes aumentar mas :3"Nombre)
            
log_to_file(FileMax"( %s ) eh llegado al rango MAXIMO <3"Nombre )
        }

    }
}

/*************************************\
***************************************
              /PUTINSERVER/
***************************************
\*************************************/
public client_putinserver(id
{
g_Rango id ] = 0
g_exp   
id ] = 0
set_task
(1.0"HudCentral"id Task__"b")
get_user_name(idg_nombre[id], 31)
Cargar(id)
}

/*************************************\
***************************************
              /DISCONNECT/
***************************************
\*************************************/    
public client_disconnect(id) { 
remove_task(id+Task)
Guardar(id)   


/*************************************\
***************************************
              /HUD/
***************************************
\*************************************/
public HudCentral(taskid)
{
new 
id HUD

set_hudmessage
(18525500.020.1616.01.10.00.0, -1)
ShowSyncHudMsg(HUDRHUDS,  "/--------------------------\^nRango: %s^nSig. Rango: %s^nExp: %d%%/100%%^nResets: %d/10^n\--------------------------/"g_Rangos g_Rango id ] ] [ NAME ], g_Rangos g_Rango id ] + ] [ NAME ], g_exp id ], g_rest id ] )
}  

/*************************************\
***************************************
              /Ronda de rangos/
***************************************
\*************************************/
public RoundRid  )
{
    if( !
is_user_aliveid ) )
    return 
HAM_IGNORED;
    
set_user_health(idg_Rangos g_Rango id ] ] [ HP ])
    
set_user_armor(idg_Rangos g_Rango id ] ] [ AMMO ])
    return 
HAM_IGNORED;
}  

/*************************************\
***************************************
      Cmd para dar rango, 
      amx_rango "Name" "del 1 al 23
      serian los rangos" ej.
      amx_rango "|Alejandro-." "18" 
      seria rango "Brigada Grado 1"
***************************************
\*************************************/
public dar_rango (idlevelcid)
{
if (!
cmd_access(idlevelcid3))
return 
PLUGIN_HANDLED;

new 
arg[33], arg2[10];
read_argv(1argcharsmax(arg))
read_argv(2arg2charsmax(arg2))

static 
iNameAdmin33 ];
 
 
get_user_nameidiNameAdmincharsmaxiNameAdmin ) );

new 
Player cmd_target(idarg,CMDTARGET_ONLY_ALIVE)

if (!
Player)
{
ColorChatid"!yJugador no encontrado)")
return 
PLUGIN_HANDLED;
}
if( 
g_MAX_RANGOS g_Rango id ] )
{
client_print(idprint_console,"le diste el rango ( %s ) El usuario ( %s )"g_Rangos [str_to_num(arg2)] [ NAME ], arg)
g_Rango Player ] = str_to_num(arg2)
client_cmd(id"mp3 play sound/%s"Rank_up)
ColorChat0"!yEl administrador [ !t%s !y] le dio el rango: !g( !t%s !g) !y ah [ !t%s !y]"iNameAdming_Rangos g_Rango id ] ] [ NAME ], arg )
log_to_file(RanksDar"El administrador ( %s ) le dio el rango ( %s ) "iNameAdming_Rangos [str_to_num(arg2)] [ NAME ] )
}
else 
client_print(idprint_console,"El usuario ( %s ) ya tiene el maximo de rangos"arg )
return 
PLUGIN_HANDLED;
}

/*************************************\
***************************************
    Menu para dar resets.
***************************************
\*************************************/

public Menu_Resets id 
{

static 
menuszMenu[1304];

formatexszMenusizeof(szMenu), "\y|\r***********************\y|^n\w[::\ySG\w::] Hacer Reset^nBy: %s^nExp: %d%%^n\wRango ( \y%s\w )^n\y|\r***********************\y|"g_Autorg_exp id ], g_Rangos g_Rango id ] ] [ NAME ] );
menu menu_create(szMenu"OpciMen");
if( 
g_MAX_RANGOS g_Rango id ] )
{
menu_additem(menu"Resetear\y ( \rTE FALTAN RANGOS\y )",  __menu_makecallback("CallBack")); // case 0
}
else 
{
menu_additem(menu"\yResetear",  __menu_makecallback("CallBack"));
}
menu_additem(menu"Mis resets^n"""0); // case 1
menu_additem(menu"Mi informacion"""0); // case 2

menu_setprop(menuMPROP_EXITMEXIT_ALL);
menu_setprop(menuMPROP_NEXTNAME"Siguiente");
menu_setprop(menuMPROP_BACKNAME"Volver");
menu_setprop(menuMPROP_EXIT"Salir");
menu_setprop(menuMPROP_NOCOLORS1);

menu_display(idmenu0);

return 
PLUGIN_HANDLED;

}

/*************************************\
***************************************
          Callback de resets
***************************************
\*************************************/
public CallBack (idmenuitem)
    {
    if( 
g_MAX_RANGOS g_Rango id ] )
            return 
ITEM_DISABLED;
        
    return 
ITEM_ENABLED;
    }
/*************************************\
***************************************
Verificamos si no tiene el maximo de 
resets
***************************************
\*************************************/
public Verific(id){
if(
g_rest id ] >= 10 )
{
new 
Names 33 ];
get_user_name(idNamescharsmax(Names)) 
ColorChatid,  "!yLlegaste al !g[ !yMAXIMO DE RESETS !g]")    
log_to_file(ResetMax"El usuarios ( %s ) Llego a la cantidad maxima de resets"Names)
}
else {
    
Menu_Resets id )
}

}

/*************************************\
***************************************
    Opciones del menu
***************************************
\*************************************/
public OpciMen(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        return 
PLUGIN_HANDLED;
    }
    switch(
item)
    {
        case 
0: {
            
g_rest id ]++ 
            
g_Rango id ] = 0
            g_exp 
id ] = 
            client_cmd
(id"mp3 play %s"Reset_up)
            
client_cmd(id"mp3 play sound/%s"Reset_up)
            
ColorChatid"!yHiciste reset ahora tienes !g%d!t/!g10"g_rest id ])

         }
         case 
1: {
            
ColorChatid"!yActualmente tienes !g%d!t/!g10"g_rest id ])
         }
         case 
2: {
             
ColorChatid"!yRango: !g%s"g_Rangos g_Rango id ] ] [ NAME ])
             
ColorChatid"!yExp:!g %d%%"g_exp id ])
            
ColorChatid"!yResets: !g%d!t/!g10"g_rest id ])
            
ColorChatid"!yPor tener esas estadisticas tienes : !g%d !yde !tHP!y y !g%d !yde !tAMMO"g_Rangos g_Rango id ] ] [ HP ], g_Rangos g_Rango id ] ] [ AMMO ])
    }
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}

/*************************************\
***************************************
          Damage x Reset
***************************************
\*************************************/
public DamageRvictiminflictorattackerFloat:damagedamage_bits ) {
  
  if( !
is_user_aliveattacker ) ) 
    return 
HAM_IGNORED;
    
  for( new 
0sizeof Armasi++ ) {
    
    
    if( 
get_user_weaponattacker ) == Armas attacker ][ ] ) {
      
        
      
damage *= ResetDamageg_rest attacker ] ];
    }
  }
  
  
SetHamParamFloat4damage );
  return 
HAM_HANDLED
}

/*************************************\
***************************************
            /GUARDADO/ 
***************************************
\*************************************/
public Guardar(id
{
    if( !
is_user_connected(id)) 
        return;
        
        
    
adv_vault_set_start(g_vault);
    
    
adv_vault_set_field(g_vaultGuardRankg_Rango[id]);
    
adv_vault_set_field(g_vaultGuardExpg_exp[id]);
    
adv_vault_set_field(g_vaultGuardRsg_rest[id]);
    
    
adv_vault_set_end(g_vault0g_nombre[id])
}


/*************************************\
***************************************
            /CARGADO/ 
***************************************
\*************************************/
public Cargar(id
{
    if(!
adv_vault_get_prepare(g_vault_g_nombre[id]))
        return;
    
    
adv_vault_get_field(g_vaultGuardRankg_Rangoid ], sizeof g_Rango[ ]);
    
adv_vault_get_field(g_vaultGuardExpg_expid ], sizeof g_exp[ ]);  
    
adv_vault_get_field(g_vaultGuardRsg_restid ], sizeof g_rest[ ]);      


/*************************************\
***************************************
    /Hook Say/ 
***************************************
\*************************************/

public fw__HookSayid ) {
  
  static 
szData191 ], szAdmin33 ];
  
read_argsszDatacharsmaxszData ) );
  
remove_quotesszData );

  new 
g_szPlayerName 33 ];
  
  
replace_allszDatacharsmaxszData ), "%"" " );
  
replace_allszDatacharsmaxszData ), "#"" " );
  
  if ( !
is_validszData) ) return PLUGIN_CONTINUE;
  
  if ( 
accessidADMIN_RCON ) ) {
    
    
szAdmin "FUNDADOR";
  }
  else if ( 
accessidADMIN_BAN ) ) {
    
    
szAdmin "ADMINISTRADOR";
  }
  else if ( 
accessidADMIN_CHAT ) ) {
  
    
szAdmin "VIP";
  }
  else {
    
    
szAdmin "";
  }
  static 
color11 ], prefix400 ];
  
get_user_teamidcolorcharsmaxcolor ) );
  
get_user_nameidg_szPlayerNameid ], 32 );
  
  
formatexprefixcharsmaxprefix ), "^x01%s ^x04%s [^x03Rank : %s ^x04] [^x03Rs: %d/10 ^x04] ^x03 %s"is_user_aliveid ) ? "" "x04* x01MUERTO x04*"szAdming_Rangosg_Rangoid ] ][ NAME ], g_rest id ], g_szPlayerNameid ] );
  
  if ( 
is_user_adminid ) ) formatszDatacharsmaxszData ), "^x04%s"szData );
  
  
formatszDatacharsmaxszData ), "%s^x01: %s"prefixszData );
    
  static 
iteam11 ];
  for( 
0get_maxplayers( ); i++ )
  {
    if ( !
is_user_connected) ) continue;
    
    if (
is_user_admin) || is_user_aliveid ) && is_user_alive) || !is_user_aliveid ) && !is_user_alive) )
    {
      
get_user_teamiteamcharsmaxteam ) );
      
change__TeamInfo(icolor );
      
writeMessageiszData );
      
change__TeamInfoiteam );
    }
  }
  
  return 
PLUGIN_HANDLED_MAIN;
}

public 
change__TeamInfoplayerteam[ ] )
{
  
message_beginMSG_ONEget_user_msgid"TeamInfo" ), _player );
  
write_byteplayer );
  
write_stringteam );
  
message_end( );
}

stock is_validtext[ ], maxcount ) {
  
  static 
lenicount;
  
len strlentext );
  
count 0;
  
  if ( !
len )
    return 
false;
  
  for ( 
0leni++ ) {
    
    if ( 
text] != ' ' ) {
      
      
count++;
      if ( 
count >= maxcount )
        return 
true;
    }
  }
    
  return 
false;
}

/*************************************\
***************************************
        /STOCK DE CHAT COLOR/ 
***************************************
\*************************************/
stock ColorChat( const id, const Text[ ], any:... ) { 
    
    new 
count 1players32 ];
    static 
msg191 ], leni;
    
    
len formatexmsgcharsmax(msg), "%s "g_Tag );
    
vformatmsglen ], 190 lenText);
    
    
replace_allmsg190"!g""^4" );
    
replace_allmsg190"!y""^1" );
    
replace_allmsg190"!t""^3" );
    
    if(
id
        
players] = id;
    else 
        
get_playersplayerscount"ch" );
             
    for( 
0count; ++i) {
        
        if( 
is_user_connectedplayers] ) ) 
            
writeMessageplayers], msg );    
    }
}

stock writeMessageplayermessage[ ] ) {
    
    
message_beginMSG_ONEget_user_msgid"SayText" ), { 00}, player );
    
write_byteplayer );
    
write_stringmessage );
    
message_end( );

Sinidos:
Sonidos


Last edited by Maickol_22; 11-21-2018 at 22:23.
Maickol_22 is offline
Send a message via ICQ to Maickol_22 Send a message via AIM to Maickol_22 Send a message via Yahoo to Maickol_22
totopizza
AlliedModders Donor
Join Date: Oct 2015
Location: Honduras
Old 11-22-2018 , 00:29   Re: Rank exp and reset
Reply With Quote #2

EN:
In this forum, you must post and comment in English, not in Spanish. If you do not know English, go to the forum created exclusively for users who speak Spanish: https://amxmodx-es.com (you already know it) ...

Es:
En este foro, debes publicar y comentar en inglés, no en español. Si no sabes inglés, ve al foro creado exclusivamente para usuarios que hablan español: https://amxmodx-es.com (ya lo conoces)...
totopizza is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-22-2018 , 13:57   Re: Rank exp and reset
Reply With Quote #3

Another hardcoded rank system.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Maickol_22
BANNED
Join Date: Dec 2015
Location: https://t.me/pump_upp
Old 11-22-2018 , 14:24   Re: Rank exp and reset
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Another hardcoded rank system.

This is only for 100 of each range and increasingly difficult
Maickol_22 is offline
Send a message via ICQ to Maickol_22 Send a message via AIM to Maickol_22 Send a message via Yahoo to Maickol_22
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-22-2018 , 15:38   Re: Rank exp and reset
Reply With Quote #5

Then there's no point of submitting it when it's not different than any of the other hardcoded plugins uploaded here. It's not difficult at all if you're experienced enough.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Maickol_22
BANNED
Join Date: Dec 2015
Location: https://t.me/pump_upp
Old 11-22-2018 , 16:13   Re: Rank exp and reset
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Then there's no point of submitting it when it's not different than any of the other hardcoded plugins uploaded here. It's not difficult at all if you're experienced enough.

I have never seen those ranges, to see you have some similarities?
Maickol_22 is offline
Send a message via ICQ to Maickol_22 Send a message via AIM to Maickol_22 Send a message via Yahoo to Maickol_22
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-24-2018 , 07:33   Re: Rank exp and reset
Reply With Quote #9

Quote:
Originally Posted by Maickol_22 View Post
reset, hp, ammo, damage, difficulty?
https://forums.alliedmods.net/showthread.php?t=308540
https://www.amxx-bg.info/pluginlab/?name=rank
__________________

Last edited by OciXCrom; 11-24-2018 at 07:34.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-07-2020 , 12:09   Re: Rank exp and reset
Reply With Quote #10

Hardcoding configs is not allowed. Better plugins exist.

Unapproved.
__________________
HamletEagle is offline
Reply


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 04:17.


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