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

I need an xp plugin + patents + rank + HUD + menu


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-16-2017 , 13:41   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #21

Quote:
Originally Posted by maicoidalgo View Post
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 134
Warning: Loose indentation on line 141
Warning: Loose indentation on line 144
Warning: Tag mismatch on line 177
Header size: 1792 bytes
Code size: 23764 bytes
Data size: 20136 bytes
Stack/heap size: 16384 bytes; estimated max. usage=709 cells (2836 bytes)
Total requirements: 62076 bytes

4 Warnings.
Done.
That's not an error. It's a warning. And you better ignore it because trying to explain why it shows will be impossible for you.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 12-16-2017 , 13:42   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #22

just ignore that warnings as ocix said because they are nonsense warnings ;)
also o_O Welcome to the AMX Mod X 1.8.1-300 Compiler.
__________________

Last edited by D3XT3R; 12-16-2017 at 13:42.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-16-2017 , 13:49   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #23

Quote:
Originally Posted by D3XT3R View Post
just ignore that warnings as ocix said because they are nonsense warnings ;)
also o_O Welcome to the AMX Mod X 1.8.1-300 Compiler.
okay thanks
maicoidalgo is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-16-2017 , 13:49   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #24

Quote:
Originally Posted by OciXCrom View Post
That's not an error. It's a warning. And you better ignore it because trying to explain why it shows will be impossible for you.
okay thanks
maicoidalgo is offline
Famdl
Junior Member
Join Date: Mar 2017
Old 12-16-2017 , 14:01   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #25

Quote:
Originally Posted by maicoidalgo View Post
help me

This plugin is in error, can you help me?
as OciXCrom said They are not so important and plugin would work. specially Loose identation Warnings

