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

[HELP] Change team score in scoreboard?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-19-2018 , 02:56   [HELP] Change team score in scoreboard?
Reply With Quote #1

I would like to change the team scores with a plugin.
TeamScore event is all I can find, I have searched..

Anyone know?
Thanks.
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731
GoldNux is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 04-19-2018 , 03:15   Re: [HELP] Change team score in scoreboard?
Reply With Quote #2

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
new gmsgScoreInfo
 

public chscore(id,level,cid)
{
	if (!cmd_access(id,level,cid,2)) 
	{ 
      return PLUGIN_HANDLED 
	}
	new victim[32],deathsI[32],fragsI[32]
	read_argv(1,victim,31)

	read_argv(2,fragsI,31) 
	new frags = str_to_num(fragsI) 
	   
	read_argv(3,deathsI,31) 
	new deaths = str_to_num(deathsI) 
	
	if (victim[0]=='@')
	{ 
		new team[32], inum 
		get_players(team,inum,"e",victim[1]) 
		if (inum==0)
		{ 
			console_print(id,"[AMX] No clients found on such team.") 
			return PLUGIN_HANDLED 
		} 
		for (new i=0;i<inum;++i)
		{
		    new teams = get_user_team(team[i])  
		    set_user_frags(team[i],frags)
		    cs_set_user_deaths(team[i],deaths)
		    message_begin(MSG_ALL,gmsgScoreInfo)
		    write_byte( team[i] )  
		    write_short(frags) 
		    write_short(deaths) 
		    write_short(0) 
		    write_short(teams) 
		    message_end() 
		} 
	} 
	else
	{
		new user = cmd_target(id,victim,0)
		new authid[32]
		get_user_authid(user,authid,31)  
		if (!user)
		{
			console_print(id,"[AMX] No such client found.") 
			return PLUGIN_HANDLED 
		}
		new teams = get_user_team(user)
		set_user_frags(user,frags)
		cs_set_user_deaths(user,deaths)
		message_begin(MSG_ALL,gmsgScoreInfo) 
	  	write_byte(user) 
	  	write_short(frags) 
	  	write_short(deaths) 
	  	write_short(0) 
	  	write_short(teams) 
	  	message_end()
  	}
	return PLUGIN_HANDLED 
} 


public plugin_init()
{
	register_plugin("Change Score","2.0.5","Freecode")
	register_clcmd("amx_chscore","chscore",ADMIN_CVAR," - amx_chscore <nick/@CT/@TERRORIST> <frags #> <deaths #>")
	gmsgScoreInfo = get_user_msgid("ScoreInfo")
}
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-19-2018 , 03:31   Re: [HELP] Change team score in scoreboard?
Reply With Quote #3

Quote:
Originally Posted by raizo11 View Post
Code:
CODE...
Thank you for responding!
But does this plugin change TEAM score or just player score?
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731
GoldNux is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 04-19-2018 , 03:59   Re: [HELP] Change team score in scoreboard?
Reply With Quote #4

team and player

Last edited by raizo11; 04-19-2018 at 04:01.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-19-2018 , 04:43   Re: [HELP] Change team score in scoreboard?
Reply With Quote #5

Quote:
Originally Posted by raizo11 View Post
team and player
Thank you I am very grateful!

I would like to implement this in a plugin that keeps track of the team scores.
It stores the team scores in two variables that change whenever a win sound is played.

Instead of printing the scores to chat:
console_cmd(0, "say CT: %d | T: %d <~>", g_ScoreCT, g_ScoreT)

I like it to change the scores on the scoreboard.
What part of the code would I use for this?

I'm still trying to learn to use messages.
And I am not familiar with editing team scores.

Care to maybe explain a little?

Thank you very much.


edit: I found this thread. https://forums.alliedmods.net/showthread.php?t=233339
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 04-19-2018 at 05:14.
GoldNux is offline
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 09:40.


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