Report command (working!)
#1

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
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=268371

PHP код:
if(strcmp(cmd"/report"true) == 0)
{
    new 
str[200];
    
GetPlayerName(playeridstr24);
    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(playerid0xFFFFFFFF"USAGE: /report [text]");
    
format(strsizeof str"Report from [%d] %s: %s"playeridstrresult);
    for(new 
0MAX_PLAYERS++) { if(IsPlayerAdmin(i)) SendClientMessage(i0xFFFF00FFstr); }
    
SendClientMessage(playerid0xFFFF00FF"Your report message was sent to online administrators, thank you.");
    return 
1;

Note: The report will only be sent to RCON ADMINS.
Reply
#3

@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"
Reply
#4

add

new idx;

in front of it.
Reply
#5

@Mauzen
yes it works .
thank you very very very very very very very very very muuuuuuuuuuuuuuuucccccccccccchhhhhhhhhhhhhh!!!!!!!

Reply
#6

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??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)