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

Remember The Teams


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 07-09-2017 , 14:35   Remember The Teams
Reply With Quote #1

Remember The Teams


Description

After time runs out and map changes or admin changes the map using amx_map,
this plugin saves the current teams and loads them on the next map.
This will not work with changelevel <map>.

Requirements
Recommended AMXX 1.8.2 or higher

Includes
< cstrike >
< nvault >

Installation
1. Place the plugin remember_the_teams.amxx into your plugins directory (addons/amxmodx/plugins)
2. Open plugins.ini (addons/amxmodx/configs) and add remember_the_teams.amxx ON TOP of amxmodx base plugins (see example below)
3. Add mapsdata.txt to your configs directory
4. Add your server's mapcycle maps (or all valid maps) into mapsdata.txt (each map on a new line)
5. Reload the map.

Example of plugins.ini:
Spoiler

Example of mapsdata.txt:
Spoiler

Usage
Just wait for the timelimit to run out or use amx_map <mapname>
Command amx_map works only for the maps you've saved into mapsdata.txt.
Why? Before we can start saving the teams, plugin needs to check the arguments when amx_map is used to check if the changed map is valid.
So add only VALID maps in mapsdata.txt

Changelog
Code:

0.0.1
 	- Initial release

0.0.2
 	- Added clearing old nVault entries

0.0.3
 	- Some code fix

0.0.4
 	- Blocked jointeam commands 1 minute before map change 
   	  and for sometime after change

0.0.5
 	- Added check if someone joins when teams are already written

0.0.6
 	- Fixed error

0.0.7
 	- Moved 0.0.5 update to client_putinserver where its supposed to be

0.0.8
 	- Small change in code


Credits
This post
• I took parts of auto-join code from Auto Join On Connect by VEN
• Learned Tries based on how this was made

Source
Spoiler
Attached Files
File Type: txt mapsdata.txt (192 Bytes, 206 views)
File Type: sma Get Plugin or Get Source (remember_the_teams.sma - 652 views - 6.3 KB)
__________________

Last edited by Rohanlogs; 08-28-2017 at 15:43.
Rohanlogs is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-09-2017 , 18:11   Re: Remember The Teams
Reply With Quote #2

This is useless whether you can change your team after the join. You can use client_disconnect() instead of a few functions to check if the map was changed.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-09-2017 , 19:15   Re: Remember The Teams
Reply With Quote #3

Hi,

TBH, that's a bad indentation and bad practice.
In Task you don't need to store big numbers.
Don't use get_maxplayers to make a loop to check "something" always get the real number of connected players using get_players().
Use switch instead of if and else if because it's more efficient&cleaner and faster ...
Code:
public task_force_team_join( menu_msgid[], id ) 
{
	if ( get_user_team(id) )
		return

	force_team_join( id, menu_msgid[0] )
}
It's used one time so you can use it directly without using set_task.
You don't need to close nvault at every changement so it's better to let it open and do ur stuff and then call nvault_close() in plugin_end.
It's always good to dispose objects to free up memory ( I'm talking about Array:X and Trie:X ).
There is also something called charsmax which is a macro replace sizeof (X) - 1.
Sometimes you use stock and sometimes no! I don't understand why.

Good luck.
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.
SpawnerF is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 07-10-2017 , 11:43   Re: Remember The Teams
Reply With Quote #4

Thanks..
__________________
Rohanlogs is offline
Reply



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 06:59.


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