but i fixed tag mismatch warning(hud message part) and i`m not able to test it. so test it without Losing your Original plugin
Code:
#include <amxmodx>
// #include <amxmisc>
// #include <cstrike>
// #include <engine>
#include <fakemeta>
#include <nfvault>
#include <dhudmessage>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "Sistema de Patente"
#define VERSION "1.0"
#define AUTHOR  "Hannah"

/*------ Prefix ------*/
new xPrefix [] = "!n[!gNightKillers!n]!t:";

/* Admin Prefix */
#define FLAG_DONO 		ADMIN_LEVEL_C
#define FLAG_MASTER 	ADMIN_LEVEL_D
#define FLAG_SUPREMO 	ADMIN_LEVEL_G
#define FLAG_ADMIN 		ADMIN_LEVEL_B
#define FLAG_VIP  		ADMIN_LEVEL_H
#define FLAG_GIRL  		ADMIN_LEVEL_F

#define AD1 "DONO"
#define AD2 "MASTER"
#define AD3 "SUPREMO"
#define AD4 "ADMIN"
#define AD5 "V.I.P"
#define AD6 "GIRL"

/*------ DATA ------*/
enum _:DATA
{
	Nick[30],
	Frags
}
/*------ Patentes ------*/
new const Rank[][DATA] = 
{
	{ "Prata I", 200 },
	{ "Prata II", 400 },
	{ "Prata III", 600 },
	{ "Prata IV", 800 },
	{ "Prata Elite", 1000 },
	{ "Ouro I", 1200 },
	{ "Ouro II", 1400 },
	{ "Ouro III", 1600 },
	{ "Ouro Mestre",1800 },
	{ "AK I", 2000 },
	{ "AK II", 2500 },
	{ "AK Cruzada", 3000 },
	{ "Aguia I", 3500 },
	{ "Aguia II", 4500 },
	{ "Supremo Master", 7000 },
	{ "Global Elite", 100000 },
	{ "NightKillers Global", 1500000000000000 }
}
/*------ Global ------*/
new g_rank[33];
new g_frags[33];

/*------ Morte ------*/
new cvar_hsx2;
new cvar_knifex2;

/*------ Outros ------*/
new VaultRank[128], szRank[180], szKey[30]
new g_maxplayers, g_msgTeamInfo, g_msgSayText, g_playername[33][32];

/*------ Salvar ------*/
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)

/*------ Plugi-Init ------*/
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	/*------ Patente ------*/
	register_clcmd("say /patente", "szybkie_menu")
	register_clcmd("patente", "cmdPatente")
	register_clcmd("allpatentes", "ShowMotd")
	register_clcmd("say_team /patente", "szybkie_menu")
	register_clcmd("say /patentes", "szybkie_menu")
	register_clcmd("say_team /patentes", "szybkie_menu")
	register_clcmd("say .patente", "szybkie_menu")
	register_clcmd("say_team .patente", "szybkie_menu")
	register_clcmd("say .patentes", "szybkie_menu")
	register_clcmd("say_team .patentes", "szybkie_menu")

	/*--------------------*/
	register_clcmd("say", "message_saytext") 
	register_clcmd("say_team", "message_sayteam")

	/*------ Evento ------*/
	register_event("DeathMsg", "Event_DeathMsg", "a")
	register_logevent("logevent_round_end", 2, "1=Round_End")

	/*------ Quantidade ------*/
	cvar_knifex2 = register_cvar("rank_knifex2", "2")	// 1 - x2 Frags KNIFE | 0 - Nada
	cvar_hsx2 = register_cvar("rank_hsx2", "1")		// 1 - x2 Frags HS | 0 - Nada

	/*------ Outros ------*/
	g_maxplayers = get_maxplayers()
	g_msgTeamInfo = get_user_msgid("TeamInfo")
	g_msgSayText = get_user_msgid("SayText")
	
	nfv_file("SystemRank", VaultRank, charsmax(VaultRank))
}

public cmdPatente(id)
{
	xClientPrintColor(id, "!g-----------------------------------------------------------------------------------------------")
	xClientPrintColor(id, "%s !nPatente: !g%s", xPrefix, Rank[g_rank[id]][Nick])
	xClientPrintColor(id, "%s !nProx Patente: !g%s", xPrefix, Rank[g_rank[id]+1][Nick])
	xClientPrintColor(id, "%s !nXP Restante: !g%d", xPrefix, Rank[g_rank[id]][Frags] -  g_frags[id])
	xClientPrintColor(id, "!g-----------------------------------------------------------------------------------------------")
}
/*=============================================================================================================
================================================== PUTINSERVER ================================================
==============================================================================================================*/
public client_putinserver(id) 
{
	g_rank[id] = 0
	g_frags[id] = 0
	Cargar(id)
	set_task(1.1, "hud_status", id, _, _, "b")
	new player = 0
   
    // Player dead?
    if (!is_user_alive(player))
    {
       
        // Target not alive
        if (!is_user_alive(player))
            return;
    }
     new player_name[32]
     get_user_name(id, player_name, charsmax(player_name))
     xClientPrintColor(0, "!g-----------------------------------------------------------------------------------------------")
	xClientPrintColor(0, "%s !nPlayer: !g%s !nConectado.", xPrefix, player_name)
	xClientPrintColor(0, "%s !nPatente: !g%s !t|| !nProx Patente: !g%s", xPrefix, Rank[g_rank[player]][Nick], Rank[g_rank[player]+1][Nick])
	xClientPrintColor(0, "%s !nXP Restante: !g%d", xPrefix, Rank[g_rank[player]][Frags] -  g_frags[player])
	xClientPrintColor(0, "!g-----------------------------------------------------------------------------------------------")
}

public ShowMotd(id)
{
	show_motd(id, "allpatentes.txt")
}

/*==============================================================================================================
==================================================== GUARDAR ===================================================
==============================================================================================================*/
public client_disconnect(id) 
{
	if(XD) Guardar(id);
}

public logevent_round_end() 
{
	for(new id = 1; id <= g_maxplayers; id++) 
	{
		if(XD) 
			Guardar(id); 
	}
}
public hud_status(id)
{
	if(!is_user_alive(id) ||  !is_user_connected(id) )
		return;
	set_dhudmessage( random(255), random(255), random(255), 0.02, 0.25, 0, 1.0, 1.0, 0.0, 0.0 );
	show_dhudmessage(id,"» NightKillers 4Fun^n» Patente: %s^n» Prox Patente: %s^n» XP Restante: %d", Rank[g_rank[id]][Nick], Rank[g_rank[id]+1][Nick], Rank[g_rank[id]][Frags] -  g_frags[id]);
}
public szybkie_menu(id)
{
new menu = menu_create("\r» \yNigthKillerS \w| Menu Patentes:^n» \yPatentes by Maico.", "menu_wybierz")
menu_additem(menu, "\r» \wVisualizar Sua Patente\y.", "1", 0)
menu_additem(menu, "\r» \wHUD Patente: \d|\yDESATIVAR\d|", "2", 0)
menu_additem(menu, "\r» \wLista de Patentes \y+ \wInformacoes", "3", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public menu_wybierz(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1 : client_cmd(id,"patente")
case 2 : remove_task(id)
case 3 : client_cmd(id,"allpatentes")
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

/*==============================================================================================================
==================================================== UP RANK ===================================================
==============================================================================================================*/
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(hs) g_frags[attacker]++
		}
		AumentarRank(attacker)
	}
}

/*==============================================================================================================
==================================================== UP RANK ===================================================
==============================================================================================================*/
AumentarRank(id) 
{    
	new Aumento = false
    
	while(g_frags[id] >= Rank[g_rank[id]][Frags]) 
	{
		Aumento = true
		g_rank[id]++
	}
		
	if(Aumento) {
		xClientPrintColor(id, "%s !nUP Patente: !g%s", xPrefix, Rank[g_rank[id]][Nick])
		Aumento = false
	}
} 

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

	if (!ValidMessage(said, 1)) 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 = "*MORTO* "
	}

	if (is_user_admin(id)) {
		if (get_user_flags(id) & FLAG_DONO) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD1, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_MASTER) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD2, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_SUPREMO) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD3, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_ADMIN) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD4, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_VIP) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD5, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_GIRL) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD6, Rank[g_rank[id]][Nick], name, said)
	} else {
		format(said, charsmax(said), "^x01%s^x01[^x04%s^x01] ^x03%s: ^x01%s", alive, Rank[g_rank[id]][Nick], name, said)
	}
    
	static i, team[11] 
	for (i = 1; i <= g_maxplayers; i++) {
		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(i, team, charsmax(team))
			changeTeamInfo(i, color)
			writeMessage(i, said)
			changeTeamInfo(i, team)
		}
	}
	return PLUGIN_HANDLED_MAIN;
}

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

	if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; 
    
	static playerTeam, playerTeamName[19]
	playerTeam = get_user_team(id)
    
	switch (playerTeam) {
		case 1: copy(playerTeamName, 11, "TR")
                case 2: copy(playerTeamName, 18, "CT")
                default: copy(playerTeamName, 9, "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 = "*MORTO* "
	}

	if (is_user_admin(id)) {
		if (get_user_flags(id) & FLAG_DONO) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD1, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_MASTER) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD2, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_SUPREMO) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD3, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_ADMIN) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD4, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_VIP) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD5, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_GIRL) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD6, Rank[g_rank[id]][Nick], name, said)
	} else {
		format(said, charsmax(said), "^x01%s -%s ^x01(^x04%s^x01) ^x03%s: ^x01%s", alive, playerTeam, Rank[g_rank[id]][Nick], name, said)
	}

	static i, team[11] 
	for (i = 1; i <= g_maxplayers; i++) {
		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(i, team, charsmax(team))
				changeTeamInfo(i, color)
				writeMessage(i, said)
				changeTeamInfo(i, team)
			}
		}
	}
	return PLUGIN_HANDLED_MAIN;
}
public changeTeamInfo(player, team[]) {
	message_begin(MSG_ONE, g_msgTeamInfo, _, player)
	write_byte(player)
	write_string(team)
	message_end()
}




public writeMessage(player, message[]) {
	message_begin(MSG_ONE, g_msgSayText, {0, 0, 0}, player)
	write_byte(player)
	write_string(message)
	message_end()
}
/*==============================================================================================================
==================================================== SALVAR ====================================================
==============================================================================================================*/
Guardar(id) 
{
	formatex(szKey, charsmax(szKey), "data_ranks") 
	formatex(szRank, charsmax(szRank), "%d %d", g_frags[id], g_rank[id])
    
	nfv_set_data(VaultRank, szKey, g_playername[id], szRank)
}

Cargar(id) {
	new g_load_c1[25], g_load_c2[25]
	formatex(szKey, charsmax(szKey), "data_ranks") 
    
	if(!nfv_get_data(VaultRank, szKey, g_playername[id], szRank, sizeof(szRank) - 1)) return; 
   
	parse(szRank, g_load_c1, charsmax(g_load_c1), g_load_c2, charsmax(g_load_c2))
	
	g_frags[id] = str_to_num(g_load_c1)
	g_rank[id] = str_to_num(g_load_c2)
} 

/*==============================================================================================================
============================================== VERIFICAR MENSAGEM ==============================================
==============================================================================================================*/

stock ValidMessage(text[], maxcount) 
{
	static len, i, count
	len = strlen(text)
	count = 0
    
	if (!len)
		return false;
    
	for (i = 0; i < len; i++) 
	{
		if (text[i] != ' ') 
		{
			count++
			if (count >= maxcount)
				return true;
		}
	}
	return false;
}

stock is_user_admin(id)
{
    new __flags=get_user_flags(id);
    return (__flags>0 && !(__flags&ADMIN_USER));
}

/*==============================================================================================================
===================================================== COLOR ====================================================
==============================================================================================================*/
stock xClientPrintColor(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!n", "^1")
	replace_all(msg, 190, "!t", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")

	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i])
			write_string(msg)
			message_end()
		}
	}
}

Last edited by Famdl; 12-16-2017 at 14:02.
Famdl is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-16-2017 , 16:46   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #26

Quote:
Originally Posted by D3XT3R View Post
just ignore that warnings as ocix said because they are nonsense warnings ;)
also o_O Welcome to the AMX Mod X 1.8.1-300 Compiler.
1.8.1 really?
tarsisd2 is offline
Old 12-17-2017, 10:36
DjSoftero
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
Old 12-17-2017, 11:49
D3XT3R
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
Old 12-17-2017, 12:11
DjSoftero
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
Old 12-17-2017, 12:25
D3XT3R
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-17-2017 , 14:34   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #27

Quote:
Originally Posted by Famdl View Post
as OciXCrom said They are not so important and plugin would work. specially Loose identation Warnings

but i fixed tag mismatch warning(hud message part) and i`m not able to test it. so test it without Losing your Original plugin
Code:
#include <amxmodx>
// #include <amxmisc>
// #include <cstrike>
// #include <engine>
#include <fakemeta>
#include <nfvault>
#include <dhudmessage>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "Sistema de Patente"
#define VERSION "1.0"
#define AUTHOR  "Hannah"

