[CS:GO] How to get team count ? CT/T
Hi! I'm trying to create my own beacon plugin that checks how many T are left and if only 1 left then add beacon on the last T client.
Code:
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast){ I'm completely new to sourcepawn and trying to figure stuff out :D Thanks in advance. |
Re: [CS:GO] How to get team count ? CT/T
Didn't test but would be something like this.
PHP Code:
|
Re: [CS:GO] How to get team count ? CT/T
For readable code, above post is good example.
This example is just... with trick. PHP Code:
|
Re: [CS:GO] How to get team count ? CT/T
Bacardi, we can improve the algorithm a little more:
PHP Code:
|
Re: [CS:GO] How to get team count ? CT/T
That for loop and if statement is wierdest thing I have seen in web :D
|
Re: [CS:GO] How to get team count ? CT/T
Micro-optimizations like this don't bring many advantages.
Readability and a clean code, IMO - based IRL daily experience - should be a priority instead of the code lines amount, especially in a death hook event. (unless you are in a big and repeatable loop) But, EventHookMode_PostNoCopy was a good catch. Anyway, all snippets are good examples of how to achieve what OP wants. |
Re: [CS:GO] How to get team count ? CT/T
Thank you everyone. I got to see all the possible ways to do it! Thanks!
|
All times are GMT -4. The time now is 22:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.