if(strcmp(cmd, "/me", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]"); return 1; } else { format(string, sizeof(string), "* %s %s", sendername, result); } ProxDetector(30.0, playerid, string, COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY); printf("%s", string); // You need to add this return 1, this tells the program that the command worked successfully (or something like that) return 1; }
Originally Posted by japufta
Simple, you are never returning that the command worked in your code, all you have to do is add a "return 1;" line after every command you do is finished.
I did the /me for you: Код:
if(strcmp(cmd, "/me", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]"); return 1; } else { format(string, sizeof(string), "* %s %s", sendername, result); } ProxDetector(30.0, playerid, string, COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY); printf("%s", string); // You need to add this return 1, this tells the program that the command worked successfully (or something like that) return 1; } |
new
string[128];
if(!strcmp(cmdtext,"/me",true))
{
if(cmdtext[idx++]!=32||cmdtext[idx]==EOS) return SendClientMessage(playerid,color,"/me [text]");
format(string,sizeof(string)," %s %s",the_player_name,cmdtext[idx]);
SendClientessageToAll(color,string);
return 1;
}
if(!strcmp(cmdtext[1],"me",true,2))
{
if(!cmdtext[4])return SendClientMessage(playerid,0xFF0000FF,"Command Requires Parameter. eg \"* Joe Staff Punches The Wall\"");
new string[130];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),* "%s %s",string,cmdtext[3]);
return SendClientMessageToAll(0xAA33AAFF,string);
}
Originally Posted by japufta
Simple, you are never returning that the command worked in your code, all you have to do is add a "return 1;" line after every command you do is finished.
I did the /me for you: Код:
if(strcmp(cmd, "/me", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]"); return 1; } else { format(string, sizeof(string), "* %s %s", sendername, result); } ProxDetector(30.0, playerid, string, COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY); printf("%s", string); // You need to add this return 1, this tells the program that the command worked successfully (or something like that) return 1; } |
Originally Posted by MenaceX^
Quote:
You're funny. I'm sure it's taken from somewhere. Don't use his code, it's very useless.. Use this: pawn Код:
|