View Single Post
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-18-2016 , 09:44   Re: [L4D2] ABM: A L4D2 5+ Player Enhancement for Campaign
Reply With Quote #17

On a side note and somewhat related to what Spirit said: Check game modes in OnPluginStart(), not in OnClientPostAdminCheck() because the plugin will check every time someone joins and SM checks the client if he/she has a flag on which may cause lag.

Likewise:
PHP Code:
public void OnPluginStart()
{
    
char sGameMode[16];
    
FindConVar("mp_gamemode").GetString(sGameModesizeof(sGameMode));
    if (
StrContains(sGameMode"versus"false) == -&& StrContains(sGameMode"scavenge"false) == -1)
    {
        
SetFailState("[ABM] Plugin Runs In Competitive Modes Only!");
    }
    
    
// your codes here


Last edited by cravenge; 12-18-2016 at 09:45.
cravenge is offline