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

Current round number [CS:S]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ventycz
New Member
Join Date: Jan 2017
Location: Liberec, Czech Republic
Old 01-29-2017 , 18:06   Current round number [CS:S]
Reply With Quote #1

Hey there,
I'm making a CS:S only plugin for our server & I'd like to know if there's a way to get the current round number through the Sourcemod API, or not.

Right now, I'm using CS_GetTeamScore for both teams & I combine them to get the number of played rounds (adding 1 on the round start to display current round number in the chat).

Is there an other way to accomplish this ?

Also another question, does mp_restartgame also reset all the map related limits (max time per map, max rounds...) ?

Thanks for your insight!
ventycz is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-29-2017 , 19:19   Re: Current round number [CS:S]
Reply With Quote #2

I think you need to count the round_end events since map start and reset the counter, if the round end reason is CSRoundEnd_GameStart.
Yes, i think mp_restartgame resets all counts.
__________________
Peace-Maker is offline
ventycz
New Member
Join Date: Jan 2017
Location: Liberec, Czech Republic
Old 02-01-2017 , 13:54   Re: Current round number [CS:S]
Reply With Quote #3

Quote:
Originally Posted by Peace-Maker View Post
I think you need to count the round_end events since map start and reset the counter, if the round end reason is CSRoundEnd_GameStart.
Yes, i think mp_restartgame resets all counts.
I'm creating something very similar to this plugin (which is doing what you have suggested), but it was broken when I used.
So I decided to make my own plugin.

Side question, I'm using the latest SM 1.7+ syntax (similar to C#) & I'm getting a lot of "simbol is never used" warnings, because of the hooked events, but when I remove the arguments (which several languages would allow) I get (of course) the "functions prototypes do not match". Is there a way to disable these warnings or something?
ventycz is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 02-01-2017 , 14:03   Re: Current round number [CS:S]
Reply With Quote #4

Can you paste some code where you get that warning? Unused arguments are ignored when the function is marked public, which your callbacks should be.
__________________
Peace-Maker is offline
ventycz
New Member
Join Date: Jan 2017
Location: Liberec, Czech Republic
Old 02-01-2017 , 15:04   Re: Current round number [CS:S]
Reply With Quote #5

Quote:
Originally Posted by Peace-Maker View Post
Can you paste some code where you get that warning? Unused arguments are ignored when the function is marked public, which your callbacks should be.
Oh, that's logical (if it's included). I changed all the callbacks to public, that "fixed" it. Thanks for it
ventycz is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 05-02-2020 , 19:28   Re: Current round number [CS:S]
Reply With Quote #6

GameRules_GetProp("m_totalRoundsPlayed");
joao7yt is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 05-03-2020 , 13:32   Re: Current round number [CS:S]
Reply With Quote #7

Quote:
Originally Posted by joao7yt View Post
GameRules_GetProp("m_totalRoundsPlayed");
That's in CS:GO I guess. Don't see it in CS:S.
__________________
Peace-Maker is offline
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 05-03-2020 , 15:17   Re: Current round number [CS:S]
Reply With Quote #8

dump the netprops using sm_dump_netprops netprops.txt and search for something like m_totalRoundsPlayed, maybe it's a different name
joao7yt is offline
NanoC
Veteran Member
Join Date: Jan 2016
Location: Argentina
Old 05-03-2020 , 15:48   Re: Current round number [CS:S]
Reply With Quote #9

Maybe..?
PHP Code:
ROUND = %d", GetTeamScore(2)+GetTeamScore(3)); 
__________________

Last edited by NanoC; 05-03-2020 at 15:48.
NanoC is offline
Send a message via Skype™ to NanoC
joao7yt
Senior Member
Join Date: Nov 2014
Location: Brazil
Old 05-03-2020 , 15:50   Re: Current round number [CS:S]
Reply With Quote #10

Hmmm does css has overtime system? If not, then this can be a solution
joao7yt 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 02:12.


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