22.08.2009, 00:02
Okay, whenever I do a command, it works, like if i were to do /me waves, it would say **Memoryz waves
But it also says No Command exists, even though it does and it works.
Heres are my current commands:
But it also says No Command exists, even though it does and it works.
Heres are my current commands:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new sendername[MAX_PLAYER_NAME]; new idx; new string[256]; cmd = strtok(cmdtext, idx); dcmd(login,5,cmdtext); // because login has 5 characters dcmd(register,8,cmdtext); // because register has 8 characters if (strcmp("/help", cmdtext, true, 10) == 0) { SendClientMessage(playerid,COLOR_YELLOW,"Account: /register /login /stats"); SendClientMessage(playerid,COLOR_YELLOW,"Roleplay: /me /do /attempt /(s)hout /(w)hisper /rap /freestyle /sing"); } if(strcmp(cmd, "/low", true) == 0 || strcmp(cmd, "/l", 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, red, "USAGE: /low [chat text]"); return 1; } else { format(string, sizeof(string), "%s Says: [LOW] %s", sendername, result); } ProxDetector(3.0, playerid, string,red,red,red,red,red); printf("%s", string); } if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", 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, red, "USAGE: /shout [chat text]"); return 1; } else { format(string, sizeof(string), "%s Says: [shout] %s", sendername, result); } ProxDetector(30.0, playerid, string,red,red,red,red,red); printf("%s", string); } 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, red, "USAGE: /me [action]"); return 1; } else { format(string, sizeof(string), "* %s %s", sendername, result); } ProxDetector(30.0, playerid, string, red,red,red,red,red); printf("%s", string); } if(strcmp(cmd, "/b", true) == 0)//local ooc { 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, grey, "USAGE: /b [local ooc chat]"); return 1; } else { format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result); } ProxDetector(20.0, playerid, string,grey,grey,grey,grey,grey); printf("%s", string); } if(strcmp(cmd, "/freestyle", true) == 0 || strcmp(cmd, "/f", 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, grey, "USAGE: /freestyle [Your FreeStyle]"); return 1; } else { format(string, sizeof(string), " [%i] %s FreeStyles: %s ", playerid, sendername, result); } ProxDetector(20.0, playerid, string,green,green,green,green,green); printf("%s", string); } if(strcmp(cmd, "/rap", true) == 0 || strcmp(cmd, "/r", 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, grey, "USAGE: /rap [Your Rap]"); return 1; } else { format(string, sizeof(string), " [%i] %s Raps: %s ", playerid, sendername, result); } ProxDetector(20.0, playerid, string,orange,orange,orange,orange,orange); printf("%s", string); } if(strcmp(cmd, "/sing", 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, grey, "USAGE: /sing [Your sing]"); return 1; } else { format(string, sizeof(string), " [%i] %s Sings: %s ", playerid, sendername, result); } ProxDetector(30.0, playerid, string,orange,orange,orange,orange,orange); printf("%s", string); } return 0; }