22.09.2013, 09:02
Error:
Код:
error 008: must be a constant expression; assumed zero
Код:
CMD:pm(playerid, cmdtext[]) { new idx = strfind(cmdtext, " ", true); if((cmdtext[0] == EOS) || ((cmdtext[0] == '\1') && (cmdtext[1] == EOS)) || (idx == -1)) { SendClientMessage(playerid,COLOR_RED,"Usage: /pm [id] [message]"); return 1; } if(cmdtext[idx + 1] == EOS) { SendClientMessage(playerid,COLOR_RED,"Usage: /pm [id] [message]"); return 1; } cmdtext[idx++] = EOS; new id = strval(cmdtext); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,COLOR_RED,"Invalid Player ID"); return 1; } if(playerid == id) { SendClientMessage(playerid,COLOR_RED,"You cannot PM yourself."); return 1; } new string[256]; if(TogPM{id} == 0) return SendClientMessage(playerid, COLOR_ERROR, "This player has turned off his PM's!"); else GetPlayerName(id, string, MAX_PLAYER_NAME); format(string, sizeof string, "[PM] sent to %s(%d): {FFFFFF}%s", string, id, cmdtext[idx]); SendClientMessage(playerid, COLOR_RED, string); GetPlayerName(playerid, string, MAX_PLAYER_NAME); format(string, sizeof string, "[PM] from %s(%d): {FFFFFF}%s", string, playerid, cmdtext[idx]); SendClientMessage(id, COLOR_RED, string); printf("PM: %s", cmdtext[idx]); return 1; }