Report command (working!) -
MeNMyselv - 12.07.2011
I need a report script and i tried things but they didn't work and now i need a working one.
I searched the forum and ****** buut didn't find anything.
it needs to be like: "/report [ID][Reason]"
plz give me code that works.
and i will be happy if the reports can come in a log .txt file
srry if bad English but im Dutch
THNX for interest and maybe for helping
Re: Report command (working!) -
Shadoww5 - 12.07.2011
https://sampforum.blast.hk/showthread.php?tid=268371
PHP код:
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;
}
Note: The report will only be sent to RCON ADMINS.
Re: Report command (working!) -
MeNMyselv - 12.07.2011
@Shadoww5
Won't work either i get these errors:
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(326) : error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(32
: error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(32
: warning 215: expression has no effect
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(330) : error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(332) : error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(334) : error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(335) : error 017: undefined symbol "idx"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(335) : warning 215: expression has no effect
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(337) : error 017: undefined symbol "idx"
Re: Report command (working!) -
Mauzen - 12.07.2011
add
new idx;
in front of it.
Re: Report command (working!) -
MeNMyselv - 12.07.2011
@Mauzen
yes it works
.
thank you very very very very very very very very very muuuuuuuuuuuuuuuucccccccccccchhhhhhhhhhhhhh!!!!!!!
Re: Report command (working!) -
MeNMyselv - 12.07.2011
now next problem
when i do "/report" it sends "John_Lennon reports" or something like that
but i can't ad an id from user or reason because when i do that it says "unknown command"
can anyone fix that??