Raised This Month: $ Target: $400
 0% 

[SOLUCIONADO] Furien Paracaidas


  
 
 
Thread Tools Display Modes
Author Message
arslan
BANNED
Join Date: Feb 2013
Location: En mi CASA jjejejejej
Old 04-22-2013 , 12:42   [SOLUCIONADO] Furien Paracaidas
#1

Alguien me podria ayudar en kiatr el bug de paracaidas que solo se quede a CT no a TT el code:

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

#include "furien.inc"
#include "furien_shop.inc"

#define MAX_PLAYERS        32

new g_szParaModel[64]

new 
Float:g_flFallSpeed

new g_bHasParachute
#define SetUserParachute(%1)        g_bHasParachute |=    1<<(%1&31)
#define RemoveUserParachute(%1)    g_bHasParachute &=    ~(1<<(%1&31))
#define HasUserAutoParachute(%1)    g_bHasParachute &    1<<(%1&31)

new g_iParachute[MAX_PLAYERS+1]
new 
Float:g_flFrame[MAX_PLAYERS+1]

new 
g_iCost[2]

public 
plugin_precache()
{
    
register_plugin("AMX Parachute""1.4.0""KRoT@L")
        
    new 
szConfigFile[128]
    
get_localinfo("amxx_configsdir"szConfigFilecharsmax(szConfigFile))
    
format(szConfigFilecharsmax(szConfigFile), "%s/furien/items/parachute.ini"szConfigFile);

    new 
fp fopen(szConfigFile"rt")
    if( !
fp )
    {
        return
    }

    new 
szFurienName[32], szAntiName[32]

    new 
szDatas[80], szKey[16], szValue[64]
    while( !
feof(fp) )
    {
        
fgets(fpszDatascharsmax(szDatas))
        
trim(szDatas)
        if(!
szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))
        {
            continue
        }

        
parse(szDatasszKeycharsmax(szKey), szValuecharsmax(szValue))

        switch( 
szKey[0] )
        {
            case 
'A':
            {
                switch( 
szKey[7] )
                {
                    case 
'M':
                    {
                        if( 
equal(szKey"ANTI_NAME" ) )
                        {
                            
copy(szAntiNamecharsmax(szAntiName), szValue)
                        }
                    }
                    case 
'S':
                    {
                        if( 
equal(szKey"ANTI_COST" ) )
                        {
                            
g_iCost[AntiFurien] = str_to_num(szValue)
                        }
                    }
                }
            }
            case 
'F':
            {
                switch( 
szKey[9] )
                {
                    case 
'M':
                    {
                        if( 
equal(szKey"FURIEN_NAME" ) )
                        {
                            
copy(szFurienNamecharsmax(szAntiName), szValue)
                        }
                    }
                    case 
'S':
                    {
                        if( 
equal(szKey"FURIEN_COST" ) )
                        {
                            
g_iCost[Furien] = str_to_num(szValue)
                        }
                    }
                }
            }
            case 
'P':
            {
                switch( 
szKey[5] )
                {
                    case 
'M':
                    {
                        if( 
equal(szKey"PARA_MODEL" ) )
                        {
                            
copy(g_szParaModelcharsmax(g_szParaModel), szValue)
                            
precache_model(g_szParaModel)
                        }
                    }
                    case 
'F':
                    {
                        if( 
equal(szKey"PARA_FALLSPEED" ) )
                        {
                            
g_flFallSpeed = -str_to_float(szValue)
                        }
                    }
                }
            }
        }
    }
    
fclosefp )

    if( 
g_iCost[Furien] || g_iCost[AntiFurien] )
    {
        
furien_register_item(szFurienNameg_iCost[Furien], szAntiNameg_iCost[AntiFurien], "furien_buy_parachute")    

        
RegisterHam(Ham_Spawn"player""Player_Spawn"1)
        
RegisterHam(Ham_Killed"player""CBasePlayer_Killed"true)
    }
}

public 
furien_team_change/*iFurien */ )
{
    if( !
g_iCost[Furien] || !g_iCost[AntiFurien] )
    {
        
g_bHasParachute 0
    
}
}

public 
furien_round_restart()
{
    
g_bHasParachute 0
}

public 
furien_buy_parachuteid )
{    
    new 
iTeam furien_get_user_team(id)
    if( 
iTeam == -)
    {
        return 
ShopCloseMenu
    
}

    new 
iItemCost g_iCost[iTeam]
    if( 
iItemCost <= )
    {
        return 
ShopTeamNotAvail
    
}

    if( ~
HasUserAutoParachute(id) )
    {
        if( 
furien_try_buy(idiItemCost) )
        {
            
SetUserParachuteid )
            return 
ShopBought
        
}
        else
        {
            return 
ShopNotEnoughMoney
        
}
    }
    return 
