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

Round End, Draw Block with Fake Client's


Post New Thread Reply   
 
Thread Tools Display Modes
Author
graczu
Senior Member
Join Date: Mar 2006
Plugin ID:
639
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plugin Creat two Fake Client's CT and TT. Set on Them GoodMode and Hide.
    Old 11-18-2008 , 04:35   Round End, Draw Block with Fake Client's
    Reply With Quote #1

    Simply Plugin spawn 2 Bot's that join CT and Terro Team. Set on them GoodMode and set them Invisible.

    I made it for my Surf Server where i have Auto Respawn's, for that if on server are only Two Player's round's dont end and dont draw.

    Peace:
    Glow Function i got from "ferret" Glow Plugin (http://forums.alliedmods.net/showthread.php?p=497949)

    Code:
    #include <sourcemod>
    #include <sdktools>
    #include <cstrike>
    
    
    new const String:CTBOT[] = "CT MASTER";
    new CtBotID;
    new const String:TTBOT[] = "TT MASTER";
    new TtBotID;
    new Score = -100;
    new CollOff;
    
    enum FX
    {
    	FxNone = 0,
    	FxPulseFast,
    	FxPulseSlowWide,
    	FxPulseFastWide,
    	FxFadeSlow,
    	FxFadeFast,
    	FxSolidSlow,
    	FxSolidFast,
    	FxStrobeSlow,
    	FxStrobeFast,
    	FxStrobeFaster,
    	FxFlickerSlow,
    	FxFlickerFast,
    	FxNoDissipation,
    	FxDistort,               // Distort/scale/translate flicker
    	FxHologram,              // kRenderFxDistort + distance fade
    	FxExplode,               // Scale up really big!
    	FxGlowShell,             // Glowing Shell
    	FxClampMinScale,         // Keep this sprite from getting very small (SPRITES only!)
    	FxEnvRain,               // for environmental rendermode, make rain
    	FxEnvSnow,               //  "        "            "    , make snow
    	FxSpotlight,     
    	FxRagdoll,
    	FxPulseFastWider,
    };
    
    enum Render
    {
    	Normal = 0, 		// src
    	TransColor, 		// c*a+dest*(1-a)
    	TransTexture,		// src*a+dest*(1-a)
    	Glow,				// src*a+dest -- No Z buffer checks -- Fixed size in screen space
    	TransAlpha,			// src*srca+dest*(1-srca)
    	TransAdd,			// src*a+dest
    	Environmental,		// not drawn, used for environmental effects
    	TransAddFrameBlend,	// use a fractional frame value to blend between animation frames
    	TransAlphaAdd,		// src + dest*(1-a)
    	WorldGlow,			// Same as kRenderGlow but not fixed size in screen space
    	None,				// Don't render.
    };
    
    new FX:g_Effect = FX:FxGlowShell;
    new Render:g_Render = Render:Glow;
    
    #define TEAM_1    2
    #define TEAM_2    3
    #define VERSION    "1.1"
    
    public Plugin:myinfo = {
    	name = "EndRound Blocker",
    	author = "graczu_-",
    	description = "Block Endround on SURF",
    	version = VERSION,
    	url = "http://www.sourcemod.net/"
    };
    
    public OnPluginStart()
    {
    	CollOff = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
    	HookEvent("player_spawn", PlayerSpawn);
    }
    
    public OnMapStart()
    {
    	CreateTimer(5.0, CreatBots, 0);
    }
    
    public Action:CreatBots(Handle:timer){
    	CreateFakeClient(CTBOT);
    	CreateFakeClient(TTBOT);
    	botSwitch();
    }
    
    botSwitch(){
    	new mc = GetMaxClients();
    	for( new i = 1; i < mc; i++ ){
    		if( IsClientInGame(i) && IsFakeClient(i)){
    			decl String:target_name[50];
    			GetClientName( i, target_name, sizeof(target_name) );
    			if(StrEqual(target_name, CTBOT)){
    				CtBotID = i;
    				CS_SwitchTeam(CtBotID, TEAM_1);
    				CS_RespawnPlayer(CtBotID);
    				SetEntProp(i, Prop_Data, "m_iFrags", Score);
    			} else if(StrEqual(target_name, TTBOT)){
    				TtBotID = i;
    				CS_SwitchTeam(TtBotID, TEAM_2);
    				CS_RespawnPlayer(TtBotID);
    				SetEntProp(i, Prop_Data, "m_iFrags", Score);
    			}
    		}
    	}
    }
    
    public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
    {
    	new client = GetClientOfUserId(GetEventInt(event, "userid"));
    //	new Team = GetClientTeam(client);
    	if(client == CtBotID){
    		hideBot(client);
    	} else if(client == TtBotID){
    		hideBot(client);
    	}
    }
    
    public hideBot(any:client){
    	SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
    	SetEntData(client, CollOff, 2, 4, true);
    	set_rendering(client, g_Effect, 0, 0, 0, g_Render, 0);
    	new Float:loc[3];
    	loc[0] = 10000.0;
    	loc[1] = 10000.0;
    	loc[2] = 10000.0;
    	TeleportEntity(client, loc, NULL_VECTOR, NULL_VECTOR); 
    }
    
    stock set_rendering(index, FX:fx=FxNone, r=255, g=255, b=255, Render:render=Normal, amount=255)
    {
    	SetEntProp(index, Prop_Send, "m_nRenderFX", _:fx, 1);
    	SetEntProp(index, Prop_Send, "m_nRenderMode", _:render, 1);
    
    	new offset = GetEntSendPropOffs(index, "m_clrRender");
    	
    	SetEntData(index, offset, r, 1, true);
    	SetEntData(index, offset + 1, g, 1, true);
    	SetEntData(index, offset + 2, b, 1, true);
    	SetEntData(index, offset + 3, amount, 1, true);
    }
    ;-)

    Update:

    Added bot teleport.
    Attached Files
    File Type: sp Get Plugin or Get Source (bot_endround.sp - 8789 views - 3.7 KB)
    __________________

    Last edited by graczu; 07-10-2009 at 08:59.
    graczu is offline
    Lebson506th
    Veteran Member
    Join Date: Jul 2008
    Old 11-18-2008 , 10:11   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #2

    When an entire team dies in CS:S, it starts a new round.

    This stops that from happening by adding an invincible and invisible bot to each team.
    __________________
    My Plugins
    Spray Tracer by Nican, maintained by me
    Simple TK Manager
    DoD:S Admin Weapons

    Links
    Resistance and Liberation (A HL2 Multiplayer Modification)
    Lebson506th is offline
    graczu
    Senior Member
    Join Date: Mar 2006
    Old 11-18-2008 , 18:46   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #3

    On round start "PlayerSpawn" event dont working?. Player's are Spawning yes?. So it's should work.
    __________________
    graczu is offline
    Lebson506th
    Veteran Member
    Join Date: Jul 2008
    Old 11-18-2008 , 19:04   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #4

    I was just answering Liam's question.
    __________________
    My Plugins
    Spray Tracer by Nican, maintained by me
    Simple TK Manager
    DoD:S Admin Weapons

    Links
    Resistance and Liberation (A HL2 Multiplayer Modification)
    Lebson506th is offline
    SAMURAI16
    BANNED
    Join Date: Sep 2006
    Old 11-19-2008 , 04:49   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #5

    all glow stuff already exists on SM Core. You don't need to add it on your plugin
    SAMURAI16 is offline
    Send a message via MSN to SAMURAI16
    Sammy-ROCK!
    Senior Member
    Join Date: Jun 2008
    Location: Near Mrs.Lag
    Old 11-26-2008 , 22:08   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #6

    Why can't you simply hook round_restart and round_end events and return Plugin_Handled on them?
    Sammy-ROCK! is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 11-27-2008 , 02:41   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #7

    Events don't actually control anything, they just report when certain things happen.
    bl4nk is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 01-22-2009 , 04:27   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #8

    If I try to change something and recompile it, the bots are no longer invisible.

    Also when this is enabled in the server browser two slots are hidden, instead of showing it being two bots in the server, can this be fixed/changed?

    If so can you please add that to a feature request.
    __________________
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    FireStorm
    New Member
    Join Date: Mar 2009
    Old 05-21-2009 , 13:40   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #9

    Thank you for this plugin!
    But bots are still visible I think that it will be a good idea to teleport them somewhere outside the map.
    I have no experience in sourcepawn, so my sode isn't pretty

    Quote:
    new Float:loc[3];
    loc[0] = 10000.0;
    loc[1] = 10000.0;
    loc[2] = 10000.0;
    TeleportEntity(client, loc, NULL_VECTOR, NULL_VECTOR);
    This code should be inserted in hideBot function.
    FireStorm is offline
    graczu
    Senior Member
    Join Date: Mar 2006
    Old 07-10-2009 , 09:00   Re: Reound End, Draw Block with Fake Client's
    Reply With Quote #10

    Quote:
    Originally Posted by FireStorm View Post
    Thank you for this plugin!
    But bots are still visible I think that it will be a good idea to teleport them somewhere outside the map.
    I have no experience in sourcepawn, so my sode isn't pretty



    This code should be inserted in hideBot function.
    Good idea, updated. THX
    __________________
    graczu 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 13:42.


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