Jump to content

Recommended Posts

1. Nume plugin: ResetScore v.3.3
2. Autor & Versiune: Arion / 3.3
3. Comenzi:
Publice in chat: /rs sau /resetscore - iti resetezi singur scorul.
Consola (doar admini): amx_resetscore - reseteaza scorul tuturor jucatorilor aflati pe server.
4. Cvar: 

Quote

[*]amx_reset_chat <valoare>

1 - Afiseaza mesajul de anuntare
0 - Nu afiseaza mesajul de anuntare

[*]amx_reset_plugin <valoare>

1 - Pluginul este activat
0 - Pluginul este dezactivat

[*]amx_reset_dead <valoare>

1 - Jucatorii isi pot reseta scorul cand sunt morti
0 - Jucatorii nu-si pot reseta scorul cand sunt morti

[*]amx_reset_tag<text care apare in chat la mesaje>
[*]amx_reset_time<din cate in cate secunde se va afisa mesajul>
[*]amx_reset_plugin <valoare>

1 - Pluginul este activat
0 - Pluginul este dezactivat

 

5. Alte detalii: Cu ajutorul acestui plugin jucatorii vor putea sa-si reseteze scorul folosind comenzile de mai sus, ori chiar adminii cu flag-ul A (imunitate) pot reseta scorul tuturor jucatorilor aflati pe server.
6. Link download: 
 

#include <amxmodx>
#include <cstrike>
#include <fun>

#pragma semicolon 1
#define ADMIN_ACCESS ADMIN_IMMUNITY

enum Color { NORMAL = 1, GREEN, TEAM_COLOR, GREY, RED, BLUE};
new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" };
new cvar_chat, cvar_on, cvar_dead, cvar_tag, cvar_time, g_Tag;

public plugin_init() {
	register_plugin("Reset score", "3.2", "Ex3cuTioN");
	
	register_clcmd("say /resetscore", "cmdReset");
	register_clcmd("say /rs", "cmdReset");
	register_clcmd("say_team /resetscore", "cmdReset");
	register_clcmd("resetscore", "cmdReset");
	
	register_concmd("amx_resetscore", "conReset", ADMIN_ACCESS, "- reseteaza scorul tuturor");
	
	cvar_chat = register_cvar("amx_reset_chat", "1");
	cvar_on = register_cvar("amx_reset_plugin", "1");
	cvar_dead = register_cvar("amx_reset_dead","1");
	cvar_tag = register_cvar("amx_reset_tag","ResetScore");
	cvar_time = register_cvar("amx_reset_time","60");
	
	if(get_pcvar_num(cvar_chat) == 1) {
		new Float:timp = get_pcvar_float(cvar_time);
		set_task(timp, "chatmsgshow", _, _, _, "b", 0);
	}
	new tag[32];
	g_Tag = get_pcvar_string(cvar_tag, tag, 31);
}

public cmdReset(id) {
	if(get_pcvar_num(cvar_on) == 0) {
		ColorChat(id, GREEN,"[%s]^x01 Pluginul este dezactivat", g_Tag);
		return PLUGIN_HANDLED;
	}
	if(get_pcvar_num(cvar_dead) == 0 && !is_user_alive(id)) {
		ColorChat(id, GREEN, "[%s]^x01 Poti folosii comanda numai atunci cand esti viu.", g_Tag);
		return PLUGIN_HANDLED;
	}
	
	new frags = get_user_frags(id);
	new deaths = get_user_deaths(id);
	
	if(frags == 0 && deaths == 0)
		ColorChat(id, GREEN, "[%s]^x01 Scorul tau este deja^x04 0",g_Tag);
	else {
		for(new i = 0; i < 2; i++) {
			cs_set_user_deaths(id, 0);
			set_user_frags(id, 0);
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(id, GREEN, "[%s]^x01 Scorul tau s-a resetat.", g_Tag);
		ColorChat(0, GREEN,"[%s]^x01 si-a resetat scorul.", name);
	}
	return PLUGIN_HANDLED;
}

public conReset(id) {
	if(get_user_flags(id)&ADMIN_ACCESS) {
		new players[32], num, player;
		get_players(players, num, "c");
		
		for(new i = 0; i < num; i++) {
			player = players;
			if(get_user_frags(player) != 0 && get_user_deaths(player) != 0) {
				cs_set_user_deaths(player, 0);
				set_user_frags(player, 0);
			}
		}
		
		new name[32];
		get_user_name(id, name, 31);
		
		ColorChat(0, GREEN, "[%s]^x03 %s^x01 a resetat scorul tuturor.", g_Tag, name);
	}
	else
		console_print(id, "Nu ai acces la aceasta comanda.");
		
	return PLUGIN_HANDLED;
}

public chatmsgshow(id)
	ColorChat(id, GREEN, "[%s]^x01 Daca vrei sa iti resetezi scorul, foloseste comanda^x04 /resetscore^x01 sau^x04 /rs !", g_Tag);

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) {
	if(!get_playersnum()) 
		return;
	
	new message[256];

	switch(type) {
		case NORMAL:
		{
			message[0] = 0x01;
		}
		case GREEN:
		{
			message[0] = 0x04;
		}
		default:
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id) {
		MSG_Type = MSG_ONE;
		index = id;
	}
	else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
		Team_Info(index, MSG_Type, TeamName[team]);
}

ShowColorMessage(id, type, message[]) {
	static bool:saytext_used;
	static get_user_msgid_saytext;
	
	if(!saytext_used) {
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}
	
	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id);
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[]) {
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	
	if(!teaminfo_used) {
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}
	
	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type) {
	switch(Type) {
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer() {
	new i = -1;

	while(i <= get_maxplayers()) {
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}

7. Poze: 
w5VQtFt.png
PqzDtjA.png
ceYeut3.png
yEGZIfG.png

Sursa: extreamCS


Link-uri utile, nu ezita sa le folosesti! 😁
Counter-Strike 1.6 (AMXX) Support - click aici

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...