Editare level plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

10 Oct 2019, 19:57

Salut , poate cineva sa faca ca acele culori de la Nume,rank,status,kill sa fie rainbow? Adica sa se schimbe in rosu,verde,albastru etc.. cat mai multe culori
Si sa ca atunci cand un player avanseaza cate un rank sa le arate la toti playerii [NUME PLAYER] a avansat la rank-ul [ ... ] adica cel urmator dupa cel precedent . Adica trece un level.. intelegeti voi.
| Afiseaza codul
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fun>

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.0",
	AUTHOR[] = "scosmyn";

#define MAX_LEVELS	22

new const Kills[MAX_LEVELS] =
{
	0,
	50,
	100,
	160,
	220,
	290,
	370,
	420,
	500,
	580,
	640,
	690,
	760,
	810,
	850,
	900,
	950,
	1005,
	1030,
	1070,
	1115,
	1250
}

new const szTag[MAX_LEVELS][] =
{
	"",
	"*INCEPATOR*",
	"Silver 2",
	"Silver 3",
	"Silver IV",
	"Silver Elite",
	"Silver Elite Master",
	"Gold Nova 1",
	"Gold Nova 2",
	"Gold Nova 3",
	"Gold Nova IV",
	"Gold Nova Elite",
	"Gold Nova Elite Master",
	"Master Guardian 1",
	"Master Guardian 2",
	"Master Guardian 3",
	"Master Guardian IV",
	"Master Guardian Disthingued",
	"Legendary Eagle ",
	"Supreme Master",
	"LORD [X]",
	"KING <3"
}

new Level[33],Kill[33],szName[32],g_vault,g_sync
new pcvar_hs,pcvar_kill,pcvar_knife,pcvar_he,pcvar_efect,pcvar_r,pcvar_g,pcvar_b,pcvar_hp_lvl,pcvar_ap_lvl

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_event("DeathMsg","ev_msg","a")
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	pcvar_hs = register_cvar("cvar_hs_bonus","2")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","1")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")
	pcvar_hp_lvl = register_cvar("cvar_hp_lvl","0")
	pcvar_ap_lvl = register_cvar("cvar_ap_lvl","0")
	
	g_vault = nvault_open("simple_lvl_mod")
	g_sync = CreateHudSyncObj()
	
	if(g_vault == INVALID_HANDLE)
		set_fail_state("Eroare la deschiderea bazei de date din vault.")
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))
		return HAM_HANDLED
	
	if(Level[id] < 1)
		Level[id] = 1

	set_user_health(id,get_user_health(id) + get_pcvar_num(pcvar_hp_lvl) * Level[id])
	set_user_armor(id,get_user_armor(id) + get_pcvar_num(pcvar_ap_lvl) * Level[id])
	return HAM_HANDLED
}

public ev_msg( ) {
	static kiler; 	kiler = read_data(1)
	static hs; 		hs = read_data(3)
	
	if(kiler == read_data(2) || !is_user_alive(kiler))
		return

	if(hs)
		Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else
		Kill[kiler]+= get_pcvar_num(pcvar_kill)
	
	if(get_user_weapon(kiler) == CSW_KNIFE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_knife)
	if(get_user_weapon(kiler) == CSW_HEGRENADE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_he)

	if(Level[kiler] < MAX_LEVELS)
	{
		while(Kill[kiler] >= Kills[Level[kiler]])
		{
			Level[kiler]++
			color(kiler,"!teamFelicitari,ai ajuns la level %i (!g%s!team).",Level[kiler],szTag[Level[kiler]])
			screen_fade(kiler, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			return
		}
	}
	SaveData(kiler)
}

public client_putinserver(id) {
	if(!is_user_bot(id))
	{
		LoadData(id)
		set_task(1.0,"show_hud",id+0x4332,_,_,"b")
	}
}

public client_disconnect(id) {
	remove_task(id+0x4332)
	SaveData(id)
}

public show_hud(id) {
	id-=0x4332
	get_user_name(id,szName,charsmax(szName))

	if(is_user_alive(id))
	{
		set_hudmessage(0, 255, 0, 0.15, 0.01, 0, 6.0, 12.0)
		ShowSyncHudMsg(id,g_sync,"Nume: %s^nRank: %d^nStatus: %s^nKilluri: %i/%i.",szName,Level[id],szTag[Level[id]],Kill[id],Kills[Level[id]])
	}
}

public SaveData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_set(g_vault,vaultkey,vaultdata)
}

