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.
public OnPlayerCommandText(playerid, cmdtext[])
{
new
idx,
cmd[128] = strtok(cmdtext, idx);
if(strcmp(cmd, "/b", true) == 0)
{
new
string[128];
tmp[128] = strtok(cmdtext, idx);
if(strlen(tmp) < 1) return SendClientMessage(playerid, COLOR, "Usage: /b [local ooc chat]");
else
{
new
Name[24];
GetPlayerName(playerid, Name, 24);
format(string, sizeof(string), "((%s says: %s))", Name, string);
SendClientMessageToAll(COLOR_OOC, string);
printf(string);
}
return 1;
}
return 0;
}
Originally Posted by SAWC™
pawn Код:
|
C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(376) : error 008: must be a constant expression; assumed zero C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : warning 217: loose indentation C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : error 017: undefined symbol "tmp" C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : warning 215: expression has no effect C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : error 001: expected token: ";", but found "]" C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : error 029: invalid expression, assumed zero C:\Users\Owner\AppData\Desktop\DM\gamemodes\DM.pwn(508) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
new
idx,
cmd[128] = strtok(cmdtext, idx);
if(strcmp(cmd, "/b", true) == 0)
{
new
string[128],
tmp[128] = strtok(cmdtext, idx);
if(strlen(tmp) < 1) return SendClientMessage(playerid, COLOR, "Usage: /b [local ooc chat]");
else
{
new
Name[24];
GetPlayerName(playerid, Name, 24);
format(string, sizeof(string), "((%s says: %s))", Name, string);
SendClientMessageToAll(COLOR_OOC, string);
printf(string);
}
return 1;
}
return 0;
}
Originally Posted by SAWC™
pawn Код:
|
C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(376) : error 008: must be a constant expression; assumed zero C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(508) : error 008: must be a constant expression; assumed zero C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(518) : error 029: invalid expression, assumed zero C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(518) : warning 215: expression has no effect C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(518) : error 001: expected token: ";", but found ")" C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(518) : error 029: invalid expression, assumed zero C:\Users\Owner\AppData\Desktop\Dm\gamemodes\Dm.pwn(518) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
new
idx,
cmd[128];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/b", true) == 0)
{
new
string[128],
tmp[128];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) < 1) return SendClientMessage(playerid, COLOR, "Usage: /b [local ooc chat]");
else
{
new
Name[24];
GetPlayerName(playerid, Name, 24);
format(string, sizeof(string), "((%s says: %s))", Name, string);
SendClientMessageToAll(COLOR_OOC, string);
printf(string);
}
return 1;
}
return 0;
}