Raised This Month: $ Target: $400
 0% 

[Duda] Destrabar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lRodri.
Member
Join Date: Apr 2012
Location: Argentina
Old 01-04-2013 , 15:17   Re: [Duda] Destrabar
#3

Encontre esto:

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

Pero como le agrego que el plugin se ejecute cuando el usuario escribe: /destrabar
lRodri. is offline
Send a message via MSN to lRodri.
 



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:41.


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