public LoadData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	replace_all(vaultdata, 255, "#", " ")

	new kill[32],level[32]
	parse(vaultdata, kill, 31, level, 31)
	Kill[id] = str_to_num(kill)
	Level[id] = str_to_num(level)
}
public plugin_end() nvault_close(g_vault)
stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}

stock seconds_to_units(time)
{
   return((1 << 12) * (time))
}

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	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( );
			}
		}
	}
}
Multumesc. <3
@IONUTZ
Membru, skill +1
Membru, skill +1
Posts: 286
Joined: 17 Dec 2017, 23:11
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 5 times
Been thanked: 14 times

10 Oct 2019, 20:41

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fun>

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.0",
	AUTHOR[] = "scosmyn";

#define MAX_LEVELS	22

new const Kills[MAX_LEVELS] =
{
	0,
	50,
	100,
	160,
	220,
	290,
	370,
	420,
	500,
	580,
	640,
	690,
	760,
	810,
	850,
	900,
	950,
	1005,
	1030,
	1070,
	1115,
	1250
}

new const szTag[MAX_LEVELS][] =
{
	"",
	"*INCEPATOR*",
	"Silver 2",
	"Silver 3",
	"Silver IV",
	"Silver Elite",
	"Silver Elite Master",
	"Gold Nova 1",
	"Gold Nova 2",
	"Gold Nova 3",
	"Gold Nova IV",
	"Gold Nova Elite",
	"Gold Nova Elite Master",
	"Master Guardian 1",
	"Master Guardian 2",
	"Master Guardian 3",
	"Master Guardian IV",
	"Master Guardian Disthingued",
	"Legendary Eagle ",
	"Supreme Master",
	"LORD [X]",
	"KING <3"
}

new Level[33],Kill[33],szName[32],g_vault,g_sync
new pcvar_hs,pcvar_kill,pcvar_knife,pcvar_he,pcvar_efect,pcvar_r,pcvar_g,pcvar_b,pcvar_hp_lvl,pcvar_ap_lvl

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_event("DeathMsg","ev_msg","a")
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	pcvar_hs = register_cvar("cvar_hs_bonus","2")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","1")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")
	pcvar_hp_lvl = register_cvar("cvar_hp_lvl","0")
	pcvar_ap_lvl = register_cvar("cvar_ap_lvl","0")
	
	g_vault = nvault_open("simple_lvl_mod")
	g_sync = CreateHudSyncObj()
	
	if(g_vault == INVALID_HANDLE)
		set_fail_state("Eroare la deschiderea bazei de date din vault.")
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))
		return HAM_HANDLED
	
	if(Level[id] < 1)
		Level[id] = 1

	set_user_health(id,get_user_health(id) + get_pcvar_num(pcvar_hp_lvl) * Level[id])
	set_user_armor(id,get_user_armor(id) + get_pcvar_num(pcvar_ap_lvl) * Level[id])
	return HAM_HANDLED
}

