Raised This Month: $ Target: $400
 0% 

Solved Overflow because of a respawn plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
vov
Junior Member
Join Date: Nov 2016
Old 07-11-2018 , 07:47   Overflow because of a respawn plugin
Reply With Quote #1

I am still learning coding, so I built this monstrosity out of a few plugins to make terrorists always respawn and never have any weapons. It works, but the problem is that after a round ends, I get an overflow error. Is there anyone out there willing to help me optimize this plugin? Thank you all in advance.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <amxmisc>
#include <fun>
 
#define RESPAWN_DELAY 2.0
#define TEAM_T 1
 
public plugin_init()
{
        
register_plugin("CT Respawn""1.2""hleV")
        
register_clcmd("say /respawn""PlayerCmdRespawn")
        
RegisterHam(Ham_Killed"player""PlayerKilled"1)
        
register_event("CurWeapon","knife","b","1=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)  
}

public  
knife(id)
{
    if(
get_user_team(id) == TEAM_T){
        new 
wpID read_data(2)
        if(
wpID != CSW_KNIFE)
        {
            
strip_user_weapons(id)
            
give_item(id"weapon_knife")
            
engclient_cmd(id"weapon_knife")
        }
    }


Last edited by vov; 07-11-2018 at 12:35.
vov is offline
 



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