AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help for my plugin (https://forums.alliedmods.net/showthread.php?t=303518)

Heypio 12-10-2017 11:07

Help for my plugin
 
Hello , I wrote a plugin and I want this plugin not to work in awp mode how do I do it

8guawong 12-10-2017 11:21

Re: Help for my plugin
 
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

Heypio 12-10-2017 11:31

Re: Help for my plugin
 
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
  }
}


backwards 12-10-2017 11:58

Re: Help for my plugin
 
The code you've posted works fine for me. What game is this for? also what's the "//disabled" code you have written?

Heypio 12-10-2017 12:18

Re: Help for my plugin
 
Quote:

Originally Posted by 1337norway (Post 2565440)
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

backwards 12-10-2017 12:37

Re: Help for my plugin
 
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");




All times are GMT -4. The time now is 22:58.

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