AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] next round change "race" (https://forums.alliedmods.net/showthread.php?t=107429)

benjibau 10-26-2009 13:39

[help] next round change "race"
 
Hi all i need your help for my menu i don't know how make for change "race" at the next round after i have choose my new race.
And i need your help for save the race at the next round for keep the power there that they don't change the "race"

this is the code

Nextra 10-26-2009 17:44

Re: [help] next round change "race"
 
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.
        
}
    }



benjibau 10-26-2009 19:08

Re: [help] next round change "race"
 
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.
        
}
    }



Nextra 10-27-2009 11:31

Re: [help] next round change "race"
 
4 Attachment(s)
Attachment.

benjibau 10-27-2009 12:37

Re: [help] next round change "race"
 
nice but i have a probleme when i have choose at the next round my class not change

Nextra 10-27-2009 14:08

Re: [help] next round change "race"
 
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.

benjibau 10-27-2009 18:22

Re: [help] next round change "race"
 
Good job yes i seach a new class for ct after ++ karma


All times are GMT -4. The time now is 17:31.

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