- #include <amxmodx> 
- #include <amxmisc> 
- #include <cstrike> 
- #include <fun> 
- #include <nvault> 
- #include <colorchat> 
-   
-   
- new Advertise 
- new Display 
- new g_vault 
- new Time 
- new color 
- new srv_name 
-   
- public plugin_init() 
- { 
- 	register_plugin("ScoreOptions", "1.0", "Petrik") 
-   
- 	//cmd*s 
- 	register_clcmd("say /resetscore", "reset") 
- 	register_clcmd("say /rs", "reset") 
-   
- 	register_clcmd("say /savescore", "save") 
- 	register_clcmd("say /ss", "save") 
-   
- 	register_clcmd("say /loadscores", "load") 
- 	register_clcmd("say /ls", "load") 
-   
- 	register_clcmd("say /balancestat", "balance") 
- 	register_clcmd("say /bs", "balance") 
-   
- 	register_clcmd("say /SOhelp","motd") 
-   
-   
- 	//cvars 
- 	Display = register_cvar("sv_rsdisplay","1") 
- 	Advertise = register_cvar("sv_rsAdvertise", "1") 
- 	Time = register_cvar("sv_rsTime", "60.0") 
- 	color = register_cvar("sv_rsColor", "1") 
- 	srv_name = register_cvar( "srv_name", "[AMXX]" ); 
-   
- 	//nvault 
- 	g_vault = nvault_open("score") 
-   
- 	// 
- 	set_task(20.0, "advertise") 
- } 
-   
- public motd(id) 
- show_motd(id,"sohelp.txt","Score Options HELP") 
-   
- public reset(id) 
- { 
- 	new srv_name2[ 8 ] 
- 	get_pcvar_string( srv_name, srv_name2, charsmax(srv_name2)); 
- 	cs_set_user_deaths(id, 0) 
- 	set_user_frags(id, 0) 
- 	cs_set_user_deaths(id, 0) 
- 	set_user_frags(id, 0) 
-   
- 	if(get_pcvar_num(Display) == 1) 
- 	{ 
- 		new name[33] 
- 		get_user_name(id, name, 32) 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN, "%s ^x03%s ^x01 nullazta a statjat.",srv_name2 , name) 
- 		else 
- 		client_print(0, print_chat, "%s %s nullazta a statjat.",srv_name2 , name) 
- 		return PLUGIN_HANDLED; 
- 	} 
- 	else 
- 	{ 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN, "%s ^x01 A statod sikeresen lenullazva!",srv_name2) 
- 		else 
- 		client_print(id, print_chat, "%s A statod sikeresen lenullazva!", srv_name2) 
- 	} 
- 	return PLUGIN_HANDLED; 
- } 
-   
-   
- public save(id)  
- { 
- 	new srv_name2[ 8 ] 
- 	get_pcvar_string( srv_name, srv_name2, charsmax(srv_name2)); 
- 	new frags = get_user_frags(id) 
- 	new deaths = cs_get_user_deaths(id) 
-   
- 	new name[32] 
- 	get_user_name(id, name, 31)	 
- 	new vaultkey[64],vaultdata[256] 
- 	format(vaultkey,63,"%sscore", name)  
- 	format(vaultdata,255,"%i#%i#",frags,deaths) 
- 	nvault_set(g_vault,vaultkey,vaultdata) 
-   
- 	if(get_pcvar_num(Display) == 1) 
- 	{ 
- 		new name[33] 
- 		get_user_name(id, name, 32) 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN, "%s ^x03%s ^x01 elmentette ezt a statot: %d-%d",srv_name2, name, frags, deaths) 
- 		else 
- 		client_print(0, print_chat, "%s %s elmentette ezt a statot: %d-%d",srv_name2, name, frags, deaths) 
- 		return PLUGIN_HANDLED; 
- 	} 
- 	else 
- 	{ 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN, "%s ^x01Sikeresen elmentetted ezt a statot: %d-%d",srv_name2 ,frags, deaths) 
- 		else 
- 		client_print(id, print_chat, "%s Sikeresen elmentetted ezt a statot: %d-%d",srv_name2 ,frags, deaths) 
- 	} 
-   
-   
- 	return PLUGIN_HANDLED; 
- } 
-   
- public load(id)  
- { 
- 	new srv_name2[ 8 ] 
- 	get_pcvar_string( srv_name, srv_name2, charsmax(srv_name2)); 
- 	new frags 
- 	new deaths 
-   
- 	new name[32] 
- 	get_user_name(id, name, 31)  
- 	new vaultkey[64],vaultdata[256] 
- 	format(vaultkey,63,"%sscore", name)  
- 	format(vaultdata,255,"%i#%i#",frags,deaths)  
- 	nvault_get(g_vault,vaultkey,vaultdata,255)  
- 	replace_all(vaultdata, 255, "#", " ")  
- 	new playerdeaths[32], playerfrags[32]  
- 	parse(vaultdata, playerfrags, 31, playerdeaths, 31)	 
-   
- 	cs_set_user_deaths(id, str_to_num(playerdeaths)) 
- 	set_user_frags(id, str_to_num(playerfrags)) 
- 	cs_set_user_deaths(id, str_to_num(playerdeaths)) 
- 	set_user_frags(id, str_to_num(playerfrags)) 
-   
- 	if(get_pcvar_num(Display) == 1) 
- 	{ 
- 		new name[33] 
- 		get_user_name(id, name, 32) 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN, "%s ^x03%s ^x01 betoltotte  ezt a statot: %d-%d ",srv_name2, name , str_to_num(playerfrags) ,str_to_num(playerdeaths)) 
- 		else  
- 		client_print(0, print_chat, "%s %s betoltotte  ezt a statot: %d-%d ",srv_name2, name , str_to_num(playerfrags) ,str_to_num(playerdeaths)) 
- 		return PLUGIN_HANDLED; 
- 	} 
- 	else 
- 	{ 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN,"%s ^x01 Sikeresen betoltotted ezt a statot: %d-%d",srv_name2, str_to_num(playerfrags) ,str_to_num(playerdeaths)) 
- 		else 
- 		client_print(id, print_chat, "%s Sikeresen betoltotted ezt a statot: %d-%d",srv_name2, str_to_num(playerfrags) ,str_to_num(playerdeaths)) 
- 	} 
-   
- 	return PLUGIN_HANDLED; 
- } 
-   
- public balance(id) 
- { 
- 	new srv_name2[ 8 ] 
- 	get_pcvar_string( srv_name, srv_name2, charsmax(srv_name2)); 
- 	new frags = get_user_frags(id); 
- 	new deaths = cs_get_user_deaths(id) 
- 	if(deaths > frags) 
- 	{ 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN,"%s ^x01 Nem egyenlitheted ki a statod mert tobbszor haltal meg mint ahany fragod van!",srv_name2) 
- 		else 
- 		client_print(id, print_chat, "%s Nem egyenlitheted ki a statod mert tobbszor haltal meg mint ahany fragod van!",srv_name2) 
- 		return PLUGIN_HANDLED; 
- 	} 
- 	else 
- 	{ 
- 		frags -= deaths; 
- 		set_user_frags(id, frags) 
- 		cs_set_user_deaths(id, 0); 
-   
- 		if(get_pcvar_num(Display) == 1){ 
- 			new name[33] 
- 			get_user_name(id, name, 32) 
- 			if(get_pcvar_num(color) == 1) 
- 			ColorChat(0, GREEN,"%s ^x03%s ^x01 kiegyenlitette a statjat.",srv_name2, name) 
- 			else 
- 			client_print(0, print_chat, "%s %s kiegyenlitette a statjat.",srv_name2, name) 
- 			return PLUGIN_HANDLED; 
- 		} 
- 		else{ 
- 			if(get_pcvar_num(color) == 1) 
- 			ColorChat(0, GREEN,"%s ^x01 Sikeresen kiegyenlitetted a statod!",srv_name2) 
- 			else 
- 			client_print(id, print_chat, "%s Sikeresen kiegyenlitetted a statod!",srv_name2) 
- 		} 
- 	} 
- 	return PLUGIN_HANDLED; 
- } 
-   
- public advertise() 
- { 
- 	new srv_name2[ 8 ] 
- 	get_pcvar_string( srv_name, srv_name2, charsmax(srv_name2)); 
-   
- 	if(get_pcvar_num(Advertise) == 0) 
- 	return PLUGIN_HANDLED; 
-   
- 	set_task(get_pcvar_float(Time), "advertise") 
-   
- 	if(get_pcvar_num(Advertise) == 1){ 
- 		set_hudmessage(0, 255, 100, 0.01, 0.15, 0, 6.0, 15.0) 
- 		show_hudmessage(0, "Ird chatbe: ^n/rs, hogy nullazd a statod^n/ss, hogy elmentsd a statod^n/ls, hogy vissza allitsd a statod^n/bs, hogy kiengyelitsd a statod") 
- 	} 
- 	if(get_pcvar_num(Advertise) == 2){ 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN,"%s ^x01 Ird: /rs, hogy nullazd ,/ss hogy elmentsd, /ls hogy vissza allitsd, /bs hogy kiengyelitsd a statod",srv_name2) 
- 		else 
- 		client_print(0, print_chat, "%s Ird: /rs, hogy nullazd ,/ss hogy elmentsd, /ls hogy vissza allitsd, /bs hogy kiengyelitsd a statod",srv_name2) 
- 	} 
- 	if(get_pcvar_num(Advertise) == 3){ 
- 		set_hudmessage(0, 255, 100, 0.01, 0.15, 0, 0.2, 15.0) 
- 		show_hudmessage(0, "Ird chatbe: ^n/rs, hogy nullazd a statod^n/ss, hogy elmentsd a statod^n/ls hogy vissza allitsd a statod^n/bs hogy kiengyelitsd a statod") 
- 		if(get_pcvar_num(color) == 1) 
- 		ColorChat(0, GREEN,"%s ^x01 Ird: /rs, hogy nullazd ,/ss hogy elmentsd, /ls hogy vissza allitsd, /bs hogy kiengyelitsd a statod",srv_name2) 
- 		else 
- 		client_print(0, print_chat, "%s Ird: /rs, hogy nullazd ,/ss hogy elmentsd, /ls hogy vissza allitsd, /bs hogy kiengyelitsd a statod",srv_name2) 
- 	} 
- 	set_task(30.0,"petrikadvertise") 
- 	return PLUGIN_HANDLED; 
- } 
-   
- public petrikadvertise(){ 
- 	ColorChat(0, GREEN, "A szerveren ^x03score options ^x04plugin fut irta: ^x03Petrik") 
- 	client_print(0, print_chat, "Ird /SOhelp hogy eligazodj a score options pluginon!") 
- } 
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par } 
- */ 
-