Raised This Month: $209 Target: $400
 52% 

Swap team spawns


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2009 , 01:33   Swap team spawns
Reply With Quote #1

Swap team spawns v1.4
Author: Digi (aka Hunter-Digital)

Description:
It swaps team spawns and buyzones.
This means that the CT team can spawn on de_dust2 in the Terrorist's base and the Terrorists in the CT base near the bombsites, you can also set mp_c4timer to 90 or 60, then the terrorists plant the bomb and let the time-pressing assault begin (just an example usage )

CVars:
- mp_swapspawns 0/1/2
0 = normal team spawns
1 = swapped team spawns
2 = swap teams each round
CVar Notes: This cvar resets itself to 0 at mapstart, use in map configurations to enable it for maps you want it to be enabled for.

- mp_swapround 0/x (Only works if "mp_swapspawns" is set to 2)
0 = don't use it, swap each round
x = swap at this round when reached
CVar Notes: This cvar resets itself to 0 at mapstart, use in map configurations to enable it for maps you want it to be enabled for.

- mp_showswapping 0/1/2
0 = do not show messages
1 = show messages when teams swap by cvar set to 1
2 = show messages when teams swap by cvar set to 1 OR 2 (each round)
CVar Notes: This cvar does not reset itself.

Modules used:
- Engine

Credits:
- Buy zone team discussions, that helped me with the buyzone switching
- stupok for his code with storing values and getting to switch spawns without deleting the extra ones
- meigyoku for the swapping at the X round ideea

Change Log:
Version 1.4
- some minor optimizations
- fixed message not showing when swapping set back to normal
- new cvar "mp_swapround", if "mp_swapspawns" is set to 2, only after the X round the team spawns will swap.
- now using only one log event hook for restart and round end
- when checking for online players, added to exclude hltv besides bots
- optimized code following stupok's tips too
- optimized code following Hawk552's tips
- removed the DELAY_FLOOD define because it wasn't needed anymore
Version 1.3:
- Changed name and variables to the "swap team spawns" style
- Added "swapspawns_version" public variable
- Changed so that spawns swap only at round end to prevent spawn conflicts
- Changed command into cvar for simple usage
- Added option to swap team spawns each round
- Added option to print a message when swapping occurs
Version 1.2: Re-coded to allow mid-game switch and not deleting extra spawns
Versions 1.1 and below: Release and modifications (forgot what exacly, doesn't matter anyway)


This plugin can be compiled via Web Compiler (aka "Get Plugin")
Attached Files
File Type: sma Get Plugin or Get Source (swap_spawns.sma - 3349 views - 9.2 KB)
__________________

Last edited by Hunter-Digital; 08-23-2009 at 00:52.
Hunter-Digital is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-12-2009 , 01:36   Re: Reverse Player Spawns
Reply With Quote #2

Why not?

Nice
__________________
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-12-2009 , 01:38   Re: Reverse Player Spawns
Reply With Quote #3

What if a map has 16 CT spawns and only 10 T spawns ?
You could delete 6 CT spawns to fix that possible issue.
__________________
- tired and retired -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2009 , 01:40   Re: Reverse Player Spawns
Reply With Quote #4

Why not what ?

Yes, those 6 extra spawns are removed, until I find a better way to switch them without deleting any :}

hmm... just got an ideea, let me just test it...
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-12-2009 , 01:45   Re: Reverse Player Spawns
Reply With Quote #5

Also, where is the place to set the cvar to 1 ?

I mean, you are resetting it to 0 on plugin_init, plugin_cfg is called 1sec after it, but amxx.cfg is random¨y executed from plugin_init and per maps configs are randomly executed like 6.1 sec after plugin_cfg.
So, per maps settings will fail.

I suggest to add a command instead of a cvar.

-edit-
For those 6 extra spawns, i remember haveing tried to alter classname and failed.
__________________
- tired and retired -

Last edited by ConnorMcLeod; 08-12-2009 at 01:48.
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2009 , 01:54   Re: Reverse Player Spawns
Reply With Quote #6

That ideea doesn't work, wanted to rename them (edit: yes, the classname thing, doesn't seem to want to work)

Oh well, new version uploaded... you can toggle spawn reversing mid-game now.
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-12-2009 , 02:00   Re: Reverse Player Spawns
Reply With Quote #7

Now you need to add something so you don't delete those 6 ents so when you toggle you can retrieve them
__________________
- tired and retired -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-12-2009 , 03:08   Re: Reverse Player Spawns
Reply With Quote #8

Well it seems I can't create spawn points O.o I searched for all codes I could search, nothing worked, they all spawn me at 0 0 0 even tough the entity's position is where it should be...
__________________
Hunter-Digital is offline
alias_retaer
Member
Join Date: Jul 2009
Old 08-12-2009 , 04:38   Re: Reverse Player Spawns
Reply With Quote #9

nice plugin dude.
alias_retaer is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-12-2009 , 06:42   Re: Reverse Player Spawns
Reply With Quote #10

Like it! +k
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
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 12:20.


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