Raised This Month: $ Target: $400
 0% 

Solved RegConsoleCmd function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 11-10-2016 , 15:59   RegConsoleCmd function
Reply With Quote #1

Hello everyone!

I made a small plugin, and I have a small problem with RegConsoleCmd

Code:
#include <sourcemod> #include <sdktools> #include <tf2> #include <tf2_stocks> #include <sdkhooks> bool bMimic = false; public void OnPluginStar() {     RegConsoleCmd("sm_toggle_mimic", Command_Mimic); } public Action Command_Mimic(int iClient, int iArgs) {     if (bMimic)         bMimic = false;     else         bMimic = true;     return Plugin_Handled; }

The client/server console, always says unknown command, I renamed the command, made a new plugin, upgraded sourcemod downgraded sourcemod, nothing, any help?

Ps: the variable (bMimic) is never changed when I use the command.

Soluce:Welp I feel dumb found my mistake, I wrote OnPluginStar I should have written OnPluginStart xd
I should reread my work slowly next time
__________________

Last edited by Benoist3012; 11-10-2016 at 16:16. Reason: Solved
Benoist3012 is offline
Michael Shoe Maker
Senior Member
Join Date: Apr 2016
Old 11-10-2016 , 18:08   Re: RegConsoleCmd function
Reply With Quote #2

Also:

PHP Code:
public Action Command_Mimic(int iClientint iArgs)
{
    
bMimic = !bMimic;

    return 
Plugin_Handled;

Michael Shoe Maker is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 11-10-2016 , 18:22   Re: RegConsoleCmd function
Reply With Quote #3

Quote:
Originally Posted by Michael Shoe Maker View Post
Also:

PHP Code:
public Action Command_Mimic(int iClientint iArgs)
{
    
bMimic = !bMimic;

    return 
Plugin_Handled;

Yeah I was a bit paranoid I used !bMimic at first but I thought that was my problem
__________________
Benoist3012 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 22:45.


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