07.02.2010, 13:29
I got this /ra command from a friend, but he don't know how to fix it, either do I.
Could you just take a fast look at it and see if you find some errors that can make it to work.
Thanks
Could you just take a fast look at it and see if you find some errors that can make it to work.
Код:
if(strcmp(cmd, "/ra", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == TEAM_LSPD || gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_LSER && PlayerInfo[playerid][LAERank] >= 1) { SendClientMessage(playerid, COLOR_RED, "Identification Error - You are not a qualified Police Officer !"); return 1; } 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: /ra [text]"); return 1; { format(string, sizeof(string), "Police Radio: %s: %s, over. **", sendername, result); SendRadioMessage(5, COLOR_BLUE, string); printf("%s", string); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s whispers something in the radio.", sendername); ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); return 1; } else { SendClientMessage(playerid, COLOR_RED, "Identification Error - You are not a Police Officer."); return 1; } } return 1; }
