12.07.2011, 15:05
hey guyz
i have a script for a report command.
it works a little because when i do "/report" it sends the admin a message "report from MeNMyselv".
and i want that when you do "/report" that it sends a client message like "Usage: /report [ID/username] [Reason]"
and when i do for a test "/report 0 spawnkill"
it says Unknown Command.
Here's the code:
plz help me hope you can fix it
srry if bad English but im Dutch
THNX for interest and maybe for helping
i have a script for a report command.
it works a little because when i do "/report" it sends the admin a message "report from MeNMyselv".
and i want that when you do "/report" that it sends a client message like "Usage: /report [ID/username] [Reason]"
and when i do for a test "/report 0 spawnkill"
it says Unknown Command.
Here's the code:
Код:
if (strcmp("/report", cmdtext, true, 10) == 0) { new str[200]; new idx; 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 [ID] [Reason]"); 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."); SendClientMessage(playerid, 0xFFFF00FF, "We will find a solution soon. We will let you know what we did."); return 1; }
srry if bad English but im Dutch
THNX for interest and maybe for helping