AlliedModders

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

EpicFail. 08-02-2010 12:33

Respawn Help..
 
Uhmm how i can make my Respawn Code Used only when I death..
Here the Code:
PHP Code:

{    
                 if( 
g_bRespawnUsed[id] )
            {
                
ChatColorid"%s You've already !gRespawned!y! Wait until next map!"CLAN_TAG );
            }
            
            else if( 
iMoney RESPAWN_COST )
            {
                
ChatColorid"%s You don't have enough !gMoney !yto buy that!"CLAN_TAG );
                
                
CmdMainMenuid );
            }
            
            else
            {
                
ExecuteHamBHam_CS_RoundRespawnid );
                
                
g_bRespawnUsed[id] = true
                
                cs_set_user_money
idiMoney RESPAWN_COST );
                
                new 
name[32]
                
get_user_nameidname31 )
                
                
ChatColor0"%s %s You have been !gRespawned!y!"CLAN_TAGname );
            }
        } 

Please help me and Sorry for bad English


Edit:

i add to this
PHP Code:

if( !is_user_aliveid ) ) 

and i still can buy respawn when i alive

here the now code:
PHP Code:

{    
                 if( 
g_bRespawnUsed[id] )
            {
                
ChatColorid"%s You've already !gRespawned!y! Wait until next map!"CLAN_TAG );
            }
            
            else if( 
iMoney RESPAWN_COST )
            {
                
ChatColorid"%s You don't have enough !gMoney !yto buy that!"CLAN_TAG );
                
                
CmdMainMenuid );
            }
            
            else
            {
                
ExecuteHamBHam_CS_RoundRespawnid );
                
                
g_bRespawnUsed[id] = true
                
                cs_set_user_money
idiMoney RESPAWN_COST );
                
                new 
name[32]
                
get_user_nameidname31 )
                
                
ChatColor0"%s %s You have been !gRespawned!y!"CLAN_TAGname );    
            }
            
            if( !
is_user_aliveid ) )
            {
                
ChatColor0"%s You must be dead to !gRespawn!y!"CLAN_TAG );
                return 
PLUGIN_HANDLED;
            }
        } 


infek 08-02-2010 15:50

Re: Respawn Help..
 
Try that
PHP Code:

    if( !is_user_aliveid ) ) {
        
ChatColor0"%s You must be dead to !gRespawn!y!"CLAN_TAG );
        return 
PLUGIN_HANDLED;
    }
    if( 
g_bRespawnUsed[id] )
    {
        
ChatColorid"%s You've already !gRespawned!y! Wait until next map!"CLAN_TAG );
    }
    if( 
iMoney RESPAWN_COST ) {
        
ChatColorid"%s You don't have enough !gMoney !yto buy that!"CLAN_TAG );
        
CmdMainMenuid );
    }
    else
    {
        
ExecuteHamBHam_CS_RoundRespawnid );
        
        
g_bRespawnUsed[id] = true
        
        cs_set_user_money
idiMoney RESPAWN_COST );
        
        new 
name[32]
        
get_user_nameidname31 )
        
        
ChatColor0"%s %s You have been !gRespawned!y!"CLAN_TAGname );    
    }



drekes 08-02-2010 15:52

Re: Respawn Help..
 
if(!is_user_alive(id)) means that he is dead.

infek 08-02-2010 15:55

Re: Respawn Help..
 
I know he doesn't want to be able to buy Respawn while he's alive.. Read what he said :o

Quote:


i add to this
PHP Code:

if( !is_user_aliveid ) ) 

and i still can buy respawn when i alive


EpicFail. 08-02-2010 17:02

Re: Respawn Help..
 
Quote:

Originally Posted by infek (Post 1259580)
Try that
PHP Code:

    if( !is_user_aliveid ) ) {
        
ChatColor0"%s You must be dead to !gRespawn!y!"CLAN_TAG );
        return 
PLUGIN_HANDLED;
    }
    if( 
g_bRespawnUsed[id] )
    {
        
ChatColorid"%s You've already !gRespawned!y! Wait until next map!"CLAN_TAG );
    }
    if( 
iMoney RESPAWN_COST ) {
        
ChatColorid"%s You don't have enough !gMoney !yto buy that!"CLAN_TAG );
        
CmdMainMenuid );
    }
    else
    {
        
ExecuteHamBHam_CS_RoundRespawnid );
        
        
g_bRespawnUsed[id] = true
        
        cs_set_user_money
idiMoney RESPAWN_COST );
        
        new 
name[32]
        
get_user_nameidname31 )
        
        
ChatColor0"%s %s You have been !gRespawned!y!"CLAN_TAGname );    
    }



Now this Revive me when i alive
and when i death this no give me to revive O_O

Raddish 08-02-2010 17:02

Re: Respawn Help..
 
Use static in get_user_name.

EpicFail. 08-02-2010 17:11

Re: Respawn Help..
 
Quote:

Originally Posted by Raddish (Post 1259674)
Use static in get_user_name.

Can you show how do this i started with Pawn Language

so i will be happy if you do this for me to i can learn

Raddish 08-02-2010 17:19

Re: Respawn Help..
 
PHP Code:

new name[32]
get_user_name(indexnamecharsmax(name)) 

-->

PHP Code:

static name[32]
get_user_name(indexnamecharsmax(name)) 


Devil259 08-02-2010 17:21

Re: Respawn Help..
 
new name[32]
->

static name[32]

nikodz 08-02-2010 17:26

Re: Respawn Help..
 
What about this?
PHP Code:

{    
    if( 
g_bRespawnUsed[id] )
    {
        
ChatColorid"%s You've already !gRespawned!y! Wait until next map!"CLAN_TAG );
        return 
PLUGIN_HANDLED;
    }
            
    else if( 
iMoney RESPAWN_COST )
    {
        
ChatColorid"%s You don't have enough !gMoney !yto buy that!"CLAN_TAG );
        
        
CmdMainMenuid );
        return 
PLUGIN_HANDLED;
    }
            
    else
    {
        if( !
is_user_aliveid ) ){

            
ExecuteHamBHam_CS_RoundRespawnid );
                
            
g_bRespawnUsed[id] = true
                
            cs_set_user_money
idiMoney RESPAWN_COST );
                
            new 
name[32]
            
get_user_nameidname31 )
                
            
ChatColor0"%s %s You have been !gRespawned!y!"CLAN_TAGname );    
        }
        return 
PLUGIN_HANDLED;
    }
            
    if( 
is_user_aliveid ) )
    {
        
ChatColor0"%s You must be dead to !gRespawn!y!"CLAN_TAG );
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;




All times are GMT -4. The time now is 00:11.

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