Raised This Month: $18 Target: $400
 4% 

[Any] Set team score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mikigoaIie
New Member
Join Date: Nov 2019
Old 11-25-2019 , 06:00   [Any] Set team score
Reply With Quote #1

Hi,

I am looking for a plugin that is able to set team score (assuming its possible). I want the plugin to set and save score values, but with most plugins, the game will on event RoundEnd just reset the scores to its normal values.

Code:
public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
	if(GetConVarInt(timeCvar) == 2) {
		SetTeamScore(2, CS_GetTeamScore(2) + GetConVarInt(team2Cvar));
		SetTeamScore(3, CS_GetTeamScore(3) + GetConVarInt(team3Cvar));
	}
}
Which is kinda working, at the next round there is cvar value + normal value, however when I try to call GetTeamScores at the end of each round, it will return normal values (without +cvar), any idea?

Last edited by mikigoaIie; 11-25-2019 at 06:06. Reason: d
mikigoaIie is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 11-25-2019 , 06:40   Re: [Any] Set team score
Reply With Quote #2

put this into your server.cfg or gamemode_*_server.cfg
and see if it fixes your problem
or just set the score on round start :p
__________________

Last edited by 8guawong; 11-25-2019 at 06:41.
8guawong is offline
mikigoaIie
New Member
Join Date: Nov 2019
Old 11-25-2019 , 09:19   Re: [Any] Set team score
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
put this into your server.cfg or gamemode_*_server.cfg
and see if it fixes your problem
or just set the score on round start :p
Well, I can set scores at the round start, it will also work as intended (lets say my cvar is 5 for both, and CT will win a round, then it is 6-5 CT side), HOWEVER when I try to call CS_GetTeamScore in event_roundend, it will always return true values (example 1-0 for CT instead of 6-5), is there a way how to fix it?

Spoiler


**don't judge if my coding is awful, I am not really a programmer at all, just want this to work

Last edited by mikigoaIie; 11-25-2019 at 09:22.
mikigoaIie is offline
Reply


Thread Tools
Display Modes

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 01:41.


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