public ev_msg( ) {
	static kiler; 	kiler = read_data(1)
	static hs; 		hs = read_data(3)
	
	if(kiler == read_data(2) || !is_user_alive(kiler))
		return

	if(hs)
		Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else
		Kill[kiler]+= get_pcvar_num(pcvar_kill)
	
	if(get_user_weapon(kiler) == CSW_KNIFE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_knife)
	if(get_user_weapon(kiler) == CSW_HEGRENADE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_he)

	if(Level[kiler] < MAX_LEVELS)
	{
		while(Kill[kiler] >= Kills[Level[kiler]])
		{
			Level[kiler]++
			color(0,"!teamFelicitari,ai ajuns la level %i (!g%s!team).",Level[kiler],szTag[Level[kiler]])
			screen_fade(kiler, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			return
		}
	}
	SaveData(kiler)
}

public client_putinserver(id) {
	if(!is_user_bot(id))
	{
		LoadData(id)
		set_task(1.0,"show_hud",id+0x4332,_,_,"b")
	}
}

public client_disconnect(id) {
	remove_task(id+0x4332)
	SaveData(id)
}

public show_hud(id) {
	id-=0x4332
	get_user_name(id,szName,charsmax(szName))

	if(is_user_alive(id))
	{
		set_hudmessage(random_num(0, 50), random_num(0, 50), random_num(0, 50), 0.15, 0.01, 0, 6.0, 12.0)
		ShowSyncHudMsg(id,g_sync,"Nume: %s^nRank: %d^nStatus: %s^nKilluri: %i/%i.",szName,Level[id],szTag[Level[id]],Kill[id],Kills[Level[id]])
	}
}

public SaveData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_set(g_vault,vaultkey,vaultdata)
}

public LoadData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	replace_all(vaultdata, 255, "#", " ")

	new kill[32],level[32]
	parse(vaultdata, kill, 31, level, 31)
	Kill[id] = str_to_num(kill)
	Level[id] = str_to_num(level)
}
public plugin_end() nvault_close(g_vault)
stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}

stock seconds_to_units(time)
{
   return((1 << 12) * (time))
}

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	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( );
			}
		}
	}
}
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

10 Oct 2019, 20:48

@IONUTZ wrote:
10 Oct 2019, 20:41

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fun>

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.0",
	AUTHOR[] = "scosmyn";

#define MAX_LEVELS	22

new const Kills[MAX_LEVELS] =
{
	0,
	50,
	100,
	160,
	220,
	290,
	370,
	420,
	500,
	580,
	640,
	690,
	760,
	810,
	850,
	900,
	950,
	1005,
	1030,
	1070,
	1115,
	1250
}

new const szTag[MAX_LEVELS][] =
{
	"",
	"*INCEPATOR*",
	"Silver 2",
	"Silver 3",
	"Silver IV",
	"Silver Elite",
	"Silver Elite Master",
	"Gold Nova 1",
	"Gold Nova 2",
	"Gold Nova 3",
	"Gold Nova IV",
	"Gold Nova Elite",
	"Gold Nova Elite Master",
	"Master Guardian 1",
	"Master Guardian 2",
	"Master Guardian 3",
	"Master Guardian IV",
	"Master Guardian Disthingued",
	"Legendary Eagle ",
	"Supreme Master",
	"LORD [X]",
	"KING <3"
}

new Level[33],Kill[33],szName[32],g_vault,g_sync
new pcvar_hs,pcvar_kill,pcvar_knife,pcvar_he,pcvar_efect,pcvar_r,pcvar_g,pcvar_b,pcvar_hp_lvl,pcvar_ap_lvl

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_event("DeathMsg","ev_msg","a")
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	pcvar_hs = register_cvar("cvar_hs_bonus","2")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","1")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")
	pcvar_hp_lvl = register_cvar("cvar_hp_lvl","0")
	pcvar_ap_lvl = register_cvar("cvar_ap_lvl","0")
	
	g_vault = nvault_open("simple_lvl_mod")
	g_sync = CreateHudSyncObj()
	
	if(g_vault == INVALID_HANDLE)
		set_fail_state("Eroare la deschiderea bazei de date din vault.")
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))
		return HAM_HANDLED
	
	if(Level[id] < 1)
		Level[id] = 1

	set_user_health(id,get_user_health(id) + get_pcvar_num(pcvar_hp_lvl) * Level[id])
	set_user_armor(id,get_user_armor(id) + get_pcvar_num(pcvar_ap_lvl) * Level[id])
	return HAM_HANDLED
}

