Raised This Month: $ Target: $400
 0% 

[HELP] Change team score in scoreboard?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 04:39.


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