rCmd - Unknown command
#1

I'm having some problems with rCmd, No commands are executing what-so-ever and im getting the '* Unknown Command' message. I'm using this on a near to blank gamemode with no filterscripts. I have no errors either and I downloaded the includes 3 days ago so I know they are up to date.

Heres the relative code with a basic command that doesn't work:
pawn Код:
#include <a_samp>
#include <dini>
#include <DynamicParams>
#include <rCmd>

forward OnPlayerCommandReceived(playerid, cmdtext[]);
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);

rCmd[]->kill(playerid)
{
    SetPlayerHealth(playerid,0.0);
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        return SendClientMessage(playerid, 0xFF0000FF, "* Unknown Command");
    }
    return 1;
}
Any ideas?
Reply
#2

Maybe dont use (!succes) in the OnPlayerCommandPerformed

CMIIW
Reply
#3

Quote:
Originally Posted by Xaviour212
Посмотреть сообщение
Maybe dont use (!succes) in the OnPlayerCommandPerformed

CMIIW
I just tried that, still doesn't work, it just doesn't show a Command error if I take away the Success part.
Reply
#4

Sly bump after almost 4 hours... Really need some help with this as it's pretty much stopping my progress overall with my gamemode...
Reply
#5

pawn Код:
#include <a_samp>
//#include <dini>
#include "DynamicParams.inc"
#include "rCmd.inc"

forward OnPlayerCommandReceived(playerid, cmdtext[]);
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);

rCmd[]->kill(playerid)
{
    SetPlayerHealth(playerid,0.0);
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        return SendClientMessage(playerid, 0xFF0000FF, "* Unknown Command");
    }
    return 1;
}

main() {
    AddPlayerClass(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
Fine here.
Reply
#6

You deleted OnPlayerCommandText?
Reply
#7

Hmm, I pasted your code into a completely blank pwn document and the command worked.
I've just slowly searched through my whole gamemode commenting out parts until the no parameter commands (/kill and /time for example) worked (Got the gm down to literilly just what you posted above) and made my way through uncommenting everything checking if they still worked each time. And all I have left is the commands commented except /kill and /time. They work, but if I go in game and write an unrecongnised command, they would no longer work either. If I uncomment anymore commands such as /Say for example that command wont work, yet still letting me use those 2 non parameter commands. Just for reference, here's my /say command.
pawn Код:
rCmd[s]->say(playerid,success,text[])
{
    new resStr[128];
    if(!success) return SendClientMessage(playerid,COLOUR_WHITE,"* Usage: /Say [Text]");
    format(resStr,128,"%s says %s",PlayerName(playerid),text);
    ProxDetector(5.0, playerid, resStr,COLOR_GRAD1,COLOR_GRAD2,COLOR_GRAD3,COLOR_GRAD4,COLOR_GRAD5);
    return 1;
}
Any advice?

Edit: To the post above, yes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)