public ev_msg( ) {
	static kiler; 	kiler = read_data(1)
	static hs; 		hs = read_data(3)
	
	if(kiler == read_data(2) || !is_user_alive(kiler))
		return

	if(hs)
		Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else
		Kill[kiler]+= get_pcvar_num(pcvar_kill)
	
	if(get_user_weapon(kiler) == CSW_KNIFE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_knife)
	if(get_user_weapon(kiler) == CSW_HEGRENADE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_he)

	if(Level[kiler] < MAX_LEVELS)
	{
		while(Kill[kiler] >= Kills[Level[kiler]])
		{
			Level[kiler]++
			color(0,"!teamFelicitari,ai ajuns la level %i (!g%s!team).",Level[kiler],szTag[Level[kiler]])
			screen_fade(kiler, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			return
		}
	}
	SaveData(kiler)
}

public client_putinserver(id) {
	if(!is_user_bot(id))
	{
		LoadData(id)
		set_task(1.0,"show_hud",id+0x4332,_,_,"b")
	}
}

public client_disconnect(id) {
	remove_task(id+0x4332)
	SaveData(id)
}

public show_hud(id) {
	id-=0x4332
	get_user_name(id,szName,charsmax(szName))

	if(is_user_alive(id))
	{
		set_hudmessage(random_num(0, 50), random_num(0, 50), random_num(0, 50), 0.15, 0.01, 0, 6.0, 12.0)
		ShowSyncHudMsg(id,g_sync,"Nume: %s^nRank: %d^nStatus: %s^nKilluri: %i/%i.",szName,Level[id],szTag[Level[id]],Kill[id],Kills[Level[id]])
	}
}

public SaveData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_set(g_vault,vaultkey,vaultdata)
}

public LoadData(id)
{
	new name[32],vaultkey[64],vaultdata[256]
	get_user_name(id,name,charsmax(name))
	formatex(vaultkey,63,"%s-Mod",name)
	formatex(vaultdata,255,"%i#%i#",Kill[id],Level[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	replace_all(vaultdata, 255, "#", " ")

	new kill[32],level[32]
	parse(vaultdata, kill, 31, level, 31)
	Kill[id] = str_to_num(kill)
	Level[id] = str_to_num(level)
}
public plugin_end() nvault_close(g_vault)
stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}

stock seconds_to_units(time)
{
   return((1 << 12) * (time))
}

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	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( );
			}
		}
	}
}
Acum nu mai apar alea pe ecran "Nume,status etc. Au disparut

EDIT: L-am pus primul in lista , merge acum. E foarte bun .
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Oct 2019, 20:41

up.
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Oct 2019, 07:00

up.
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

14 Oct 2019, 16:43

upuppup
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

14 Oct 2019, 18:12

Mi se tot reseteaza scorul. Adica kill-urile. De ce??
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2415
Joined: 10 Jul 2013, 20:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 17 times
Been thanked: 41 times
Contact:

15 Oct 2019, 05:27

Activeaza nvault
no...
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3066
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 459 times
Contact:

15 Oct 2019, 13:27

e o problemă la nvault...chiar și fvault(la anumite versiuni)

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.0",
	AUTHOR[] = "scosmyn";

#define MAX_LEVELS	22

new const Kills[MAX_LEVELS] =
{
	0,
	50,
	100,
	160,
	220,
	290,
	370,
	420,
	500,
	580,
	640,
	690,
	760,
	810,
	850,
	900,
	950,
	1005,
	1030,
	1070,
	1115,
	1250
}

new const szTag[MAX_LEVELS][] =
{
	"",
	"*INCEPATOR*",
	"Silver 2",
	"Silver 3",
	"Silver IV",
	"Silver Elite",
	"Silver Elite Master",
	"Gold Nova 1",
	"Gold Nova 2",
	"Gold Nova 3",
	"Gold Nova IV",
	"Gold Nova Elite",
	"Gold Nova Elite Master",
	"Master Guardian 1",
	"Master Guardian 2",
	"Master Guardian 3",
	"Master Guardian IV",
	"Master Guardian Disthingued",
	"Legendary Eagle ",
	"Supreme Master",
	"LORD [X]",
	"KING <3"
}

