12.07.2011, 19:38
error 017: undefined symbol "cmd"
any help heres my command
any help heres my command
pawn Код:
if(strcmp(cmd, "/report", true) == 0)
{
new str[200];
GetPlayerName(playerid, str, 24);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /report [text]");
format(str, sizeof str, "Report from [%d] %s: %s", playerid, str, result);
for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerAdmin(i)) SendClientMessage(i, 0xFFFF00FF, str); }
SendClientMessage(playerid, 0xFFFF00FF, "Your report message was sent to online administrators, thank you.");
return 1;
}