Raised This Month: $ Target: $400
 0% 

Help for my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Heypio
Junior Member
Join Date: Nov 2017
Old 12-10-2017 , 11:07   Help for my plugin
Reply With Quote #1

Hello , I wrote a plugin and I want this plugin not to work in awp mode how do I do it
Heypio is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-10-2017 , 11:21   Re: Help for my plugin
Reply With Quote #2

1. use map config and then sm plugins unload your_plugin.smx on awp_ maps
or
2. write a convar / varable that disables on awp_ maps
or
3. post your code and let some1 here edit it for you
__________________
8guawong is offline
Heypio
Junior Member
Join Date: Nov 2017
Old 12-10-2017 , 11:31   Re: Help for my plugin
Reply With Quote #3

I wrote this but it did not work

Code:
public void OnAutoConfigsBuffered()
{
   CreateTimer(5.0, plugindisable);
}

public Action plugindisable(Handle timer)
{
   char mapname[256];
   GetCurrentMap(mapname, 256);
   if (StrContains(mapname, "awp_", false) == -1)
   {
           // disable
   }
}

Last edited by Heypio; 12-10-2017 at 11:31.
Heypio is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-10-2017 , 11:58   Re: Help for my plugin
Reply With Quote #4

The code you've posted works fine for me. What game is this for? also what's the "//disabled" code you have written?
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Heypio
Junior Member
Join Date: Nov 2017
Old 12-10-2017 , 12:18   Re: Help for my plugin
Reply With Quote #5

Quote:
Originally Posted by 1337norway View Post
The code you've posted works fine for me. What game is this for? also what's the "//disabled" code you have written?
It disabled does not work. game csgo

Note: My english sucks
Heypio is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-10-2017 , 12:37   Re: Help for my plugin
Reply With Quote #6

You did not show the code where you disable the plugin.. You just showed the checks to see if a plugin should be disabled or not based off of awp being in the map name. You'd want to add something like.

PHP Code:
if (StrContains(mapname"awp_"false) == -1)
{
    
ServerCommand("sm plugins unload pluginname1");
    
ServerCommand("sm plugins unload pluginname1");
}
else
{
    
ServerCommand("sm plugins load pluginname1");
    
ServerCommand("sm plugins load pluginname1");

__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards 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 13:22.


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