AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Parachute issues.. (https://forums.alliedmods.net/showthread.php?t=117323)

Doc-Holiday 01-31-2010 01:04

Parachute issues..
 
Ok so i have tried the Gun XP mod version and the version back from 05...

nither of them seem to work with this pulgin i am makeing.

PHP Code:

register_forward(FM_PlayerPreThink,"fw_Paratrooper"); 

PHP Code:

public SetSkill(id)
{
    new 
iClassiRank;
    
iClass g_XP[id][Class];
    
iRank g_XP[id][Rank];
    
    if(!
is_user_bot(id))
    {
        if(
iClass == Sniper)
        {
            new 
szPwep32 ], szSwep32 ];
                
            
get_pcvar_string(g_CvarCVAR_PWEP ][iClass][iRank], szPwep32);
            
get_pcvar_string(g_CvarCVAR_SWEP ][iClass][iRank], szSwep32);
            
            
SetSkillsid szPwep szSwep 
            
get_pcvar_numg_CvarCVAR_HEALTH ][ iClass ][ iRank ] ) , 
            
get_pcvar_numg_CvarCVAR_ARMOR ][ iClass ][ iRank ] ) , 
            
get_pcvar_floatg_CvarCVAR_SPEED ][ iClass ][ iRank ]) , 
            
get_pcvar_floatg_CvarCVAR_GRAVITY ][ iClass ][ iRank ] ) );
        }
        
        else if(
iClass == None)
        {
            return 
PLUGIN_HANDLED;
        }
        
        else if(
iClass == Paratrooper)
        {
            new 
szPwep32 ], szSwep32 ];
                
            
get_pcvar_string(g_CvarCVAR_PWEP ][iClass][iRank], szPwep32);
            
get_pcvar_string(g_CvarCVAR_SWEP ][iClass][iRank], szSwep32);
            
            
SetSkillsid szPwep szSwep 
            
get_pcvar_numg_CvarCVAR_HEALTH ][ iClass ][ iRank ] ) , 
            
get_pcvar_numg_CvarCVAR_ARMOR ][ iClass ][ iRank ] ) , 
            
get_pcvar_floatg_CvarCVAR_SPEED ][ iClass ][ iRank ]) , 
            
get_pcvar_floatg_CvarCVAR_GRAVITY ][ iClass ][ iRank ] ) );
            
has_parachute[id] = true;
        }
        
        else
        {
            new 
szPwep32 ], szSwep32 ];
                
            
get_pcvar_string(g_CvarCVAR_PWEP ][iClass][iRank], szPwep32);
            
get_pcvar_string(g_CvarCVAR_SWEP ][iClass][iRank], szSwep32);
            
            
SetSkillsid szPwep szSwep 
            
get_pcvar_numg_CvarCVAR_HEALTH ][ iClass ][ iRank ] ) , 
            
get_pcvar_numg_CvarCVAR_ARMOR ][ iClass ][ iRank ] ) , 
            
get_pcvar_floatg_CvarCVAR_SPEED ][ iClass ][ iRank ]) , 
            
get_pcvar_floatg_CvarCVAR_GRAVITY ][ iClass ][ iRank ] ) );
        }
    }
    return 
PLUGIN_CONTINUE;


PHP Code:

public fwd_Paratrooper(id)
{
    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    //2 - detach - 29 frames
    
    
if (!is_user_alive(id) || !has_parachute[id])
        return;

    new 
Float:fallspeed get_pcvar_float(g_Cvar2CVAR_FALLSPEED ]) * -1.0
    
new Float:frame

    
new button pev(idpev_button)
    new 
oldbutton pev(idpev_oldbuttons)
    new 
flags pev(idpev_flags)

    if (
para_ent[id] > && (flags FL_ONGROUND)) 
    {
        
set_view(idCAMERA_NONE)
        
        if (
get_pcvar_num(g_Cvar2CVAR_DETATCH ])) 
        {
            if ( 
pev(para_ent[id],pev_sequence) != 
            {
                
set_pev(para_ent[id], pev_sequence2)
                
set_pev(para_ent[id], pev_gaitsequence1)
                
set_pev(para_ent[id], pev_frame0.0)
                
set_pev(para_ent[id], pev_fuser10.0)
                
set_pev(para_ent[id], pev_animtime0.0)
                return
            }
            
            
pev(para_ent[id],pev_fuser1frame)
            
frame += 2.0
            set_pev
(para_ent[id],pev_fuser1,frame)
            
set_pev(para_ent[id],pev_frame,frame)
            
            if ( 
frame 254.0 )
            {
                
engfunc(EngFunc_RemoveEntitypara_ent[id])
                
para_ent[id] = 0
            
}
        }
        else 
        {
            
engfunc(EngFunc_RemoveEntitypara_ent[id])
            
para_ent[id] = 0
        
}
        return
    } 



All times are GMT -4. The time now is 07:27.

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