24.04.2013, 21:44
(
Последний раз редактировалось jakejohnsonusa; 24.04.2013 в 23:23.
)
I'm having a slight issue with my /report command. sometimes when people do /report it reports their ID and not the id they wanted to report.
EX:
Jake /report Bob Hacking!
[INFO]: Jake (0) Has Reported Jake (0) for: Hacking!
Here is the command code:
Please & thanks for help with this issue
EX:
Jake /report Bob Hacking!
[INFO]: Jake (0) Has Reported Jake (0) for: Hacking!
Here is the command code:
pawn Код:
if(strcmp(cmd, "/report", true) == 0 || strcmp(cmd, "/re", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(JustReported[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "** Wait 1 minute after sending another report! ");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/re)port [playerid/PartOfName] [text]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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: (/re)port [playerid] [text]");
return 1;
}
if(PlayerInfo[playerid][pRegularRank] == 0)
{
format(string, sizeof(string), "[INFO]: %s (%d) Has Reported %s (%d) for: %s",sendername, playerid, giveplayer, giveplayerid, (result));
}
else
{
format(string, sizeof(string), "[INFO]: High-Ranking Player %s (%d) Has Reported %s (%d) for: %s",sendername, playerid, giveplayer, giveplayerid, (result));
}
SendAdminMessage(COLOR_GREEN,string);
SendAdminMessage(COLOR_LIGHTRED, "----------------------------------------------------------------------------------------------");
SendAdminMessage(COLOR_GREEN,"Type '/acceptreport (/ar) [reporter id]' or '/trashreport (/tr) [reporter id]'");
SendClientMessage(playerid, COLOR_LIGHTRED, "* Your report was sent and reviewed by the Server Admins that are online.");
JustReported[playerid] = 1;
PlayerNeedsHelp[playerid] = 1;
SetTimerEx("ReportReset", 60000, false, "i", playerid);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Reported %s for: %s",d,m,y,h,mi,s,sendername, giveplayer, (result));
ReportLog(string);
Reports[MAX_REPORTS-1] = string;
}
}
}
return 1;
}