View Single Post
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 08-23-2016 , 18:36   Re: New API and Syntax
Reply With Quote #753

Quote:
Originally Posted by nergal View Post
not set a methodmap but rather set an instance of one methodmap, inside a different methodmap, to 0

for instance...
?


PHP Code:
enum BaseBoss
{
    
Boss_Zero
}

BaseBoss preselected;        /* The next player chosen as boss */

methodmap VSHGameMode        /* all game mode oriented code should be handled HERE ONLY */
{
    public 
VSHGameMode()
    {
        
preselected Boss_Zero;
    }
    public 
BaseBoss GetRandomBoss(const bool balive)
    {
        
BaseBoss boss;
        for (
int i=MaxClients ; --i) {
            if (
not IsValidClient(i) )
                continue;
            if (
balive and not IsPlayerAlive(i))
                continue;
            
boss BaseBoss(i);
            if (
not boss.bIsBoss)
                continue;
            else return 
boss;
        }
        return 
Boss_Zero;
    }

Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`