ShopAlreadyHaveOne
}

public 
client_disconnect(id)
{
    
parachute_reset(idfalse)
}

public 
Player_Spawn(id)
{
    
parachute_reset(idtrue)
}

public 
client_putinserver(id)
{
    
RemoveUserParachute(id)
}

parachute_reset(idbool:bReSetGravity true)
{
    new 
iEnt g_iParachute[id]
    if( 
iEnt )
    {
        if( 
is_valid_ent(iEnt) )
        {
            
entity_set_int(iEntEV_INT_flagsFL_KILLME)
        }
    }

    if( 
bReSetGravity && is_user_alive(id) )
    {
        
set_user_gravity(id)
    }

    
g_iParachute[id] = 0
}

public 
client_PreThink(id)
{

    if( ~
HasUserAutoParachute(id) || !is_user_alive(id) )
    {
        return
    }

    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    //2 - detach - 29 frames

    
static const info_target[] = "info_target"
    
static iEntFloat:flFrame
    iEnt 
g_iParachute[id]
    
flFrame g_flFrame[id]

    if ( 
iEnt && entity_get_int(idEV_INT_flags) & FL_ONGROUND )
    {    
        if ( 
get_user_gravity(id) == 0.1 )
        {
            
set_user_gravity(id)
        }

        if( 
entity_get_int(iEntEV_INT_sequence) != )
        {
            
entity_set_int(iEntEV_INT_sequence2)
            
entity_set_int(iEntEV_INT_gaitsequence1)

            
entity_set_float(iEntEV_FL_frame0.0)
            
g_flFrame[id] = 0.0

            entity_set_float
(iEntEV_FL_animtime0.0)
            
entity_set_float(iEntEV_FL_framerate0.0)
            return
        }

        
flFrame += 2.0
        entity_set_float
(iEntEV_FL_frameflFrame)

        if ( 
flFrame 254.0 )
        {
            
entity_set_int(iEntEV_INT_flagsFL_KILLME)
            
iEnt 0
        
}
    }
    
    else if(
entity_get_int(idEV_INT_button) & IN_USE)
    {
        new 
Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)

        if ( 
velocity[2] < 0.0 )
        {
            if ( 
iEnt <= )
            {
                
iEnt create_entity(info_target)
                if( 
iEnt )
                {
                    
entity_set_edict(iEntEV_ENT_aimentid)
                    
entity_set_edict(iEntEV_ENT_ownerid)
                    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_FOLLOW)
                    
entity_set_model(iEntg_szParaModel)
                    
entity_set_int(iEntEV_INT_sequence0)
                    
entity_set_int(iEntEV_INT_gaitsequence1)

                    
flFrame 0.0
                    entity_set_float
(iEntEV_FL_frame0.0)
                }
            }

            if ( 
iEnt )
            {
                
entity_set_int(idEV_INT_sequence3)
                
entity_set_int(idEV_INT_gaitsequence1)
                
entity_set_float(idEV_FL_frame1.0)
                
entity_set_float(idEV_FL_animtime100.0)
                
entity_set_float(idEV_FL_framerate1.0)
                
set_user_gravity(id0.1)

                
velocity[2] += 40
                velocity
[2] = (velocity[2] < g_flFallSpeed) ? velocity[2] : g_flFallSpeed
                entity_set_vector
(idEV_VEC_velocityvelocity)

                if ( 
entity_get_int(iEntEV_INT_sequence) == )
                {
                    
flFrame += 1.0
                    entity_set_float
(iEntEV_FL_frameflFrame)

                    if ( 
flFrame 100.0 )
                    {
                        
entity_set_float(iEntEV_FL_animtime120.0)
                        
entity_set_float(iEntEV_FL_framerate0.4)
                        
entity_set_int(iEntEV_INT_sequence1)
                        
entity_set_int(iEntEV_INT_gaitsequence1)
                        
flFrame 0.0
                        entity_set_float
(iEntEV_FL_frame0.0)
                    }
                }
            }
        }
        else if ( 
iEnt )
        {
            
entity_set_int(iEntEV_INT_flagsFL_KILLME)
            
set_user_gravity(id)
            
iEnt 0
        
}
    }
    
    else if( 
iEnt && get_user_oldbutton(id) & IN_USE )
    {
        
entity_set_int(iEntEV_INT_flagsFL_KILLME)
        
set_user_gravity(id)
        
iEnt 0
    
}

    
g_iParachute[id] = iEnt
    g_flFrame
