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

Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author
xoxo_
Junior Member
Join Date: Sep 2018
Location: Israel
Plugin ID:
6319
Plugin Version:
1.00
Plugin Category:
All
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 10-30-2018 , 02:31   Spawn Protection
    Reply With Quote #1

    Description:

    This plugin is very useful for surfing servers, and fun. The plugin makes 10 seconds protecting all the players and after that you can kill .


    Installation:

    addons / sourcemod / plugins

    My Steam: https://steamcommunity.com/id/bar36892/
    Attached Files
    File Type: smx spawnProtection.smx (5.9 KB, 315 views)
    File Type: sp Get Plugin or Get Source (spawnProtection.sp - 1132 views - 2.0 KB)

    Last edited by xoxo_; 10-30-2018 at 06:21.
    xoxo_ is offline
    BReeZ
    AlliedModders Donor
    Join Date: Feb 2013
    Location: Denmark
    Old 10-31-2018 , 08:49   Re: Spawn Protection
    Reply With Quote #2

    Haven't tested your plugin, but this is already a thing:
    https://forums.alliedmods.net/showthread.php?p=2324123
    __________________
    BReeZ is offline
    skyler.b
    AlliedModders Donor
    Join Date: Dec 2017
    Location: israel
    Old 10-31-2018 , 09:21   Re: Spawn Protection
    Reply With Quote #3

    I think it is a nice plugin well coded but as BReeZ was saying there is such a thing
    come up with something you
    __________________
    Taking private requests

    part of the gurney is the end.
    skyler.b is offline
    xoxo_
    Junior Member
    Join Date: Sep 2018
    Location: Israel
    Old 05-06-2019 , 05:20   Re: Spawn Protection
    Reply With Quote #4

    Quote:
    Originally Posted by skyler.b View Post
    I think it is a nice plugin well coded but as BReeZ was saying there is such a thing
    come up with something you
    ok. thanks
    __________________


    Feel free to Donate with paypal
    My plugins
    xoxo_ is offline
    Zivziv
    New Member
    Join Date: Jan 2020
    Old 02-04-2020 , 12:04   Re: Spawn Protection
    Reply With Quote #5

    Nice Plugin Good job
    Zivziv is offline
    eyal282
    Veteran Member
    Join Date: Aug 2011
    Old 08-22-2020 , 10:29   Re: Spawn Protection
    Reply With Quote #6

    Code:
    #pragma semicolon 1
    
    #define DEBUG
    
    #define PLUGIN_AUTHOR "xoxo^^"
    #define PLUGIN_VERSION "1.00"
    
    #include <sourcemod>
    #include <sdktools>
    #include <cstrike>
    #include <sdkhooks>
    
    #define PROTECTION_TIME 10
    #define PREFIX " \x04[SM]\x01"
    
    int g_timeLeft[MAXPLAYERS + 1] =  { PROTECTION_TIME };
    Handle g_currentTimer[MAXPLAYERS + 1];
    
    
    public Plugin myinfo = 
    {
    	name = "Spawn protection", 
    	author = PLUGIN_AUTHOR, 
    	description = "Spawn protection for X seconds", 
    	version = PLUGIN_VERSION, 
    	url = ""
    };
    
    public void OnMapStart()
    {
    	for(int i=0;i < MAXPLAYERS+1;i++)
    	{
    		g_currentTimer[i] = INVALID_HANDLE;
    	}
    }
    public void OnPluginStart()
    {
    	HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
    	HookEvent("bomb_beginplant", Event_BombBeginPlant, EventHookMode_Post);
    }
    
    public OnClientDisconnect(int client)
    {
    	if (g_currentTimer[client] != INVALID_HANDLE)
    	{
    		KillTimer(g_currentTimer[client]);
    		g_currentTimer[client] = INVALID_HANDLE;
    	}
    }
    
    public Action Event_PlayerSpawn(Handle event, char[] name, bool dontBroadcast)
    {
    	int client = GetClientOfUserId(GetEventInt(event, "userid"));
    	
    	if (g_currentTimer[client] != INVALID_HANDLE)
    		KillTimer(g_currentTimer[client]);
    	
    	g_currentTimer[client] = CreateTimer(1.0, Timer_SpawnProtection, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    	SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
    	SetEntityRenderColor(client, 255, 0, 0, 255);
    	PrintToChat(client, "%s \x07Spawn protection\x01 is now \x04ON\x01!", PREFIX);
    	g_timeLeft[client] = PROTECTION_TIME;
    }
    
    public Action Timer_SpawnProtection(Handle timer, int client)
    {
    	SetHudTextParams(0.4, 0.2, 1.1, 0, 0, 204, 1, 0);
    	g_timeLeft[client]--;
    	
    	if (g_timeLeft[client] <= 0)
    	{
    		ShowHudText(client, 1, "Spawn protection is now off!");
    		PrintToChat(client, "%s \x07Spawn protection\x01 is now \x02OFF\x01!", PREFIX);
    		SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
    		SetEntityRenderColor(client, 255, 255, 255, 255);
    		g_currentTimer[client] = INVALID_HANDLE;
    		return Plugin_Stop;
    	}
    	
    	ShowHudText(client, 1, "You have %d seconds left for your\n\t\t\tSpawn protection!", g_timeLeft[client]);
    	
    	return Plugin_Continue;
    } 
    
    public Action Event_BombBeginPlant(Handle event, char[] name, bool dontBroadcast)
    {
    	int client = GetClientOfUserId(GetEventInt(event, "userid"));
    	
    	if (g_currentTimer[client] != INVALID_HANDLE)
    	{
    		KillTimer(g_currentTimer[client]);
    		
    		PrintToChat(client, "%s \x07Spawn protection\x01 is now \x04OFF\x01 for planting the bomb!", PREFIX);
    	}
    }
    Fixed terrible code, added spawn protection stop for planting the bomb (surf_mai_remix_go)
    __________________
    I am available to make plugins for pay.

    Discord: Eyal282#1334
    eyal282 is offline
    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 05:42.


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