/*------ Prefix ------*/
new xPrefix [] = "!n[!gNightKillers!n]!t:";

/* Admin Prefix */
#define FLAG_DONO 		ADMIN_LEVEL_C
#define FLAG_MASTER 	ADMIN_LEVEL_D
#define FLAG_SUPREMO 	ADMIN_LEVEL_G
#define FLAG_ADMIN 		ADMIN_LEVEL_B
#define FLAG_VIP  		ADMIN_LEVEL_H
#define FLAG_GIRL  		ADMIN_LEVEL_F

#define AD1 "DONO"
#define AD2 "MASTER"
#define AD3 "SUPREMO"
#define AD4 "ADMIN"
#define AD5 "V.I.P"
#define AD6 "GIRL"

/*------ DATA ------*/
enum _:DATA
{
	Nick[30],
	Frags
}
/*------ Patentes ------*/
new const Rank[][DATA] = 
{
	{ "Prata I", 200 },
	{ "Prata II", 400 },
	{ "Prata III", 600 },
	{ "Prata IV", 800 },
	{ "Prata Elite", 1000 },
	{ "Ouro I", 1200 },
	{ "Ouro II", 1400 },
	{ "Ouro III", 1600 },
	{ "Ouro Mestre",1800 },
	{ "AK I", 2000 },
	{ "AK II", 2500 },
	{ "AK Cruzada", 3000 },
	{ "Aguia I", 3500 },
	{ "Aguia II", 4500 },
	{ "Supremo Master", 7000 },
	{ "Global Elite", 100000 },
	{ "NightKillers Global", 1500000000000000 }
}
/*------ Global ------*/
new g_rank[33];
new g_frags[33];

