Raised This Month: $32 Target: $400
 8% 

[L4D2] Help with a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 05-02-2019 , 11:56   [L4D2] Help with a plugin
Reply With Quote #1

Hello. What should i add in the code of my plugin so it will only activate in a particular gamemode (versus) ?
JLmelenchon is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-02-2019 , 16:17   Re: [L4D2] Help with a plugin
Reply With Quote #2

You would need to check gamemode. Try this snippet.

PHP Code:
ConVar Cvar_GameMode;

Cvar_GameMode FindConVar("mp_gamemode");

char GameMode[32];
Cvar_GameMode.GetString(GameModesizeof GameMode)
if (
StrContains(GameMode"versus"false) != -1)
{
    
// Versus game mode detected.

__________________
Spirit_12 is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 05-03-2019 , 05:58   Re: [L4D2] Help with a plugin
Reply With Quote #3

Thanks for the answer.
JLmelenchon is offline
SAMJOSEPH
New Member
Join Date: May 2019
Old 05-05-2019 , 02:55   Re: [L4D2] Help with a plugin
Reply With Quote #4

hey, i was also looking for the same. thanks for the responses , it was helpful for me.
best regards!!
SAMJOSEPH is offline
Reply


Thread Tools
Display Modes

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 19:39.


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