Raised This Month: $32 Target: $400
 8% 

Fail Spawn Protector + Team Limiter


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   HamletEagle (36)
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-17-2014 , 01:00   Fail Spawn Protector + Team Limiter
Reply With Quote #1

Description:
This simple and useful plugin will protect you from dying due to bad spawn location. Now, you can spawn more players than existed spawn points inside map. This plugin is tested on special map with 32 spawnpoints at identical origin and its works nicely. Just visit this thread to read more about the testing.
What can you edit?
PHP Code:
    g_iStartDistance register_cvar("fw_StartDistance""32"// First search distance for finding a free location in map
    
g_iMaxAttempts register_cvar("fw_MaxAttempts""128"// How many times to search in an area for a free space 
    
g_iTerrorMaxSpawn register_cvar("fw_TerrorMaxSpawn""0"// Maximum Terror spawn entities. If you want to disable it, just add "0" value
    
g_iCTMaxSpawn register_cvar("fw_CTMaxSpawn""0"// Maximum CT spawn entities. If you want to disable it, just add "0" value 
Example:
This messages are printed in your server console:
PHP Code:
L 06/17/2016 17:09:54: -------- Mapchange to cs_assault --------
[
Fail Spawn ProtectorCreating new file
[Fail Spawn ProtectorDeleting old file
[Fail Spawn ProtectorRequired 3 less Terror spawn entities!
[
Fail Spawn ProtectorAuto reload
[Fail Spawn ProtectorRequired 3 less CT spawn entities!
[
Fail Spawn ProtectorAuto reload
[Fail Spawn ProtectorCS Spawn Entity10 || Terror Spawn Entity10
[Fail Spawn ProtectorServer is reloading
L 06
/17/2016 17:09:55: -------- Mapchange to cs_assault --------
[
Fail Spawn ProtectorCreating new file
[Fail Spawn ProtectorDeleting old file
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorCT original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorTerror original spawn is remove
[Fail Spawn ProtectorCS Spawn Entity|| Terror Spawn Entity
Note!
This plugin need at least 1 valid spawn point in the map. This plugin also do not prevent connected player. It only removing or adding the spawn entity.
Team Limiter:
If you want to use this feature,just follow below method:

1. Just uncomment this part:
PHP Code:
// Uncomment 'AUTO_SPAWNCREATOR' if your want to enable auto spawn creator
//#define AUTO_SPAWNCREATOR 
2. Then, edit this cvars:
PHP Code:
    g_iTerrorMaxSpawn register_cvar("fw_TerrorMaxSpawn""0"//  Maximum Terror spawn entities. If you want to disable it, just add "0"  value
    
g_iCTMaxSpawn register_cvar("fw_CTMaxSpawn""0"// Maximum CT  spawn entities. If you want to disable it, just add "0" value 
3. fw_TerrorMaxSpawn cvar is represent for Terrorist amount per team.
4. fw_CTMaxSpawn cvar is represent for CT amount per team.
Rare Problem!
If the spawn entities configure via fw_TerrorMaxSpawn cvar and fw_CTMaxSpawn cvar is less than the original spawn entity, the player still be spawned at the beginning of round. As example, original spawn point is 10. If we configured it into 1, then all 10's player will be spawned at the same spawn location. So, what will happen, after round started, random player will died automatically until alive player is equal to new spawn entities or points.
Credits:
1. xPaw.
2. VEN.
3. Arkshine.
4. Phant (Testing the code in his special map).
Changelog:
Code:
v1.1 (6 Dis 2015)
- [FIXED] Remove unnecessary bool.
- [FIXED] Using existing defined code.
- [FIXED] Variable naming.

v1.2 - (17 Jun 2016)
- [FIXED] First safely spawn player will be killed by worldspawn.
- [ADDED] Safety check via player origin to determine whether player is idle or not.
- [ADDED] Auto-spawn creator and team limiter features.
Downloads:

v1.0 - 40
v1.0 - 99

Feel free to use it.
Attached Files
File Type: sma Get Plugin or Get Source (fail_spawn_protector.sma - 1887 views - 11.9 KB)

Last edited by zmd94; 08-24-2021 at 12:41.
zmd94 is offline
 


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 20:05.


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