SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/07/2017, 09:28 PM   #1
Omirrow
Huge Clucker
 
Join Date: Feb 2013
Location: Turkey
Posts: 287
Reputation: 8
Post OnRconCommand

Hey, why custom functions in OnRconCommand doesn't work at all? Even the default example given in Wiki SA:MP?

http://wiki.sa-mp.com/wiki/OnRconCommand

Code:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd, "hello", true))
    {
        SendClientMessageToAll(0xFFFFFFAA, "Hello World!");
        print("You said hello to the world."); // This will appear to the player who typed the rcon command in the chat in white
        return 1;
    }
    return 0;
}

This will print Player X sent rcon command on the console but won't send any message to players, why?
Omirrow is offline   Reply With Quote
Old 17/07/2017, 09:31 PM   #2
Omirrow
Huge Clucker
 
Join Date: Feb 2013
Location: Turkey
Posts: 287
Reputation: 8
Default Re: OnRconCommand

Nevermind, I fixed it.

I didn't read "You will need to include this callback in a loaded filterscript for it to work in the gamemode!" this.

But why should I include this in another filterscript, for example I don't use any filterscripts and I need to create a new filterscript JUST to use this callback?
Omirrow is offline   Reply With Quote
Old 17/07/2017, 10:17 PM   #3
Paulice
Gangsta
 
Join Date: Jul 2017
Posts: 528
Reputation: 44
Default Re: OnRconCommand

Yes, you do. I guess it's due to the fact that it processes the callback in filterscripts before the one in the gamemode, and if you return 1 in the callback that's in the filterscript the one in the gamemode will not be called afterwards. That's just how Kalcor made it I guess.
Paulice is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] OnRconCommand(cmd[]) Marlon307 Português/Portuguese 14 04/08/2014 03:25 PM
OnRconCommand Riddick94 Scripting Help 10 24/01/2014 10:57 AM
OnRconCommand () bug or what? ikey07 Scripting Help 3 08/12/2012 12:46 AM
OnRconCommand ? Roel Scripting Help 4 25/10/2012 09:05 PM


All times are GMT. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.