/report need help
#1

Hello,i got report command,it should look like this Me reports : him/her [reason:he dmed me]
but it looks like Me reports : [reason:1((thats id what i reported))he dmed me]
/report [playerid/partofname] [reason]

thanks

Quote:

if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new targetid = ReturnUser(tmp);
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "%s Reports : %s [reason: %s ]", sendername,giveplayername,(result));
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
}
return 1;
}

Reply
#2

Quote:
Originally Posted by Joker_EST
Hello,i got report command,it should look like this Me reports : him/her [reason:he dmed me]
but it looks like Me reports : [reason:1((thats id what i reported))he dmed me]
/report [playerid/partofname] [reason]

thanks

Quote:

if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new targetid = ReturnUser(tmp);
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "%s Reports : %s [reason: %s ]", sendername,giveplayername,(result));
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
}
return 1;
}

explain more what you want exactly plz !!
Reply
#3

Or just post it at the GF thread, as it's part from the GF.
Reply
#4

that is /report command,its should be like that player reports some other player like /report [ID] [REASON]
and admins should see it like [player who reported] reports: [playername] [reason:[reason]
but admins see it like [player who reported] reports : [reason:[ID comes here but i dont know why][reason]]
Reply
#5

help plase?

sorry for double post
Reply
#6

Maybe try this:

pawn Код:
if(strcmp(cmd, "/report", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        tmp = strtok(cmdtext, idx);
        new targetid = ReturnUser(tmp);
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
          idx++;
        }
        new offset = idx;
        new result[64];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
          result[idx - offset] = cmdtext[idx];
          idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [playerid/PartOfName] [reason]");
            return 1;
        }
        GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
        format(string, sizeof(string), "%s Reports : %s [reason: %s ]", sendername,giveplayername,(result));
        ABroadCast(COLOR_YELLOW,string,1);
        SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
    }
    return 1;
}
Reply
#7

thanks dude
Reply
#8

help please

C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(196) : error 017: undefined symbol "cmd"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(200) : error 017: undefined symbol "sendername"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(200) : error 017: undefined symbol "sendername"
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(200) : error 029: invalid expression, assumed zero
C:\Documents and Settings\DAVID RAZ\Desktop\server\gamemodes\mine.pwn(200) : fatal error 107: too many error messages on one line
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)