new Level[33],Kill[33],szName[32],g_sync
new pcvar_hs,pcvar_kill,pcvar_knife,pcvar_he,pcvar_efect,pcvar_r,pcvar_g,pcvar_b,pcvar_hp_lvl,pcvar_ap_lvl

new filename[255]

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_event("DeathMsg","ev_msg","a")
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	pcvar_hs = register_cvar("cvar_hs_bonus","2")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","1")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")
	pcvar_hp_lvl = register_cvar("cvar_hp_lvl","0")
	pcvar_ap_lvl = register_cvar("cvar_ap_lvl","0")
	
	g_sync = CreateHudSyncObj()

	new Data[65]
	get_datadir(Data, charsmax(Data));
	format(filename,charsmax(filename),"%s/LevelSystem.dat",Data)
	if(!file_exists(filename))	write_file(filename,"")
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))
		return HAM_HANDLED
	
	if(Level[id] < 1)
		Level[id] = 1

	set_user_health(id,get_user_health(id) + get_pcvar_num(pcvar_hp_lvl) * Level[id])
	set_user_armor(id,get_user_armor(id) + get_pcvar_num(pcvar_ap_lvl) * Level[id])
	return HAM_IGNORED
}

public ev_msg( ) {
	static kiler; 	kiler = read_data(1)
	static hs; 		hs = read_data(3)
	
	if(kiler == read_data(2) || !is_user_alive(kiler))
		return

	if(hs)
		Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else
		Kill[kiler]+= get_pcvar_num(pcvar_kill)
	
	if(get_user_weapon(kiler) == CSW_KNIFE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_knife)
	if(get_user_weapon(kiler) == CSW_HEGRENADE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_he)

	if(Level[kiler] < MAX_LEVELS)
	{
		while(Kill[kiler] >= Kills[Level[kiler]])
		{
			get_user_name(kiler,szName,charsmax(szName))
			Level[kiler]++
			color(0,"!team%s!y a avansat la rankul!g %s",Level[kiler],szTag[Level[kiler]])
			screen_fade(kiler, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			break
		}
	}
	SaveData(kiler)
}

public client_putinserver(id) {
	if(!is_user_bot(id)||!is_user_hltv(id))
	{
		LoadData(id)
		set_task(1.0,"show_hud",id+0x4332,_,_,"b")
	}
}

public client_disconnect(id) {
	if(is_user_bot(id)||is_user_hltv(id))	return
	remove_task(id+0x4332)
	SaveData(id)
}

public show_hud(id) {
	id-=0x4332
	if(is_user_alive(id))
	{
		get_user_name(id,szName,charsmax(szName))
		set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), 0.15, 0.01, 0, 6.0, 12.0)
		ShowSyncHudMsg(id,g_sync,"Nume: %s^nRank: %d^nStatus: %s^nKilluri: %i/%i.",szName,Level[id],szTag[Level[id]],Kill[id],Kills[Level[id]])
	}
}

stock SaveData(const id)
{
	get_user_name ( id, szName, 31 );
	new StrongData [ 1024 ];
	formatex ( StrongData, sizeof ( StrongData ) - 1, "^"%d^" ^"%d^"", Level[id],Kill[id] );
	new Save [ 1024 ];
	format ( Save, sizeof ( Save ) - 1, "^"%s^" %s", szName, StrongData );
	new Line [ 128 ], Linie, Arg1 [ 32 ];
	new FileOpen = fopen ( filename, "r+" );
	while ( !feof ( FileOpen ) ) {
		fgets ( FileOpen, Line, 127 );
		trim ( Line );
		parse ( Line, Arg1, 31 );
		if ( equali ( Arg1, szName ) ) {
			write_file ( filename, Save, Linie );
			break;
		}
		Linie++;
	}
	fclose ( FileOpen );
}

