Raised This Month: $ Target: $400
 0% 

Respawn Help..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicFail.
Senior Member
Join Date: May 2010
Old 08-02-2010 , 12:33   Respawn Help..
Reply With Quote #1

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;
            }
        } 

Last edited by EpicFail.; 08-02-2010 at 13:51.
EpicFail. is offline
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 08-02-2010 , 15:50   Re: Respawn Help..
Reply With Quote #2

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 );    
    }

__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek is offline
EpicFail.
Senior Member
Join Date: May 2010
Old 08-02-2010 , 17:02   Re: Respawn Help..
Reply With Quote #3

Quote:
Originally Posted by infek View Post
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
EpicFail. is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-02-2010 , 15:52   Re: Respawn Help..
Reply With Quote #4

if(!is_user_alive(id)) means that he is dead.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 08-02-2010 , 15:55   Re: Respawn Help..
Reply With Quote #5

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

Quote:

i add to this
PHP Code:
if( !is_user_aliveid ) ) 
and i still can buy respawn when i alive
__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 08-02-2010 , 17:02   Re: Respawn Help..
Reply With Quote #6

Use static in get_user_name.
Raddish is offline
EpicFail.
Senior Member
Join Date: May 2010
Old 08-02-2010 , 17:11   Re: Respawn Help..
Reply With Quote #7

Quote:
Originally Posted by Raddish View Post
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
EpicFail. is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 08-02-2010 , 17:21   Re: Respawn Help..
Reply With Quote #8

new name[32]
->

static name[32]
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 08-02-2010 , 17:19   Re: Respawn Help..
Reply With Quote #9

PHP Code:
new name[32]
get_user_name(indexnamecharsmax(name)) 
-->

PHP Code:
static name[32]
get_user_name(indexnamecharsmax(name)) 
Raddish is offline
nikodz
Junior Member
Join Date: Jul 2009
Old 08-02-2010 , 17:26   Re: Respawn Help..
Reply With Quote #10

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;

nikodz is offline
Reply



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 00:11.


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