SMA:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#define MAXCLASSES 27
new PlayerXP[33];
new PlayerLevel[33];
new PlayerKills[33]
new <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill, g_vault, SaveXP;
new const CLASSES[MAXCLASSES][] = {
"Private",
"Private 1st Class",
"Specialist",
"Corporal",
"Sergant",
"Staff Sergeant",
"Sergeant 1st Class",
"Master Sergeant",
"1st Sergeant",
"Sergeant Major",
"Command Sergeant Major",
"Sergeant Major Of The Army",
"Warrant Officer",
"Chief Warrant Officer[1]",
"Chief Warrant Officer[2]",
"Chief Warrant Officer[3]",
"Master Chief Warrant Officer",
"2nd Lieutenant",
"1st Lieutenant",
"Captian",
"Major",
"Lieutenant Colonel",
"Colonel",
"Brigadier General",
"Major General",
"Lieutenant General",
"General"
};
new const LEVELS[26] = {
25,
50,
75,
100,
150,
200,
250,
300,
400,
500,
600,
800,
1000,
1200,
1400,
1600,
1800,
2000,
2500,
3000,
3500,
4000,
5500,
6000,
7000,
8000
};
public plugin_init()
{
register_plugin("Rank Mod", "1.00", "Robert aka Wicked");
//CVAR line, adds a cvar command to the plugin (on/off)
register_cvar("sv_rankmod", "1");
register_event("DeathMsg", "eDeath", "a");
register_clcmd("say /rank","ShowHud")
register_clcmd("say /resetxp","client_disconnect")
SaveXP = register_cvar("SaveXP","1");
<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill=register_cvar("XP_per_kill", "1");
g_vault = nvault_open("VAULT");
}
public SaveData(id)
{
new AuthID[35];
get_user_authid(id,AuthID,34);
new vaultkey[64],vaultdata[256];
format(vaultkey,63,"%s-Rank Mod",AuthID);
format(vaultdata,255,"%i#%i#%i#",PlayerXP[id],PlayerLevel[id],PlayerKills[id]);
nvault_set(g_vault,vaultkey,vaultdata);
return PLUGIN_CONTINUE;
}
public LoadData(id)
{
new authid[35];
get_user_authid(id,authid,34);
new vaultkey[64],vaultdata[256];
format(vaultkey,63,"%s-Rank Mod",authid);
format(vaultdata,255,"%i#%i#%i#",PlayerXP[id],PlayerLevel[id],PlayerKills[id]);
nvault_get(g_vault,vaultkey,vaultdata,255);
replace_all(vaultdata, 255, "#", " ");
new playerxp[32], playerlevel[32],playerkills[32];
parse(vaultdata, playerxp, 31, playerlevel, 31, playerkills, 31);
PlayerXP[id] = str_to_num(playerxp);
PlayerLevel[id] = str_to_num(playerlevel);
PlayerKills[id] = str_to_num(playerkills);
return PLUGIN_CONTINUE;
}
//Loads Class, Level, and <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' /> connect
public client_connect(id)
{
if(get_pcvar_num(SaveXP) == 1)
{
LoadData(id);
}
}
//Saves <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' /> on disconnect
public client_disconnect(id)
{
if(get_pcvar_num(SaveXP) == 1)
{
SaveData(id);
}
PlayerXP[id] = 0;
PlayerLevel[id] = 0;
PlayerKills[id] = 0;
if(is_user_connected(id))
client_print(id,print_chat,"Saved Data Erased")
}
public eDeath( )
{
new attacker = read_data( 1 )
new <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' /> = get_pcvar_num(<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Kill)
client_print(attacker,print_chat,"You Gained %i <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' /> for your kill!",<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />)
PlayerKills[attacker] += 1
PlayerXP[attacker] += <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />
if(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]])
{
PlayerLevel[attacker] += 1;
client_print(attacker,print_chat,"You have been promoted have a nice day %s ",CLASSES[PlayerLevel[attacker]])
}
ShowHud(attacker);
SaveData(attacker);
}
public ShowHud(id)
{
set_hudmessage(255, 0, 0, 0.75, 0.01, 0, 6.0, 15.0);
show_hudmessage(id, "Rank: %s^nKills: %i^nXP: %i/%i",CLASSES[PlayerLevel[id]],PlayerKills[id],PlayerXP[id],LEVELS[PlayerLevel[id]]);
}
Zmiany jakie chciałbym wprowadzić w tym pluginie:
- zmiana menu, które wyświetla informacje o fragach i ranku w hudzie na czerwono na taki o to mniej więcej pasek (patrz dolny lewy rog na onrazku niżej)

pasek tego pluginu wyglądał by mniej więcej tak : [uS]Fragi: 0/15 Stopień: bleble, no i ewetualnie
- po wpisaniu przykładowo /topranks wyświetla się motd, w którym jest top10/15 graczy którzy mają najwyższy stopień
Na chwilę obecną to wszystko, jeśli jest to do zrobienia to bardzo proszę o pomoc
Pozdrawiam.


Dodatki SourceMod



Temat jest zamknięty