stock LoadData(const id)
{
	get_user_name ( id, szName, 31 );
	new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ], Arg3 [ 32 ]
	new FileOpen = fopen ( filename, "r" );
	while ( !feof ( FileOpen ) ) {
		fgets ( FileOpen, Line, 127 );
		trim ( Line );
		parse ( Line, Arg1, 31, Arg2, 31, Arg3, 31 );
		if ( equali ( Arg1, szName ) ) {
			Level [ id ] = str_to_num ( Arg2 );
			Kill [ id ] = str_to_num ( Arg3 );
			IsPlayer = true;
			break;
		}
	}
	fclose ( FileOpen );
	
	if ( !IsPlayer ) {
		Level [ id ] = 0;
		Kill [ id ]  = 0;
	}
}

stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}

stock seconds_to_units(time)
{
   return((1 << 12) * (time))
}

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	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( );
			}
	}
}
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici & pe csbd.com)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent.
* Cumpăr orice tip de cont steam cu level 333 sau 666(nu contează vac status, sau jocurile)
* my little store - anunturi/lev-shop-t370037.html
Puyol
Membru, skill 0
Membru, skill 0
Posts: 76
Joined: 08 May 2018, 13:46
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

15 Oct 2019, 15:18

L E V I N wrote:
15 Oct 2019, 13:27
e o problemă la nvault...chiar și fvault(la anumite versiuni)

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.0",
	AUTHOR[] = "scosmyn";

#define MAX_LEVELS	22

new const Kills[MAX_LEVELS] =
{
	0,
	50,
	100,
	160,
	220,
	290,
	370,
	420,
	500,
	580,
	640,
	690,
	760,
	810,
	850,
	900,
	950,
	1005,
	1030,
	1070,
	1115,
	1250
}

new const szTag[MAX_LEVELS][] =
{
	"",
	"*INCEPATOR*",
	"Silver 2",
	"Silver 3",
	"Silver IV",
	"Silver Elite",
	"Silver Elite Master",
	"Gold Nova 1",
	"Gold Nova 2",
	"Gold Nova 3",
	"Gold Nova IV",
	"Gold Nova Elite",
	"Gold Nova Elite Master",
	"Master Guardian 1",
	"Master Guardian 2",
	"Master Guardian 3",
	"Master Guardian IV",
	"Master Guardian Disthingued",
	"Legendary Eagle ",
	"Supreme Master",
	"LORD [X]",
	"KING <3"
}

new Level[33],Kill[33],szName[32],g_sync
new pcvar_hs,pcvar_kill,pcvar_knife,pcvar_he,pcvar_efect,pcvar_r,pcvar_g,pcvar_b,pcvar_hp_lvl,pcvar_ap_lvl

new filename[255]

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_event("DeathMsg","ev_msg","a")
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	pcvar_hs = register_cvar("cvar_hs_bonus","2")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","1")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")
	pcvar_hp_lvl = register_cvar("cvar_hp_lvl","0")
	pcvar_ap_lvl = register_cvar("cvar_ap_lvl","0")
	
	g_sync = CreateHudSyncObj()

	new Data[65]
	get_datadir(Data, charsmax(Data));
	format(filename,charsmax(filename),"%s/LevelSystem.dat",Data)
	if(!file_exists(filename))	write_file(filename,"")
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))
		return HAM_HANDLED
	
	if(Level[id] < 1)
		Level[id] = 1

	set_user_health(id,get_user_health(id) + get_pcvar_num(pcvar_hp_lvl) * Level[id])
	set_user_armor(id,get_user_armor(id) + get_pcvar_num(pcvar_ap_lvl) * Level[id])
	return HAM_IGNORED
}