[id] = flFrame
}

public 
CBasePlayer_Killed(id)
{
    
RemoveUserParachute(id)

e mirado este post pero no me sirve: No paracaidas en TT

Espero si alguien me pueda ayudar...
Attached Files
File Type: inc furien.inc (274 Bytes, 110 views)

Last edited by arslan; 04-27-2013 at 15:35. Reason: Include necesario
arslan is offline
Send a message via MSN to arslan Send a message via Yahoo to arslan Send a message via Skype™ to arslan
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 04-22-2013 , 13:02   Re: [AYUDA] Furien Paracaidas
#2

Proba con este public, pero digo, te lo dejan hay...

PHP Code:
public furien_buy_parachuteid )
{
    if(
get_user_team(id) == 1)
        return 
ShopCloseMenu;
    
    new 
iTeam furien_get_user_team(id)
    if( 
iTeam == -)
    {
        return 
ShopCloseMenu
    
}
    
    new 
iItemCost g_iCost[iTeam]
    if( 
iItemCost <= )
    {
        return 
ShopTeamNotAvail
    
}
    
    if( ~
HasUserAutoParachute(id) )
    {
        if( 
furien_try_buy(idiItemCost) )
        {
            
SetUserParachuteid )
            return 
ShopBought
        
}
        else
        {
            return 
ShopNotEnoughMoney
        
}
    }
    return 
ShopAlreadyHaveOne

Matians is offline
arslan
BANNED
Join Date: Feb 2013
Location: En mi CASA jjejejejej
Old 04-22-2013 , 13:06   Re: [AYUDA] Furien Paracaidas
#3

Gracias hermano pero este ya lo e probado pero se keda bug con este code
arslan is offline
Send a message via MSN to arslan Send a message via Yahoo to arslan Send a message via Skype™ to arslan
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 04-22-2013 , 13:08   Re: [AYUDA] Furien Paracaidas
#4

Que bug te tira con el code que poste?
Matians is offline
arslan
BANNED
Join Date: Feb 2013
Location: En mi CASA jjejejejej
Old 04-22-2013 , 13:16   Re: [AYUDA] Furien Paracaidas
#5

Osea que no me tira ningun bug pero sige saliendo paracaidas en TT = Furien
arslan is offline
Send a message via MSN to arslan Send a message via Yahoo to arslan Send a message via Skype™ to arslan
MLZz3
BANNED
Join Date: Mar 2013
Location: Granada, Andalucia, Spai
Old 04-23-2013 , 10:16   Re: [AYUDA] Furien Paracaidas
#6

Prueba esto...

PHP Code:
#include <cstrike> 
PHP Code:
public client_PreThinkid )
{
    if( ~
HasUserAutoParachuteid ) || !is_user_aliveid ) || !cs_get_user_teamid ) == CS_TEAM_T )
        return;
    
    
//parachute.mdl animation information
    //0 - deploy - 84 frames
    //1 - idle - 39 frames
    
    
codecode... 
MLZz3 is offline
Send a message via Skype™ to MLZz3
arslan
BANNED
Join Date: Feb 2013
Location: En mi CASA jjejejejej
Old 04-23-2013 , 12:34   Re: [AYUDA] Furien Paracaidas
#7

No
arslan is offline
Send a message via MSN to arslan Send a message via Yahoo to arslan Send a message via Skype™ to arslan
MLZz3
BANNED
Join Date: Mar 2013
Location: Granada, Andalucia, Spai
Old 04-23-2013 , 14:05   Re: [AYUDA] Furien Paracaidas
#8

Quote:
Originally Posted by arslan View Post
No
Errores!?
MLZz3 is offline
Send a message via Skype™ to MLZz3
arslan
BANNED
Join Date: Feb 2013
Location: En mi CASA jjejejejej
Old 04-23-2013 , 14:42   Re: [AYUDA] Furien Paracaidas
#9

Quote:
Originally Posted by MLZz3 View Post
Errores!?
No salen Errores pero me sale un Warrning...
Pero los TT siguen teniendo paracaidas
No hay otra forma mas facil?
O que le kite las paracaidas despues de cambio de rondas?
arslan is offline
Send a message via MSN to arslan Send a message via Yahoo to arslan Send a message via Skype™ to arslan
 



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 04:48.


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