SA-MP Forums Archive
Command not found - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command not found (/showthread.php?tid=372740)



Command not found - kbalor - 28.08.2012

Anyone know how to make this?

So If I do /car or any command that I did not make.

If it's not on the server command list then SendClientMessage " Command not found in the server command list"

I should also take effect with the other filterscripts commands.


Re: Command not found - [D]ry[D]esert - 28.08.2012

you mean this ?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return SendClientMessage(playerid,-1,"sorry we cant find this command in our gamemode"); //change it to what ever you want
}



Re: Command not found - kbalor - 28.08.2012

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
you mean this ?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return SendClientMessage(playerid,-1,"sorry we cant find this command in our gamemode"); //change it to what ever you want
}
Something like that. I have tried it but no effect. It show's nothing


Re: Command not found - [D]ry[D]esert - 28.08.2012

Can you show us your OnPlayerCommandText ?


Re: Command not found - kbalor - 28.08.2012

It's empty. The only I have is that the code you've given me..


Re: Command not found - [D]ry[D]esert - 28.08.2012

do you make GM yet or its new ? if you already made one show it if you want to.


Re: Command not found - fiki574 - 28.08.2012

If you have "OnPlayerCommandText" in GM and any other FS, those two will mix up, and eventually give you error message on executing correct command from FS and/or GM! I suggest you to remove all commands from all FS's you got and put them to your gamemode!


Re: Command not found - dannyk0ed - 28.08.2012

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, COLOR_WHITE, "Command not found in the server command list.");
    return 1;
}
He wanted something like this.


Re: Command not found - kbalor - 28.08.2012

Quote:
Originally Posted by dannyk0ed
Посмотреть сообщение
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, COLOR_WHITE, "Command not found in the server command list.");
    return 1;
}
He wanted something like this.
OMG! This is exactly what I need! It works even you have command's in any of your filterscript. +2rep! you save my script