Report command
#1

hey guyz!! again ,
i need a script that you can report someone and i searched on ****** and the forum but i couldn't find it.
just like: "/report (ID) (reason)".
hope you can help

Srry if bad English cause im Dutch
THNX for interest and maybe for help
Reply
#2

PHP код:
if(strcmp(cmd"/report"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
GetPlayerName(playeridsendernamesizeof(sendername));
            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(playeridCOLOR_WHITE"USAGE: /report [text]");
            
format(stringsizeof(string), "Report from [%d]%s: %s",playeridsendername, (result));
            
ABroadCast(COLOR_LIGHTYELLOW,string,1);
            
SendClientMessage(playeridCOLOR_YELLOW"Your report message was sent to online administrators, thank you.");
        }
        return 
1;
    } 
WoodPecker gave you this code in your topic today -.-
Reply
#3

@[MG]Dimi
yeah i know but i need another cause this one didn't work -.-
Reply
#4

@[MG]Dimi
and here are the errors:
Код:
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 017: undefined symbol "sendername"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 017: undefined symbol "sendername"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 029: invalid expression, assumed zero
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : fatal error 107: too many error messages on one line
Reply
#5

no one has a solution??
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)