/*------ Morte ------*/
new cvar_hsx2;
new cvar_knifex2;

/*------ Outros ------*/
new VaultRank[128], szRank[180], szKey[30]
new g_maxplayers, g_msgTeamInfo, g_msgSayText, g_playername[33][32];

/*------ Salvar ------*/
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)

/*------ Plugi-Init ------*/
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	/*------ Patente ------*/
	register_clcmd("say /patente", "szybkie_menu")
	register_clcmd("patente", "cmdPatente")
	register_clcmd("allpatentes", "ShowMotd")
	register_clcmd("say_team /patente", "szybkie_menu")
	register_clcmd("say /patentes", "szybkie_menu")
	register_clcmd("say_team /patentes", "szybkie_menu")
	register_clcmd("say .patente", "szybkie_menu")
	register_clcmd("say_team .patente", "szybkie_menu")
	register_clcmd("say .patentes", "szybkie_menu")
	register_clcmd("say_team .patentes", "szybkie_menu")

	/*--------------------*/
	register_clcmd("say", "message_saytext") 
	register_clcmd("say_team", "message_sayteam")

	/*------ Evento ------*/
	register_event("DeathMsg", "Event_DeathMsg", "a")
	register_logevent("logevent_round_end", 2, "1=Round_End")

	/*------ Quantidade ------*/
	cvar_knifex2 = register_cvar("rank_knifex2", "2")	// 1 - x2 Frags KNIFE | 0 - Nada
	cvar_hsx2 = register_cvar("rank_hsx2", "1")		// 1 - x2 Frags HS | 0 - Nada

	/*------ Outros ------*/
	g_maxplayers = get_maxplayers()
	g_msgTeamInfo = get_user_msgid("TeamInfo")
	g_msgSayText = get_user_msgid("SayText")
	
	nfv_file("SystemRank", VaultRank, charsmax(VaultRank))
}

public cmdPatente(id)
{
	xClientPrintColor(id, "!g-----------------------------------------------------------------------------------------------")
	xClientPrintColor(id, "%s !nPatente: !g%s", xPrefix, Rank[g_rank[id]][Nick])
	xClientPrintColor(id, "%s !nProx Patente: !g%s", xPrefix, Rank[g_rank[id]+1][Nick])
	xClientPrintColor(id, "%s !nXP Restante: !g%d", xPrefix, Rank[g_rank[id]][Frags] -  g_frags[id])
	xClientPrintColor(id, "!g-----------------------------------------------------------------------------------------------")
}
/*=============================================================================================================
================================================== PUTINSERVER ================================================
==============================================================================================================*/
public client_putinserver(id) 
{
	g_rank[id] = 0
	g_frags[id] = 0
	Cargar(id)
	set_task(1.1, "hud_status", id, _, _, "b")
	new player = 0
   
    // Player dead?
    if (!is_user_alive(player))
    {
       
        // Target not alive
        if (!is_user_alive(player))
            return;
    }
     new player_name[32]
     get_user_name(id, player_name, charsmax(player_name))
     xClientPrintColor(0, "!g-----------------------------------------------------------------------------------------------")
	xClientPrintColor(0, "%s !nPlayer: !g%s !nConectado.", xPrefix, player_name)
	xClientPrintColor(0, "%s !nPatente: !g%s !t|| !nProx Patente: !g%s", xPrefix, Rank[g_rank[player]][Nick], Rank[g_rank[player]+1][Nick])
	xClientPrintColor(0, "%s !nXP Restante: !g%d", xPrefix, Rank[g_rank[player]][Frags] -  g_frags[player])
	xClientPrintColor(0, "!g-----------------------------------------------------------------------------------------------")
}

public ShowMotd(id)
{
	show_motd(id, "allpatentes.txt")
}

/*==============================================================================================================
==================================================== GUARDAR ===================================================
==============================================================================================================*/
public client_disconnect(id) 
{
	if(XD) Guardar(id);
}

public logevent_round_end() 
{
	for(new id = 1; id <= g_maxplayers; id++) 
	{
		if(XD) 
			Guardar(id); 
	}
}
public hud_status(id)
{
	if(!is_user_alive(id) ||  !is_user_connected(id) )
		return;
	set_dhudmessage( random(255), random(255), random(255), 0.02, 0.25, 0, 1.0, 1.0, 0.0, 0.0 );
	show_dhudmessage(id,"» NightKillers 4Fun^n» Patente: %s^n» Prox Patente: %s^n» XP Restante: %d", Rank[g_rank[id]][Nick], Rank[g_rank[id]+1][Nick], Rank[g_rank[id]][Frags] -  g_frags[id]);
}
public szybkie_menu(id)
{
new menu = menu_create("\r» \yNigthKillerS \w| Menu Patentes:^n» \yPatentes by Maico.", "menu_wybierz")
menu_additem(menu, "\r» \wVisualizar Sua Patente\y.", "1", 0)
menu_additem(menu, "\r» \wHUD Patente: \d|\yDESATIVAR\d|", "2", 0)
menu_additem(menu, "\r» \wLista de Patentes \y+ \wInformacoes", "3", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public menu_wybierz(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1 : client_cmd(id,"patente")
case 2 : remove_task(id)
case 3 : client_cmd(id,"allpatentes")
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

/*==============================================================================================================
==================================================== UP RANK ===================================================
==============================================================================================================*/
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(hs) g_frags[attacker]++
		}
		AumentarRank(attacker)
	}
}

/*==============================================================================================================
==================================================== UP RANK ===================================================
==============================================================================================================*/
AumentarRank(id) 
{    
	new Aumento = false
    
	while(g_frags[id] >= Rank[g_rank[id]][Frags]) 
	{
		Aumento = true
		g_rank[id]++
	}
		
	if(Aumento) {
		xClientPrintColor(id, "%s !nUP Patente: !g%s", xPrefix, Rank[g_rank[id]][Nick])
		Aumento = false
	}
} 

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

	if (!ValidMessage(said, 1)) 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 = "*MORTO* "
	}

	if (is_user_admin(id)) {
		if (get_user_flags(id) & FLAG_DONO) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD1, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_MASTER) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD2, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_SUPREMO) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD3, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_ADMIN) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD4, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_VIP) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD5, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_GIRL) 
			format(said, charsmax(said), "^x01%s^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, AD6, Rank[g_rank[id]][Nick], name, said)
	} else {
		format(said, charsmax(said), "^x01%s^x01[^x04%s^x01] ^x03%s: ^x01%s", alive, Rank[g_rank[id]][Nick], name, said)
	}
    
	static i, team[11] 
	for (i = 1; i <= g_maxplayers; i++) {
		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(i, team, charsmax(team))
			changeTeamInfo(i, color)
			writeMessage(i, said)
			changeTeamInfo(i, team)
		}
	}
	return PLUGIN_HANDLED_MAIN;
}

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

	if (!ValidMessage(said, 1)) return PLUGIN_CONTINUE; 
    
	static playerTeam, playerTeamName[19]
	playerTeam = get_user_team(id)
    
	switch (playerTeam) {
		case 1: copy(playerTeamName, 11, "TR")
                case 2: copy(playerTeamName, 18, "CT")
                default: copy(playerTeamName, 9, "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 = "*MORTO* "
	}

	if (is_user_admin(id)) {
		if (get_user_flags(id) & FLAG_DONO) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD1, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_MASTER) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD2, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_SUPREMO) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD3, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_ADMIN) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD4, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_VIP) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD5, Rank[g_rank[id]][Nick], name, said)
		else if (get_user_flags(id) & FLAG_GIRL) 
			format(said, charsmax(said), "^x01%s -%s ^x01[^x03%s^x01] ^x01[^x04%s^x01] ^x03%s: ^x04%s", alive, playerTeam, AD6, Rank[g_rank[id]][Nick], name, said)
	} else {
		format(said, charsmax(said), "^x01%s -%s ^x01(^x04%s^x01) ^x03%s: ^x01%s", alive, playerTeam, Rank[g_rank[id]][Nick], name, said)
	}

	static i, team[11] 
	for (i = 1; i <= g_maxplayers; i++) {
		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(i, team, charsmax(team))
				changeTeamInfo(i, color)
				writeMessage(i, said)
				changeTeamInfo(i, team)
			}
		}
	}
	return PLUGIN_HANDLED_MAIN;
}
public changeTeamInfo(player, team[]) {
	message_begin(MSG_ONE, g_msgTeamInfo, _, player)
	write_byte(player)
	write_string(team)
	message_end()
}




public writeMessage(player, message[]) {
	message_begin(MSG_ONE, g_msgSayText, {0, 0, 0}, player)
	write_byte(player)
	write_string(message)
	message_end()
}
/*==============================================================================================================
==================================================== SALVAR ====================================================
==============================================================================================================*/
Guardar(id) 
{
	formatex(szKey, charsmax(szKey), "data_ranks") 
	formatex(szRank, charsmax(szRank), "%d %d", g_frags[id], g_rank[id])
    
	nfv_set_data(VaultRank, szKey, g_playername[id], szRank)
}

