Uhmm how i can make my Respawn Code Used only when I death..
Here the Code:
PHP Code:
{
if( g_bRespawnUsed[id] )
{
ChatColor( id, "%s You've already !gRespawned!y! Wait until next map!", CLAN_TAG );
}
else if( iMoney < RESPAWN_COST )
{
ChatColor( id, "%s You don't have enough !gMoney !yto buy that!", CLAN_TAG );
CmdMainMenu( id );
}
else
{
ExecuteHamB( Ham_CS_RoundRespawn, id );
g_bRespawnUsed[id] = true
cs_set_user_money( id, iMoney - RESPAWN_COST );
new name[32]
get_user_name( id, name, 31 )
ChatColor( 0, "%s %s You have been !gRespawned!y!", CLAN_TAG, name );
}
}
Please help me and Sorry for bad English
Edit:
i add to this
PHP Code:
if( !is_user_alive( id ) )
and i still can buy respawn when i alive
here the now code:
PHP Code:
{
if( g_bRespawnUsed[id] )
{
ChatColor( id, "%s You've already !gRespawned!y! Wait until next map!", CLAN_TAG );
}
else if( iMoney < RESPAWN_COST )
{
ChatColor( id, "%s You don't have enough !gMoney !yto buy that!", CLAN_TAG );
CmdMainMenu( id );
}
else
{
ExecuteHamB( Ham_CS_RoundRespawn, id );
g_bRespawnUsed[id] = true
cs_set_user_money( id, iMoney - RESPAWN_COST );
new name[32]
get_user_name( id, name, 31 )
ChatColor( 0, "%s %s You have been !gRespawned!y!", CLAN_TAG, name );
}
if( !is_user_alive( id ) )
{
ChatColor( 0, "%s You must be dead to !gRespawn!y!", CLAN_TAG );
return PLUGIN_HANDLED;
}
}