[Help]: /report command! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help]: /report command! (
/showthread.php?tid=440093)
[Help]: /report command! -
Areax - 28.05.2013
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:
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;
}
Stocks:
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;
}
Thanks
Re: [Help]: /report command! -
Areax - 28.05.2013
Bump
Re: [Help]: /report command! -
Red_Dragon. - 28.05.2013
You cannot bump except after 48 hours have passed. I beg you, read the rules please.
Re: [Help]: /report command! -
Areax - 28.05.2013
Ok, sorry.
AW: [Help]: /report command! -
HurtLocker - 28.05.2013
Firstly add this: new reason[80];
Secondly what do you mean with this: there aren't any names in my report
Try remove the const thing: stock SendAdminMessage(string[])
Re : [Help]: /report command! -
Stefano.R - 28.05.2013
What sentence do you get when you use that command?
Re: AW: [Help]: /report command! -
Areax - 28.05.2013
Quote:
Originally Posted by HurtLocker
Firstly add this: new reason[80];
Secondly what do you mean with this: there aren't any names in my report
Try remove the const thing: stock SendAdminMessage(string[])
|
Well I get a report like this:
[REPORT]: (ID:105) has Reported (ID:115)! || Reason: Reason
It should be: [REPORT]: name1(ID:his right ID) has Reported name2(ID:his right ID)! || Reason: Reason