AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Top Flags [11/02/2020][GameMe Support] (https://forums.alliedmods.net/showthread.php?t=310322)

iceeedr 08-29-2018 19:43

Top Flags [11/02/2020][GameMe Support]
 
26 Attachment(s)
Public Info:

Tired of getting edit users.ini to give the VIP to your server's TOP? Let me tell you a secret ..

With this plugin will you automatically give TOP rank players the flags that you decide and know best? No need to edit anything on the server !! And if the player leaves the TOPS ranking, it will also automatically remove the flags;)

Good for the 4fun / 32 slots servers, so the top15 automatically receives the flag, which helps the server to get full, by the top15 dispute.

Servers Using this plugin:

Here o/.

Requirements:

* CS mod
* AMXX >= 1.9
* Compile locally

All cvars:

* tf_ranks "x" ~> Range of players that will receive the flags based on rank. (Top 1, 2, 5, 10, 15 etc
* tf_flags "x"~> The flags that TOP players will receive.
* tf_restricted "x"~> Players with any of the flags set there will be ignored.
* tf_rank_reset "x" ~> A simple way to choose if you wanna reset your rank or not
* tf_days_toreset "x" ~> Set an interval in days for resetting cs stats.
* tf_skipadmins "x" ~> SkipAdmins to count topX ?
* tf_update_rank_time "x" ~> Time interval to update ranks

Pay close attention!!
If you do not want to reset your rank, leave the "tf_rank_reset 0" on Topflags.cfg (amxmodx/configs/plugins/)
The .cfg file will be created on the first boot of the plugin.


Frequently Asked Questions!

How should I configure CFG correctly?

Come on:
tf_ranks "10" (I want to reward the top 10 of the rank!)

tf_flags "bde" (I will give them the flags "bde")

tf_restricted "acfghijklmnopqrstu" (If I'm going to reward with the "bde" flags, you will add all the flags in amxmodx, except the ones you are giving to the players. (Remember to never use the "z" flag that is from player.)

tf_rank_reset "1" (I want to automatically reset my ranking, reset cstatx.dat [TOP15])

tf_days_toreset "20" (Every 20 days.)

tf_skipadmins "1" (I don't want you to count my admins on TOP. (Example, I'm rewarding the top 10, but 3 of them are admins, so I ignore them and award the first 13 (10 + 3 *admins ignored *).)

tf_update_rank_time "240" (Time in seconds the ranking is checked for awards.)


Obs:

~> I was not going to post the plugin because it is very simple and has a good variation of it in allied itself .. but as I did not find one that worked I decided to post it .. Thanks to Natsheh and edon1337 for the help in fixing some initial problems.

Update history:

Code:

History:
0.1 [29/08/2018]
* First release

0.2 [30/08/2018]
* Fixed for amxx 1.8.2

0.3 [30/08/2018]
* Minor fixes
* Now the VIP / ADM is checked throughout Spawn. (thanks for the tip edon1337)
* Added a new cvar to not give the VIP flags to those who have the flags configured there.

1.0 [20/09/2018]
* Major Update
* Completely rewritten
* Less code, to do the same more efficiently

1.1 [27/09/2018]
* Added a delay in spawn, apparently in hamspawnpost the top15 has not yet
 been updated. And the players would only gain / lose the flag in the other spawn.

1.2 [29/09/2018]
* Added a cvar tf_day_reset
* Added the automatic creation of the configuration file "topflags" in the configs folder, it is no longer necessary to edit the sma.

1.3 [30/09/2018]
* Minor fixes pointed by bugsy

1.4 [03/10/2018]
* Since the amxx 1.9 is finally to be released, the plugin no longer supports previous versions.

1.5 [05/10/2018]
* Plugin all updated with the new natives of amxx 1.9

1.6 [05/10/2018]
* Days count for the reset totally reformulated by Bugsy
* Added new pcvar to enable or disable reset function stats
* Added an #error message if you try to compile sma in versions lower than amxx 1.9

1.7 [27/02/2019]
* Added a define to exclude Admins of the TOPS count, example: I want the top 5 to win the flag, but of the top 5, 3 of them are admins, so only 2 common players would be contemplated, but now, the 5 will be, since adms count is added to the check factor.

1.8 [23/05/2019]
* Small fix, thanks to glmmlg

2.0 (Because of the size of the update, we skipped 1.x) [23/07/2019]
* Changed from #define skipadmins to boolean variable
* Added support for multi language
* Fixed a potential issue detecting the player if it is in TOP 1
* New CVARS Added

3.0 [11/02/2020]
* Added support to GameMe * Thanks to iclassdon for the idea.

Final considerations:

Thanks for the notes and support Ocix, Bugsy and edon1337.

Natsheh 08-29-2018 21:21

Re: Top Flags [29/08/2018]
 
You forgot to upload the script also you should make it compatible with amx v182 since its the official stabled.

iceeedr 08-29-2018 21:54

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by Natsheh (Post 2612776)
You forgot to upload the script also you should make it compatible with amx v182 since its the official stabled.

Oops I did not realize, probably the internet bugged. Thanks for the warning, I will make it compatible with the stable version.

edon1337 08-30-2018 07:57

Re: Top Flags [29/08/2018]
 
I think you should use is_user_admin instead of caching it's value on client_putinserver, you never know what admin system the user is going to use, for example I made one that updates admin list every second.

Natsheh 08-30-2018 08:36

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by edon1337 (Post 2612829)
What makes you think speaking in a foreign language makes you look any smart?

As of Google Translate:
-

Because I didn't like the idea of waiting an entire map for admin list to reload.

Every heard of amx_reloadadmins cmd or you can even read the user.ini file everytime some1 connects instead of reading the file in plugin init.

edon1337 08-30-2018 08:39

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by Natsheh (Post 2612834)
Every heard of amx_reloadadmins cmd or you can even read the user.ini file everytime some1 connects instead of reading the file in plugin init.

Well Sherlock, amx_reloadadmins is not called automatically and by default the file reading is done in plugin_init.

Natsheh 08-30-2018 08:56

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by edon1337 (Post 2612835)
Well Sherlock, amx_reloadadmins is not called automatically and by default the file reading is done in plugin_init.

Iknow thats why you can call it on each player connects
Rather than setting a task to be executed each second,

File reading Thats what im telling you about you can change it to client putin or other

edon1337 08-30-2018 09:01

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by Natsheh (Post 2612841)
Iknow thats why you can call it on each player connects
Rather than setting a task to be executed each second,

We're not here to discuss about the example I gave, I know there's better ways, it was just an example.

What I'm pointing at is, if someone connects to a server and he isn't an admin, isAdmin bool gets ticked false for him, and later on, he receives admin, isAdmin still remains false for him, that's why he should use is_user_admin instead of caching the value.

Natsheh 08-30-2018 09:11

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by edon1337 (Post 2612847)
We're not here to discuss about the example I gave, I know there's better ways, it was just an example.

What I'm pointing at is, if someone connects to a server and he isn't an admin, isAdmin bool gets ticked false for him, and later on, he receives admin, isAdmin still remains false for him, that's why he should use is_user_admin instead of caching the value.

You do make point, but he should never check if the user is admin, some admins might have not those flags and be in the top list, so they won't be able to gain them.

iceeedr 08-30-2018 09:33

Re: Top Flags [29/08/2018]
 
Quote:

Originally Posted by Natsheh (Post 2612851)
You do make point, but he should never check if the user is admin, some admins might have not those flags and be in the top list, so they won't be able to gain them.

Exactly, the idea is that Admins do not receive the designated flags, because they would be flags that they supposedly already would have, being only flags used for players that will win the Vip, saving the value in the putinserver I conserve only the Admins that already have the flags in the users.ini, as well explained by you, but I am open to ideas.


All times are GMT -4. The time now is 21:53.

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