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

[HELP][CSGO]Server crashing when player tags another player with knife second click


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 11-12-2015 , 00:33   [HELP][CSGO]Server crashing when player tags another player with knife second click
Reply With Quote #1

[CSGO]
It only crashes when its a second click hit, not the first click, also theres no logs at sourcemod/logs and csgo/logs
Theres the code:
PHP Code:
public Action:EventPlayerHurt(Handle:event, const String:name[],bool:dontBroadcast) {
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if (
g_pluginenabled && g_noknifeabuseEnabled && !(attacker == 0) ) {
        new 
clienthp GetEventInt(event"health");
        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        
decl String:clientname[256];
        if (
IsClientConnected(client) ){
            
GetClientName(clientclientname256);
        }
        
decl String:attackername[256];
        if (
IsClientConnected(attacker) ) {
            
GetClientName(attackerattackername256);
        }
        new 
String:weapon_knife[64] = "knife";
        new 
String:weapon_awp[64] = "awp";
        new 
String:weapon_scout[64] = "ssg08";
        
decl String:weapon[64];
        
GetEventString(event"weapon"weapon64);
        if ( !
g_isKnifeRound && !g_isNoscopeRound) { //if its a normal round
            
if ( StrEqual(weaponweapon_awp) || StrEqual(weaponweapon_scout) ) { //if its a awp or scout hit
                
g_noknifeabuseReg[client][attacker] = true;
                if ( 
clienthp ) { //if the player still alive, which means a leg
                    
CPrintToChat(attacker"%s You leg'd {RED}%s{NORMAL} now you can knife him!"SOURCEMODSTRINGclientname);
                    
CPrintToChat(client"%s {RED}%s{NORMAL} Have leg'd you, now he can knife you!"SOURCEMODSTRINGattackername);
                }
            } else if ( 
StrEqual(weapon,weapon_knife) ) { //if the hit is from a knife
                
if ( !g_noknifeabuseReg[client][attacker] ) { //if there was no a previous leg
                    
if (IsPlayerAlive(attacker) ) { //if the player stay alive
                        
if (IsClientConnected(attacker) ) { //if the player has not droped
                            
ForcePlayerSuicide(attacker);
                            
CPrintToChatAll("%s {RED}%s{NORMAL} Got slayed for not follow our knife !rules",SOURCEMODSTRING,attackername);
                        }
                    }
                }
            }        
        } else if ( 
g_isNoscopeRound ) { //else if  ITS A NOSCOPE ROUND
            
if (StrEqual(weapon,weapon_knife) ) {
                if (
IsPlayerAlive(attacker) ) { //still the player alive?
                    
if ( IsClientConnectedattacker ) ) { //still the player at server?
                        
ForcePlayerSuicide(attacker);
                        
CPrintToChatAll("%s {RED}%s{NORMAL} got slayed for not follow our knife !rules",SOURCEMODSTRING,attacker);
                    }
                }
            }
        } 
//since we dond need to do anything in the knife round...
        /*    
        if ( StrEqual(weapon, weapon_awp) || StrEqual(weapon, weapon_scout) ) {
            if( IsPlayerAlive(client) ) {
                g_noknifeabuseReg[client][attacker] = true;
                if ( IsClientConnected(client) ) {
                    CPrintToChat(attacker, "%s You legged %s you can knife him/her now",SOURCEMODSTRING,clientname);
                }
            }
        } else if ( StrEqual(weapon, weapon_knife) ) {
            if ( !g_noknifeabuseReg[client][attacker] ) {
                ForcePlayerSuicide(attacker);
            }
        }
        * */
    
}

The part where it crashes
PHP Code:
else if ( StrEqual(weapon,weapon_knife) ) { //if the hit is from a knife
                
if ( !g_noknifeabuseReg[client][attacker] ) { //if there was no a previous leg
                    
if (IsPlayerAlive(attacker) ) { //if the player stay alive
                        
if (IsClientConnected(attacker) ) { //if the player has not droped
                            
ForcePlayerSuicide(attacker);
                            
CPrintToChatAll("%s {RED}%s{NORMAL} Got slayed for not follow our knife !rules",SOURCEMODSTRING,attackername);
                        }
                    }
                }
            }        
        } 

Last edited by EngHell; 11-12-2015 at 00:35.
EngHell is offline
EngHell
Member
Join Date: Jul 2013
Location: Guatemala
Old 11-12-2015 , 18:37   Re: [HELP][CSGO]Server crashing when player tags another player with knife second cli
Reply With Quote #2

Any idea on what's wrong there?
EngHell is offline
plock
Senior Member
Join Date: Feb 2016
Location: noitacoL
Old 05-06-2016 , 13:53   Re: [HELP][CSGO]Server crashing when player tags another player with knife second cli
Reply With Quote #3

Same problem here. Any ideas?
plock is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 05-06-2016 , 14:13   Re: [HELP][CSGO]Server crashing when player tags another player with knife second cli
Reply With Quote #4

Have a look here
https://wiki.alliedmods.net/Csgo_qui...yer_hurt_event
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-06-2016 , 14:42   Re: [HELP][CSGO]Server crashing when player tags another player with knife second cli
Reply With Quote #5

Yeah but use RequestFrame instead of timer.
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick 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 06:52.


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