%s unkown command - 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: %s unkown command (
/showthread.php?tid=311976)
%s unkown command -
rido1998 - 19.01.2012
Hello friends,my request code player use command and command not mode should "%s not command" thank you.
Re: %s unkown command -
[ABK]Antonio - 19.01.2012
are you using OnPlayerCommandText?
Re: %s unkown command -
rido1998 - 19.01.2012
Yeah.
Re: %s unkown command -
[ABK]Antonio - 19.01.2012
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/ban", cmdtext, true))
{
if(IsPlayerAdmin(playerid))
{
new id;
if(sscanf(cmdtext, "r", id)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /ban <playerid/partofname>");
if(IsPlayerAdmin(id)) return SendClientMessage(playerid, 0xCC0000AA, "You can't ban admins!");
new str[128], name[MAX_PLAYER_NAME], bname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, bname, sizeof(bname));
format(str,sizeof(str), "%s[%d] has banned %s[%d]", name, playerid, bname, id);
SendClientMessageToAll(0xCC0000AA, str);
BanEx(id, str);
}
return 1;
}
return SendClientMessage(playerid, 0xCC0000AA, "Invalid Command."); //this should work
}
Re: %s unkown command -
rido1998 - 19.01.2012
Not my request example player use /aasadasdasd and not command message: "/aasadasdasd" not command okey ?
Re: %s unkown command -
[ABK]Antonio - 19.01.2012
Quote:
Originally Posted by rido1998
Not my request search my request use command name example player use /aasadasdasd and not command message: "/aasadasdasd" not command okey ?
|
what
Re: %s unkown command -
MasterJoker - 19.01.2012
oh i know what he mean when he use a command he want to announce to everyone
Re: %s unkown command -
rido1998 - 19.01.2012
Not topic post.
Re: %s unkown command -
spedico - 19.01.2012
He means that if you type an invalid command (such as /hi, and there's no such command) it says "/hi is not a valid command".
Re: %s unkown command -
[ABK]Antonio - 19.01.2012
pawn Код:
new str[128];
format(str,sizeof(str), "%s is not a valid command!", cmdtext);
return SendClientMessage(playerid, 0xCC0000AA, str);
What about this?