public ev_msg( ) {
	static kiler; 	kiler = read_data(1)
	static hs; 		hs = read_data(3)
	
	if(kiler == read_data(2) || !is_user_alive(kiler))
		return

	if(hs)
		Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else
		Kill[kiler]+= get_pcvar_num(pcvar_kill)
	
	if(get_user_weapon(kiler) == CSW_KNIFE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_knife)
	if(get_user_weapon(kiler) == CSW_HEGRENADE && !hs)
		Kill[kiler]+= get_pcvar_num(pcvar_he)

	if(Level[kiler] < MAX_LEVELS)
	{
		while(Kill[kiler] >= Kills[Level[kiler]])
		{
			get_user_name(kiler,szName,charsmax(szName))
			Level[kiler]++
			color(0,"!team%s!y a avansat la rankul!g %s",Level[kiler],szTag[Level[kiler]])
			screen_fade(kiler, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			break
		}
	}
	SaveData(kiler)
}

public client_putinserver(id) {
	if(!is_user_bot(id)||!is_user_hltv(id))
	{
		LoadData(id)
		set_task(1.0,"show_hud",id+0x4332,_,_,"b")
	}
}

public client_disconnect(id) {
	if(is_user_bot(id)||is_user_hltv(id))	return
	remove_task(id+0x4332)
	SaveData(id)
}

public show_hud(id) {
	id-=0x4332
	if(is_user_alive(id))
	{
		get_user_name(id,szName,charsmax(szName))
		set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), 0.15, 0.01, 0, 6.0, 12.0)
		ShowSyncHudMsg(id,g_sync,"Nume: %s^nRank: %d^nStatus: %s^nKilluri: %i/%i.",szName,Level[id],szTag[Level[id]],Kill[id],Kills[Level[id]])
	}
}

stock SaveData(const id)
{
	get_user_name ( id, szName, 31 );
	new StrongData [ 1024 ];
	formatex ( StrongData, sizeof ( StrongData ) - 1, "^"%d^" ^"%d^"", Level[id],Kill[id] );
	new Save [ 1024 ];
	format ( Save, sizeof ( Save ) - 1, "^"%s^" %s", szName, StrongData );
	new Line [ 128 ], Linie, Arg1 [ 32 ];
	new FileOpen = fopen ( filename, "r+" );
	while ( !feof ( FileOpen ) ) {
		fgets ( FileOpen, Line, 127 );
		trim ( Line );
		parse ( Line, Arg1, 31 );
		if ( equali ( Arg1, szName ) ) {
			write_file ( filename, Save, Linie );
			break;
		}
		Linie++;
	}
	fclose ( FileOpen );
}

stock LoadData(const id)
{
	get_user_name ( id, szName, 31 );
	new Line [ 128 ], IsPlayer = false, Arg1 [ 32 ], Arg2 [ 32 ], Arg3 [ 32 ]
	new FileOpen = fopen ( filename, "r" );
	while ( !feof ( FileOpen ) ) {
		fgets ( FileOpen, Line, 127 );
		trim ( Line );
		parse ( Line, Arg1, 31, Arg2, 31, Arg3, 31 );
		if ( equali ( Arg1, szName ) ) {
			Level [ id ] = str_to_num ( Arg2 );
			Kill [ id ] = str_to_num ( Arg3 );
			IsPlayer = true;
			break;
		}
	}
	fclose ( FileOpen );
	
	if ( !IsPlayer ) {
		Level [ id ] = 0;
		Kill [ id ]  = 0;
	}
}

stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}

stock seconds_to_units(time)
{
   return((1 << 12) * (time))
}

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	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( );
			}
	}
}
Acum ar fi normal sa nu se mai reseteze nu? Si ar mai fi problema ca atunci cand un player trece rank-ul , ii scrie asa " Felicitari , ai trecut la rank-ul ... " si li se reseteaza tuturor playerilor atunci cand unul trece. Si as vrea ca atunci cand un player trece rank-ul sa ii spuna si numele in chat . Adica sa fie " Felicitari "nume player" ai trecut la rank-ul "nume rank"
Multumesc multt !!
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3066
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 459 times
Contact:

15 Oct 2019, 16:09

asta face, și nu se resetează nimic, dacă nu ai minim de cunoștințe nu mai cere ajutor -_-
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici & pe csbd.com)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent.
* Cumpăr orice tip de cont steam cu level 333 sau 666(nu contează vac status, sau jocurile)
* my little store - anunturi/lev-shop-t370037.html
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests