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

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


Post New Thread Reply   
 
Thread Tools Display Modes
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-15-2017 , 07:30   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #11

Advanced Experience System 0.5 + csstats does what he wants
tarsisd2 is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-15-2017 , 21:33   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #12

Quote:
Originally Posted by DjSoftero View Post
?
you are awesome

kkkkkkkkkkkkkkkkkkkkkkkkkkkk
maicoidalgo is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-15-2017 , 21:35   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #13

Quote:
Originally Posted by tarsisd2 View Post
Advanced Experience System 0.5 + csstats does what he wants
This plugin is not what I'm looking for
maicoidalgo is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-15-2017 , 23:52   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #14

Quote:
Originally Posted by maicoidalgo View Post
This plugin is not what I'm looking for
from what you wrote, it does exactly what you are looking for, maybe just some tweaks, no one its going to make some thing big as the one you are describing for free, thats just too much work
tarsisd2 is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-16-2017 , 10:52   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #15

Quote:
Originally Posted by tarsisd2 View Post
from what you wrote, it does exactly what you are looking for, maybe just some tweaks, no one its going to make some thing big as the one you are describing for free, thats just too much work

help me

This plugin is in error, can you help me?

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.2, 0, 1.0, 1.1, 0.0, 0.0, -1)
	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()
		}
	}
}
maicoidalgo is offline
Famdl
Junior Member
Join Date: Mar 2017
Old 12-16-2017 , 11:01   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #16

Quote:
Originally Posted by maicoidalgo View Post
help me

This plugin is in error, can you help me?
you should say what error in what level(i think it`s in compiling) without knowing any information it`s really hard For anyone to help
Famdl is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-16-2017 , 11:02   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #17

Quote:
Originally Posted by Famdl View Post
you should say what error in what level(i think it`s in compiling) without knowing any information it`s really hard For anyone to help
yes the error and in the compilation
maicoidalgo is offline
Famdl
Junior Member
Join Date: Mar 2017
Old 12-16-2017 , 11:07   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #18

Quote:
Originally Posted by maicoidalgo View Post
yes the error and in the compilation
just copy errors in compile and paste it here!
Famdl is offline
maicoidalgo
Junior Member
Join Date: Nov 2017
Old 12-16-2017 , 12:33   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #19

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.
maicoidalgo is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 12-16-2017 , 13:36   Re: I need an xp plugin + patents + rank + HUD + menu
Reply With Quote #20

1$ and i will make it for you
Ops... i forgot 2 numbers after 1$
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
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 00:01.


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