[Cerere Plugin] Scor MIX

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
ApplyWe
Membru, skill 0
Membru, skill 0
Posts: 31
Joined: 03 Mar 2015, 12:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

03 Apr 2015, 18:08

Plugin Cerut: Scor MIX
Descriere (adica ce face el mai exact): Sa zicem ca a castigat Ct o runda.Sa zica
Scorul este [CT]-[T] 1-0
Asa as vrea sau cum puteti voi.
Serverul ruleaza (HLDS/ReHLDS): rehlds
Versiune AMX Mod X: -
Modul Serverului: -
Last edited by Rainq on 04 Feb 2019, 13:21, edited 1 time in total.
Reason: Editat dupa model
Image
RoyalServer 2
User avatar
RovlX
Membru, skill +1
Membru, skill +1
Posts: 155
Joined: 27 Aug 2012, 15:03
Detinator Steam: Da
CS Status: -
SteamID: ady_zada
Location: Arad, Romania
Contact:

03 Apr 2015, 20:01

Il vrei in chat sau HUD?
ApplyWe
Membru, skill 0
Membru, skill 0
Posts: 31
Joined: 03 Mar 2015, 12:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

03 Apr 2015, 20:18

Da-mi ambele versiuni daca poti
Image
User avatar
RovlX
Membru, skill +1
Membru, skill +1
Posts: 155
Joined: 27 Aug 2012, 15:03
Detinator Steam: Da
CS Status: -
SteamID: ady_zada
Location: Arad, Romania
Contact:

03 Apr 2015, 21:05

Nu stiu daca functioneaza corect, incearca-l si spune-mi dupa daca exista vre-o problema.
mix_score.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define Autor "eXtreamCS"
#define Versiune "DEM"
#define Nume "Mix Score"

new ctscore, tscore, hudmsg
new cvar

