AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [Any] Set team score (https://forums.alliedmods.net/showthread.php?t=319888)

mikigoaIie 11-25-2019 05:00

[Any] Set team score
 
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?

8guawong 11-25-2019 05:40

Re: [Any] Set team score
 
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

mikigoaIie 11-25-2019 08:19

Re: [Any] Set team score
 
Quote:

Originally Posted by 8guawong (Post 2674387)
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


All times are GMT -4. The time now is 20:26.

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