Not existing command message error
#1

Hi, I have removed
pawn Код:
return 0;
}
under the OnPlayerCommandText lines and I have added
pawn Код:
return SendClientMessage(playerid,0xFFFFFFAA,"The command {FF0000}%s {FFFFFF}doesn't exist.");
}
To show the players the commands which aren't existing, but
Код:
%s
maybe isn't the right function.
When I type wrong command it doesn't show this message it crashes the server.How can I fix that?
Reply
#2

You gotta use a format for that, then use SendClientMessage(playerid, COLOR, string);


EDIT:

I'll help you :P...

new string[no. of strings];
format(string, sizeof(string), "%s has not been found, please use /help or /commands to check for the command list", commandname);

(You can do the command name part your self)

then

return SendClientMessage(playerid, 0xFFFFFFAA, string); <- try that... not sure if it works or not, just a guess
Reply
#3

I done that you said,but it shows ingame: has not been found, please use /help or /commands to check for the command list. I mean that it doesn't show the wrong command , for example:
Код:
/testcmd
It shows only
Код:
has not been found, please use /help or /commands to check for the command list
I want to see:
Код:
/testcmd has not been found, please use /help or /commands to check for the command list
Reply
#4

if you use sscanf, try this:


new commandname; // If string is needed put a "," and add string[54]; or something
if(sscanf(cmd, "s", commandname)) // if its zcmd change cmd to params
format(string, sizeof(string), "%s has not been found", commandname);
return SendClientMessage(playerid, oxFFFFFFF, string);
Reply
#5

pawn Код:
new string[128];
format(string, sizeof(string), "The command {FF0000}%s {FFFFFF}doesn't exist.", cmdtext);
return SendClientMessage(playerid,0xFFFFFFAA,string);
}
Reply
#6

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
new string[128];
format(string, sizeof(string), "The command {FF0000}%s {FFFFFF}doesn't exist.", cmdtext);
return SendClientMessage(playerid,0xFFFFFFAA,string);
}
You just taught me something (still a beginner scripter )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)