Raised This Month: $ Target: $400
 0% 

Semiclip


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-04-2017 , 07:54   Semiclip
Reply With Quote #1

I have a problem. When I use this semiclip, the server crashs.
Please do not say me that "Use other semiclip plugin." I need this plugin.
Could you help me about my problem?
Thanks for helping me

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define IsPlayer(%1) (1 <= %1 <= get_maxplayers())

new players[32], inumsemiclip_cvarmp_friendlyfiresyncObj
new iTeams[33] = {-1, ...};

public 
plugin_init() {
    
register_plugin("Semiclip""1.1""Crusher918"// Edited by PurposeLess
    
    
RegisterHam(Ham_Player_PreThink"player""FwdHamPlayerPreThink"true)
    
RegisterHam(Ham_Killed"player""FwdHamPlayerKilled"true)
    
register_forward(FM_ShouldCollide"FwdShouldCollide")
    
register_forward(FM_AddToFullPack"FwdAddToFullPack"true)
    
    
semiclip_cvar register_cvar("semiclip""0")
    
mp_friendlyfire register_cvar("mp_friendlyfire""0")
    
syncObj CreateHudSyncObj();
}

public 
FwdHamPlayerPreThink(const id) {
    if(
get_pcvar_num(semiclip_cvar)) {
        
Semiclip(idSOLID_NOT)
    }
}

public 
client_PostThink(id) {
    if(
get_pcvar_num(semiclip_cvar)) {
        
Semiclip(idSOLID_SLIDEBOX)
    }
}

public 
FwdHamPlayerKilled() {
    if(
get_pcvar_num(semiclip_cvar)) {
        
get_players(playersinum"ae")
        for(new 
i=0inumi++) {
            
entity_set_int(players[i], EV_INT_solidSOLID_SLIDEBOX)
        }
    }
}

public 
FwdShouldCollide(const touched, const other) {
    if(
get_pcvar_num(mp_friendlyfire))
        return 
FMRES_IGNORED;
    
    if(
get_pcvar_num(semiclip_cvar)) {
        if(
IsPlayer(touched) && IsPlayer(other)) {
            
iTeams[touched]  = get_user_team(touched);
            
iTeams[other]    = get_user_team(other);
            
            if(
iTeams[touched] == iTeams[other]) {
                static 
idbody
                get_user_aiming
(touchedidbody)
                if(
id != touched && is_user_connected(id))
                {
                    static 
name[32]
                    
get_user_name(idnamecharsmax(name))
                    
set_hudmessage(255,0,00.00.870)
                    
ShowSyncHudMsg(touchedsyncObj"%s"name)
                }
                
forward_return(FMV_CELL0)
                return 
FMRES_SUPERCEDE;
            }
        }
    }
    return 
FMRES_IGNORED;
}

public 
FwdAddToFullPack(eseiEntidhostflagsplayerpSet) {
    if(
get_pcvar_num(semiclip_cvar)) {
        if(
player && id != iEnt && get_orig_retval()) {
            
iTeams[id]        = get_user_team(id); 
            
iTeams[iEnt]    = get_user_team(iEnt);
            if(
iTeams[id] == iTeams[iEnt])
                
set_es(esES_SolidSOLID_NOT)
        }
    }
}

Semiclip(const id, const solid) {
    if(
get_pcvar_num(semiclip_cvar)) {
        if(!
is_user_alive(id))
            return
        
        
get_players(playersinum"a")
        for(new 
0inumi++) {
            if(
id != players[i]) {
                
iTeams[id]        = get_user_team(id); 
                
iTeams[players[i]]    = get_user_team(players[i]);
                
                if(
iTeams[id] == iTeams[players[i]])
                    
entity_set_int(players[i], EV_INT_solidsolid)
            }
        }
    }


Last edited by PurposeLessx; 08-04-2017 at 07:55.
PurposeLessx is offline
 


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 23:12.


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