Raised This Month: $ Target: $400
 0% 

[help] next round change "race"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-26-2009 , 17:44   Re: [help] next round change "race"
Reply With Quote #1

This could be a simple approach at how to save the current race for the ongoing round (you should use g_iCurRace for everything happening except the race change) and have the race switched at respawn.
I hope this helps, you just need to merge it with your existing code.
PHP Code:
 new bool:g_bSwitchingRace[33], g_iNewRace[33], g_iCurRace[33], bool:g_bHasChosen[33];

// Menu selection
{
    if( 
g_bHasChosen[id] )
    {
        
g_iNewRace[id] = iKey;
        
g_bSwitchingRace[id] = true;
    }
    else
    {
         
// Your switch statement goes here and assigns g_iCurRace.
         
g_bHasChosen[id] = true;
    } 
}


// Respawn
{
    if( 
g_bSwitchingRace[id] )
    {
        
g_iCurRace[id] = g_iNewRace[id];
        
g_bSwitchingRace[id] = false;

        switch( 
g_iCurRace[id] )
        {
            
// Set new race.
        
}
    }

__________________
In Flames we trust!
Nextra is offline
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 10-26-2009 , 19:08   Re: [help] next round change "race"
Reply With Quote #2

thank you for your help but can you help me for merge the 2 plugin because what the function i must place.
And it's possible of add a clien_print who say "your class change at the next round" when i change my class

PHP Code:
{
    if( 
g_bSwitchingRace[id] )
    {
        
g_iCurRace[id] = g_iNewRace[id];
        
g_bSwitchingRace[id] = false;

        switch( 
g_iCurRace[id] )
        {
            
// Set new race.
        
}
    }


Last edited by benjibau; 10-26-2009 at 19:24.
benjibau is offline
Send a message via MSN to benjibau
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-27-2009 , 11:31   Re: [help] next round change "race"
Reply With Quote #3

Attachment.
Attached Files
File Type: sma Get Plugin or Get Source (classchange.sma - 565 views - 4.4 KB)
__________________
In Flames we trust!

Last edited by Nextra; 10-27-2009 at 13:57.
Nextra is offline
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 10-27-2009 , 12:37   Re: [help] next round change "race"
Reply With Quote #4

nice but i have a probleme when i have choose at the next round my class not change
benjibau is offline
Send a message via MSN to benjibau
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-27-2009 , 14:08   Re: [help] next round change "race"
Reply With Quote #5

Attachment updated. I left out two lines accidentaly.
I'd suggest to add a fourth class so both teams have a total of 4 classes. For now I've deactivated MENU_KEY_4 for CT's.
__________________
In Flames we trust!
Nextra is offline
benjibau
Veteran Member
Join Date: Jul 2009
Location: France (Nord 59)
Old 10-27-2009 , 18:22   Re: [help] next round change "race"
Reply With Quote #6

Good job yes i seach a new class for ct after ++ karma
benjibau is offline
Send a message via MSN to benjibau
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 17:31.


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