Cargar(id) {
	new g_load_c1[25], g_load_c2[25]
	formatex(szKey, charsmax(szKey), "data_ranks") 
    
	if(!nfv_get_data(VaultRank, szKey, g_playername[id], szRank, sizeof(szRank) - 1)) return; 
   
	parse(szRank, g_load_c1, charsmax(g_load_c1), g_load_c2, charsmax(g_load_c2))
	
	g_frags[id] = str_to_num(g_load_c1)
	g_rank[id] = str_to_num(g_load_c2)
} 

/*==============================================================================================================
============================================== VERIFICAR MENSAGEM ==============================================
==============================================================================================================*/

stock ValidMessage(text[], maxcount) 
{
	static len, i, count
	len = strlen(text)
	count = 0
    
	if (!len)
		return false;
    
	for (i = 0; i < len; i++) 
	{
		if (text[i] != ' ') 
		{
			count++
			if (count >= maxcount)
				return true;
		}
	}
	return false;
}

stock is_user_admin(id)
{
    new __flags=get_user_flags(id);
    return (__flags>0 && !(__flags&ADMIN_USER));
}

/*==============================================================================================================
===================================================== COLOR ====================================================
==============================================================================================================*/
stock xClientPrintColor(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, "!g", "^4")
	replace_all(msg, 190, "!n", "^1")
	replace_all(msg, 190, "!t", "^3")
	
	if (id) players[0] = id; else get_players(players, count, "ch")

	for (new i = 0; i < count; i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
			write_byte(players[i])
			write_string(msg)
			message_end()
		}
	}
}

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Invalid function or declaration on line 17
Error: Invalid function or declaration on line 20
Error: Invalid function or declaration on line 35
Error: Invalid function or declaration on line 41
Error: Invalid function or declaration on line 62
Error: Invalid function or declaration on line 66
Error: Invalid function or declaration on line 70
Error: Invalid function or declaration on line 74
Error: Invalid function or declaration on line 77
Error: Invalid expression, assumed zero on line 80
Error: Undefined symbol "Patente" on line 82
Error: Invalid expression, assumed zero on line 92
Error: Invalid expression, assumed zero on line 94
Error: Invalid expression, assumed zero on line 96
Error: Undefined symbol "Evento" on line 98
Error: Invalid expression, assumed zero on line 100
Error: Undefined symbol "Quantidade" on line 102
Error: Undefined symbol "cvar_hsx2" on line 104
Error: Invalid expression, assumed zero on line 104
Error: Undefined symbol "Outros" on line 106
Error: Too many error messages on one line on line 106

Compilation aborted.
21 Errors.
Could not locate output file C:\Users\maico\Desktop\Amx Studio\Untitled.amx (compile failed).
maicoidalgo is offline
Old 12-17-2017, 17:33
DjSoftero
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
Old 12-18-2017, 01:34
D3XT3R
This message has been deleted by Seta00. Reason: Always be respectful to other members. https://forums.alliedmods.net/misc.php?do=showrules
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-18-2017 , 06:31   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #28

Quote:
Originally Posted by DjSoftero View Post
Then why don`t you do it for free?
Because I'm not obligated to? I actually have created this kind of Level System for HSK BaseBuilder a week ago.

Quote:
Originally Posted by D3XT3R View Post
1$ and i will make it for you
Ops... i forgot 2 numbers after 1$
Dexter son why u do dis u lil prick
__________________
edon1337 is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 12-18-2017 , 10:30   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #29

Quote:
Originally Posted by edon1337 View Post
Because I'm not obligated to? I actually have created this kind of Level System for HSK BaseBuilder a week ago.



Dexter son why u do dis u lil prick
... just i dont understand your language dad
read this and then start talk me dad http://www.langports.com/100-things-...-your-english/
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-18-2017 , 11:15   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #30

Quote:
Originally Posted by edon1337 View Post
Because I'm not obligated to? I actually have created this kind of Level System for HSK BaseBuilder a week ago.
I was just providing him a choice.

Quote:
Originally Posted by D3XT3R View Post
... just i dont understand your language dad
read this and then start talk me dad http://www.langports.com/100-things-...-your-english/
Read this crap yourself.
__________________
retired chump
DjSoftero is offline
Reply



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 20:28.


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