public plugin_init(){
	register_plugin(Nume, Versiune, Autor)
	
	cvar = register_cvar("mix_score_type", "1")
	
	register_think("msg", "ForwardThink")
	
	register_event("TextMsg", "RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("TeamScore", "Team_Score", "a")
	
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn")
	
	hudmsg = CreateHudSyncObj()
	
	new iEnt = create_entity("info_target")
	entity_set_string(iEnt, EV_SZ_classname, "msg")
	entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public ForwardThink(iEnt){
	if(get_pcvar_num(cvar) == 1){
		show_hud()
		entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
	}
}

public show_hud(){
	if(get_pcvar_num(cvar) == 1){
		set_hudmessage(255, 255, 255, -1.0, 0.02, _, _, 4.0, _, _, 4)
		ShowSyncHudMsg(0, hudmsg, "[CT] - [T]^n[%s%d] -- [%s%d]", ctscore, tscore)
	}
}

public PlayerSpawn(id){
	if(get_pcvar_num(cvar) != 1)
		ColorChatAlpha(id, "!nScorul este [CT: !g%d!n] - [!g%d!n :T]", ctscore, tscore)
	return HAM_HANDLED
}

public RestartRound(){
	ctscore = 0
	tscore = 0
}

public Team_Score( ){
	new Team[2]
	read_data(1, Team, 1)
    
	if(Team[0] == 'C')
		ctscore = read_data(2) 
		else if(Team[0] == 'T')
			tscore = read_data(2)
    
	return 0
}

stock ColorChatAlpha(index, const text[], any:...){
	new MsgSayText
	static Msg[128]
	vformat(Msg, sizeof(Msg) - 1, text, 3)

	replace_all(Msg, sizeof(Msg) - 1, "!g", "^x04")
	replace_all(Msg, sizeof(Msg) - 1, "!n", "^x01")
	replace_all(Msg, sizeof(Msg) - 1, "!t", "^x03")
	
	MsgSayText = get_user_msgid("SayText")

	message_begin(MSG_ONE_UNRELIABLE, MsgSayText, _, index)
	write_byte(index)
	write_string(Msg)
	message_end()
}
CVar-uri:

Code: Select all

mix_score_type (default 1)
	*cand este 1 apare in HUD
	*cand este diferit de 1(orice alt numar) apare in chat
Last edited by RovlX on 10 Jul 2015, 06:10, edited 3 times in total.
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

04 Apr 2015, 12:20

RovlX wrote:Nu stiu daca functioneaza corect, incearca-l si spune-mi dupa daca exista vre-o problema.
mix_score.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define Autor "eXtreamCS"
#define Versiune "DEM"
#define Nume "Mix Score"

new ctscore, tscore, hudmsg
new cvar

public plugin_init(){
	register_plugin(Nume, Versiune, Autor)
	
	cvar = register_cvar("mix_score_type", "1")
	
	register_think("msg", "ForwardThink")
	
	register_event("TextMsg", "RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("TeamScore", "Team_Score", "a")
	
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn")
	
	hudmsg = CreateHudSyncObj()
	
	new iEnt = create_entity("info_target")
	entity_set_string(iEnt, EV_SZ_classname, "msg")
	entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public ForwardThink(iEnt){
	if(cvar == 1){
		show_hud()
		entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
	}
}

public show_hud(){
	if(cvar == 1){
		set_hudmessage(255, 255, 255, -1.0, 0.02, _, _, 4.0, _, _, 4)
		ShowSyncHudMsg(0, hudmsg, "[CT] - [T]^n[%s%d] -- [%s%d]", ctscore, tscore)
	}
}

public PlayerSpawn(id){
	if(cvar != 1)
		ColorChatAlpha(id, "!nScorul este [CT: !g%d!n] - [!g%d!n :T]", ctscore, tscore)
	return HAM_HANDLED
}

public RestartRound(){
	ctscore = 0
	tscore = 0
}

public Team_Score( ){
	new Team[2]
	read_data(1, Team, 1)
    
	if(Team[0] == 'C')
		ctscore = read_data(2) 
		else if(Team[0] == 'T')
			tscore = read_data(2)
    
	return 0
}

stock ColorChatAlpha(index, const text[], any:...){
	new MsgSayText
	static Msg[128]
	vformat(Msg, sizeof(Msg) - 1, text, 3)

	replace_all(Msg, sizeof(Msg) - 1, "!g", "^x04")
	replace_all(Msg, sizeof(Msg) - 1, "!n", "^x01")
	replace_all(Msg, sizeof(Msg) - 1, "!t", "^x03")
	
	MsgSayText = get_user_msgid("SayText")

	message_begin(MSG_ONE_UNRELIABLE, MsgSayText, _, index)
	write_byte(index)
	write_string(Msg)
	message_end()
}
CVar-uri:

Code: Select all

mix_score_type (default 1)
	*cand este 1 apare in HUD
	*cand este diferit de 1(orice alt numar) apare in chat
Foloeste get_pcvar_num(cvar) nu, cvar == 1!
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

04 Apr 2015, 14:39

| Afiseaza codul
#include <amxmodx>

static const
	PLUGIN[] = "Hud",
	VERSION[] = "1.0",
	AUTHOR[] = "C0sm1N";

new winT,winCt
new g_msgsync,g_msgsync2

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR);

	register_event("SendAudio","ctwin","a","2=%!MRAD_ctwin");
	register_event("SendAudio","twin","a","2=%!MRAD_terwin");
	register_event("TextMsg","game_commencing","a","2&#Game_C");
	register_event("TextMsg", "game_restart","a","2=#Game_will_restart_in");
	
	g_msgsync = CreateHudSyncObj()
	g_msgsync2 = CreateHudSyncObj()
	
	set_task(1.0,"hudmsg",_,_,_,"b")
}
public ctwin()	winCt++
public twin()   winT++
public game_commencing() {
	winCt = 0
	winT = 0
}
public game_restart() {
	winCt = 0
	winT = 0
}

public hudmsg() {
	static id
	for(id = 1; id <= get_maxplayers(); id++)
	{
		if(!is_user_alive(id) || is_user_bot(id))
			continue

		set_hudmessage(255, 0, 0, 0.32, 0.0, 0, 6.0, 1.1)
		ShowSyncHudMsg(id, g_msgsync, "[CT]   %d",winCt);

		set_hudmessage(17, 72, 237, 0.50, 0.0, 0, 6.0, 1.1)
		ShowSyncHudMsg(id, g_msgsync2, "%d   [T]",winT);
	}
}
e facut de mult timp,vezi daca iti place.
User avatar
RovlX
Membru, skill +1
Membru, skill +1
Posts: 155
Joined: 27 Aug 2012, 15:03
Detinator Steam: Da
CS Status: -
SteamID: ady_zada
Location: Arad, Romania
Contact:

04 Apr 2015, 14:49

YONTU wrote:
RovlX wrote:Nu stiu daca functioneaza corect, incearca-l si spune-mi dupa daca exista vre-o problema.
mix_score.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define Autor "eXtreamCS"
#define Versiune "DEM"
#define Nume "Mix Score"

new ctscore, tscore, hudmsg
new cvar

public plugin_init(){
	register_plugin(Nume, Versiune, Autor)
	
	cvar = register_cvar("mix_score_type", "1")
	
	register_think("msg", "ForwardThink")
	
	register_event("TextMsg", "RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("TeamScore", "Team_Score", "a")
	
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn")
	
	hudmsg = CreateHudSyncObj()
	
	new iEnt = create_entity("info_target")
	entity_set_string(iEnt, EV_SZ_classname, "msg")
	entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public ForwardThink(iEnt){
	if(cvar == 1){
		show_hud()
		entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
	}
}

public show_hud(){
	if(cvar == 1){
		set_hudmessage(255, 255, 255, -1.0, 0.02, _, _, 4.0, _, _, 4)
		ShowSyncHudMsg(0, hudmsg, "[CT] - [T]^n[%s%d] -- [%s%d]", ctscore, tscore)
	}
}

public PlayerSpawn(id){
	if(cvar != 1)
		ColorChatAlpha(id, "!nScorul este [CT: !g%d!n] - [!g%d!n :T]", ctscore, tscore)
	return HAM_HANDLED
}

public RestartRound(){
	ctscore = 0
	tscore = 0
}

public Team_Score( ){
	new Team[2]
	read_data(1, Team, 1)
    
	if(Team[0] == 'C')
		ctscore = read_data(2) 
		else if(Team[0] == 'T')
			tscore = read_data(2)
    
	return 0
}

stock ColorChatAlpha(index, const text[], any:...){
	new MsgSayText
	static Msg[128]
	vformat(Msg, sizeof(Msg) - 1, text, 3)

	replace_all(Msg, sizeof(Msg) - 1, "!g", "^x04")
	replace_all(Msg, sizeof(Msg) - 1, "!n", "^x01")
	replace_all(Msg, sizeof(Msg) - 1, "!t", "^x03")
	
	MsgSayText = get_user_msgid("SayText")

	message_begin(MSG_ONE_UNRELIABLE, MsgSayText, _, index)
	write_byte(index)
	write_string(Msg)
	message_end()
}
CVar-uri:

Code: Select all

mix_score_type (default 1)
	*cand este 1 apare in HUD
	*cand este diferit de 1(orice alt numar) apare in chat
Foloeste get_pcvar_num(cvar) nu, cvar == 1!
Editat
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 307
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

04 Feb 2019, 09:17

RovlX wrote:
YONTU wrote:
RovlX wrote:Nu stiu daca functioneaza corect, incearca-l si spune-mi dupa daca exista vre-o problema.
mix_score.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define Autor "eXtreamCS"
#define Versiune "DEM"
#define Nume "Mix Score"

new ctscore, tscore, hudmsg
new cvar

public plugin_init(){
	register_plugin(Nume, Versiune, Autor)
	
	cvar = register_cvar("mix_score_type", "1")
	
	register_think("msg", "ForwardThink")
	
	register_event("TextMsg", "RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("TeamScore", "Team_Score", "a")
	
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn")
	
	hudmsg = CreateHudSyncObj()
	
	new iEnt = create_entity("info_target")
	entity_set_string(iEnt, EV_SZ_classname, "msg")
	entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
}

public ForwardThink(iEnt){
	if(cvar == 1){
		show_hud()
		entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 2.0)
	}
}

public show_hud(){
	if(cvar == 1){
		set_hudmessage(255, 255, 255, -1.0, 0.02, _, _, 4.0, _, _, 4)
		ShowSyncHudMsg(0, hudmsg, "[CT] - [T]^n[%s%d] -- [%s%d]", ctscore, tscore)
	}
}

public PlayerSpawn(id){
	if(cvar != 1)
		ColorChatAlpha(id, "!nScorul este [CT: !g%d!n] - [!g%d!n :T]", ctscore, tscore)
	return HAM_HANDLED
}

public RestartRound(){
	ctscore = 0
	tscore = 0
}

public Team_Score( ){
	new Team[2]
	read_data(1, Team, 1)
    
	if(Team[0] == 'C')
		ctscore = read_data(2) 
		else if(Team[0] == 'T')
			tscore = read_data(2)
    
	return 0
}

stock ColorChatAlpha(index, const text[], any:...){
	new MsgSayText
	static Msg[128]
	vformat(Msg, sizeof(Msg) - 1, text, 3)

	replace_all(Msg, sizeof(Msg) - 1, "!g", "^x04")
	replace_all(Msg, sizeof(Msg) - 1, "!n", "^x01")
	replace_all(Msg, sizeof(Msg) - 1, "!t", "^x03")
	
	MsgSayText = get_user_msgid("SayText")

	message_begin(MSG_ONE_UNRELIABLE, MsgSayText, _, index)
	write_byte(index)
	write_string(Msg)
	message_end()
}
CVar-uri:

Code: Select all

mix_score_type (default 1)
	*cand este 1 apare in HUD
	*cand este diferit de 1(orice alt numar) apare in chat
Foloeste get_pcvar_num(cvar) nu, cvar == 1!
Editat
folosesc pluignul la sv meu de clasic , si pe sv am pluignul de swap la 15 runde ! si daca e de ex la Teroristi 10-5 , si dupa face swap tot asa ramane , cei ce erau la ct si aveau scor 5 , cand se face swap au scor 10 ! puteti face ceva ?
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests