28.02.2010, 00:15
OOC /b command code
ERROR IS:
Код:
if(strcmp(cmd, "/b", true) == 0)//local ooc { if(IsPlayerConnected(playerid)) { new str[160]; GetPlayerName(playerid, str, MAX_PLAYER_NAME); for (new i = 0; i < MAX_PLAYER_NAME; i++) if (str[i] == '_') str[i] = ' '; 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_USAGE, "USAGE: /b [local ooc chat]"); return 1; } format(str, sizeof(str), "((%s Says: %s))", str, result); SendClientMessage(playerid, COLOR_OOC, string); //LocalLog(string[]); printf("%s", str); } return 1; }
Код:
C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : warning 219: local variable "str" shadows a variable at a preceding level C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(532) : error 029: invalid expression, assumed zero C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(532) : error 017: undefined symbol "string" C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(532) : error 029: invalid expression, assumed zero C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(532) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.