/report problem
#10

Command fixed:

PHP код:
if(strcmp(cmd"/report"true) == 0)
{
    new 
str[256], idxn[24], n2[24];
    
str strtok(cmdtextidx);
    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) || !strlen(str)) return SendClientMessage(playerid0xFFFFFFFF"USAGE: /report [id] [reason]");
    if(!
IsPlayerConnected(strval(str)) || strval(str) == INVALID_PLAYER_ID) return SendClientMessage(plaeyrid0xFF0000FF"INVALID ID.");
    
GetPlayerName(playeridn24);
    
GetPlayerName(strval(str), n224);
    
format(strsizeof str"%s [%d] was reported by %s [%d] | Reason: %s"n2strval(str), strplayeridresult);
    for(new 
0MAX_PLAYERS++) { if(IsPlayerAdmin(i)) SendClientMessage(i0xFFFF00FFstr); }
    
SendClientMessage(playerid0xFFFF00FF"Your report message was sent to online administrators, thank you.");
    return 
1;

And put this at the bottom of you GM:

PHP код:
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }

    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;

Reply


Messages In This Thread
/report problem - by MeNMyselv - 12.07.2011, 15:05
Re: /report problem - by Shadoww5 - 12.07.2011, 15:38
Re: /report problem - by MeNMyselv - 12.07.2011, 15:39
Re: /report problem - by MeNMyselv - 12.07.2011, 15:41
Re: /report problem - by MeNMyselv - 12.07.2011, 15:44
Re: /report problem - by MeNMyselv - 12.07.2011, 16:04
Re: /report problem - by Unte99 - 12.07.2011, 16:16
Re: /report problem - by MeNMyselv - 12.07.2011, 16:48
Re: /report problem - by Unte99 - 12.07.2011, 17:46
Re: /report problem - by Shadoww5 - 12.07.2011, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)