SA-MP Forums Archive
Wrong Command Text Help - 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: Wrong Command Text Help (/showthread.php?tid=279775)



Wrong Command Text Help - Irock23 - 28.08.2011

Okay, basically what I need help with is that I set my server up so when you do an incorrect command instead of saying "SERVER: Unknown command." it will say "No such command! Type /cmds for a list of player commands."
Here is my code (btw I'm using ZCMD):

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
    return 1;
}
The problem is if I do a command from a different filterscript it will give me this message and it won't do the command. So if anyone has any ideas on how to fix this, that would be great.


Re: Wrong Command Text Help - uprp - 29.08.2011

Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work


Re: Wrong Command Text Help - LetsOWN[PL] - 29.08.2011

Quote:

The problem is if I do a command from a different filterscript it will give me this message and it won't do the command. So if anyone has any ideas on how to fix this, that would be great.

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
    return 1;
}
Place it into this filterscript, that you're using?

Quote:

Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work

Oh, really? Very smart :P


Re: Wrong Command Text Help - grand.Theft.Otto - 29.08.2011

Quote:
Originally Posted by uprp
Посмотреть сообщение
Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work
lol ? There is no SERVER: Unknown command in any gamemode, by default this is what samp-server returns if their is no custom message returned of from a faulty custom made command.

And if you want ALL messages to say your custom message, you'll have to add it to each filterscript ONLY if they are ZCMD (since you said you use it) OR merge each filterscript into your gamemode and convert it to ZCMD.


Re: Wrong Command Text Help - Horrible - 29.08.2011

Quote:
Originally Posted by uprp
Посмотреть сообщение
Try CTRL+F search for SERVER: Unknown command

Replace with what you want.

Works for me. also, you've to put that into every FS if you want it to work
are you kidding or what?
thre no server uknown command in pawno it setted automatically from SAMP if samp cannot find command that you type


Re: Wrong Command Text Help - Bakr - 29.08.2011

Note that you need to define FILTERSCRIPT before including ZCMD if using it inside a filterscript.

Quote:
Originally Posted by Horrible
are you kidding or what?
thre no server uknown command in pawno it setted automatically from SAMP if samp cannot find command that you type
Interesting, I had no idea a text editor had so much power. And technically SA:MP doesn't automatically send the message when you type an incorrect command, only when you return 0 in the callback, hence why you can send custom messages.


Re: Wrong Command Text Help - Improvement™ - 29.08.2011

I use this methode already for about 1-2 years, never had any kind of problems with this.
Perhaps this is what you are searching for, I also added your desired message.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
}
    return SendClientMessage(playerid, COLOR_RED, "No such command! Type /cmds for a list of player commands.");
}



Re: Wrong Command Text Help - Irock23 - 29.08.2011

Thanks for trying to help, but I figured it out on my own. I just had to put it only in the last filterscript that loads.