Raised This Month: $ Target: $400
 0% 

Semiclip + Autounstuck


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Larcyn
Senior Member
Join Date: Oct 2010
Old 06-26-2012 , 17:40   Semiclip + Autounstuck
Reply With Quote #1

Hello, I'm having some trouble with an autounstuck and semiclip plugin. When a player has semiclip and he is standing in another player in his team he gets unstucked because the autounstuck plugin thinks that the players are stuck in each other.

I need help with adding a short code that checks if the player is standing in a teammate.

I've searched a lot, but I can't find a working one.

I am using this Autounstuck code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>

new stuck[33]

new const 
Float:size[][3] = 
{
    {
0.00.01.0}, {0.00.0, -1.0}, {0.01.00.0}, {0.0, -1.00.0}, {1.00.00.0}, {-1.00.00.0}, {-1.01.01.0}, {1.01.01.0}, {1.0, -1.01.0}, {1.01.0, -1.0}, {-1.0, -1.01.0}, {1.0, -1.0, -1.0}, {-1.01.0, -1.0}, {-1.0, -1.0, -1.0},
    {
0.00.02.0}, {0.00.0, -2.0}, {0.02.00.0}, {0.0, -2.00.0}, {2.00.00.0}, {-2.00.00.0}, {-2.02.02.0}, {2.02.02.0}, {2.0, -2.02.0}, {2.02.0, -2.0}, {-2.0, -2.02.0}, {2.0, -2.0, -2.0}, {-2.02.0, -2.0}, {-2.0, -2.0, -2.0},
    {
0.00.03.0}, {0.00.0, -3.0}, {0.03.00.0}, {0.0, -3.00.0}, {3.00.00.0}, {-3.00.00.0}, {-3.03.03.0}, {3.03.03.0}, {3.0, -3.03.0}, {3.03.0, -3.0}, {-3.0, -3.03.0}, {3.0, -3.0, -3.0}, {-3.03.0, -3.0}, {-3.0, -3.0, -3.0},
    {
0.00.04.0}, {0.00.0, -4.0}, {0.04.00.0}, {0.0, -4.00.0}, {4.00.00.0}, {-4.00.00.0}, {-4.04.04.0}, {4.04.04.0}, {4.0, -4.04.0}, {4.04.0, -4.0}, {-4.0, -4.04.0}, {4.0, -4.0, -4.0}, {-4.04.0, -4.0}, {-4.0, -4.0, -4.0},
    {
0.00.05.0}, {0.00.0, -5.0}, {0.05.00.0}, {0.0, -5.00.0}, {5.00.00.0}, {-5.00.00.0}, {-5.05.05.0}, {5.05.05.0}, {5.0, -5.05.0}, {5.05.0, -5.0}, {-5.0, -5.05.0}, {5.0, -5.0, -5.0}, {-5.05.0, -5.0}, {-5.0, -5.0, -5.0}
}

public 
plugin_init() 
{
    
register_plugin("AutoUnstuck""1.5""NL)Ramon(NL")
    
set_task(0.1"checkstuck"0""0"b")
}

public 
checkstuck() 
{
    static 
players[32], pnumplayer
    get_players
(playerspnum)
    static 
Float:origin[3]
    static 
Float:mins[3], hull
    
static Float:vec[3]
    static 
o,i
    
for(i=0i<pnumi++){
        
player players[i]
        if (
is_user_connected(player) && is_user_alive(player)) {
            
pev(playerpev_originorigin)
            
hull pev(playerpev_flags) & FL_DUCKING HULL_HEAD HULL_HUMAN
            
if (!is_hull_vacant(originhull,player) && !get_user_noclip(player) && !(pev(player,pev_solid) & SOLID_NOT)) {
                ++
stuck[player]
                if(
stuck[player] >= 3
                {
                    
pev(playerpev_minsmins)
                    
vec[2] = origin[2]
                    for (
o=0sizeof size; ++o) {
                        
vec[0] = origin[0] - mins[0] * size[o][0]
                        
vec[1] = origin[1] - mins[1] * size[o][1]
                        
vec[2] = origin[2] - mins[2] * size[o][2]
                        if (
is_hull_vacant(vechull,player)) {
                            
engfunc(EngFunc_SetOriginplayervec)
                            
set_pev(player,pev_velocity,{0.0,0.0,0.0})
                            
sizeof size
                        
}
                    }
                }
            }
            else 
stuck[player] = 0
        
}
    }
}

stock bool:is_hull_vacant(const Float:origin[3], hull,id) {
    static 
tr
    engfunc
(EngFunc_TraceHulloriginorigin0hullidtr)
    if (!
get_tr2(trTR_StartSolid) || !get_tr2(trTR_AllSolid))
        return 
true
    
    
return false

__________________

Taking private requests, PM me for information.
Selling HideNSeek & Jailbreak plugins.

Selling Achievement API System (PHP &
MySQL / nVault)

Last edited by Larcyn; 06-28-2012 at 17:35. Reason: typo
Larcyn 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 06:08.


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