Raised This Month: $ Target: $400
 0% 

Solved Overflow because of a respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-11-2018 , 09:34   Re: Overflow because of a respawn plugin
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <amxmisc>
#include <cstrike>
#include <fun>
 
#define RESPAWN_DELAY 2.0
#define TEAM_T 1

new bool:HasC4[33]

public 
plugin_init()
{
        
register_plugin("CT Respawn""1.2""hleV")
        
register_clcmd("say /respawn""PlayerCmdRespawn")
        
RegisterHam(Ham_Killed"player""PlayerKilled"1)
}
 
public 
PlayerKilled(id)
{
        if(
is_user_alive(id))
                return 
HAM_IGNORED
 
        
if(get_user_team(id) == TEAM_T)
                
set_task(RESPAWN_DELAY"PlayerRespawn"id)
 
        return 
HAM_IGNORED
}
 
public 
PlayerCmdRespawn(id)
{
        if(
get_user_team(id) == TEAM_T)
                
set_task(RESPAWN_DELAY"PlayerRespawn"id)
        else
                
client_print(idprint_chat"Only Terrorists.")
 
        return 
PLUGIN_HANDLED
}
 
public 
PlayerRespawn(id)
{
    if(!
is_user_alive(id))
    {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
        
set_task(0.5"knife, id")
    }
}

public 
knife(id)
{
    if (
user_has_weapon(idCSW_C4))
        
HasC4[id] = true
    
else
        
HasC4[id] = false
            
    strip_user_weapons
(id)
    
give_item(id"weapon_knife")
    
engclient_cmd(id"weapon_knife")
        
    if(
HasC4[id])
    {
        
give_item(id"weapon_c4")
        
cs_set_user_plantid )
    }
}

public 
client_putinserver(id)
    
HasC4[id] = false 
Not tested.

Last edited by iceeedr; 07-11-2018 at 10:08.
iceeedr is offline
Send a message via Skype™ to iceeedr
vov
Junior Member
Join Date: Nov 2016
Old 07-11-2018 , 09:47   Re: Overflow because of a respawn plugin
Reply With Quote #2

Quote:
Originally Posted by iceeedr View Post
Not tested.
Thank you for your a try.
Sadly, I get a bad load and the plugin doesn't even start.
vov 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 12:23.


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