28.05.2013, 12:41
Hello!
I have one problem! I made the /report command and I don't get any ERROR or WARNING, but ingame there aren't any names in my report and not the right IDs -.- Can someone check my code pls?
Code:
Stocks:
Thanks
I have one problem! I made the /report command and I don't get any ERROR or WARNING, but ingame there aren't any names in my report and not the right IDs -.- Can someone check my code pls?
Code:
pawn Code:
CMD:report(playerid, params[])
{
new targetid;
new reason;
new string[200];
if(sscanf(params, "us", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /report [playerid][reason]");
if(IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
format(string, sizeof(string), "{80FF00}[REPORT]: {80FF00}%s(ID:%d) {00FF00}has Reported {80FF00}%s(ID:%d){00FF00}! {FF0000}|| {00FF00}Reason: {80FF00}%s", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendAdminMessage(string);
SCM(playerid, COLOR_GREEN, "[REPORT]: Report has been send to an Online Administrator(/admins)! Thanks for Reporting!");
return 1;
}
pawn Code:
stock GetName(playerid)
{
new
name[24];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
stock SendAdminMessage(const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][Adminlevel] >= 1)
SendClientMessage(i, -1, string);
}
return 1;
}