Need help [/report command] -
OmerKhan - 03.08.2016
Hey guys i am trying to make a /report cmd since past one week, I also searched samp forums but didn't got any help, Please i need a /report command for my server if anyone can send me the code it will be really appericated as i am looking for this command since one week, No Doubt i will also co operate with the one who wants to helps me
Regards,
Omer khan
Re: Need help [/report command] -
AndySedeyn - 03.08.2016
It's good of you that you've tried. Your code is probably not all too bad. Though, this section isn't for script requests, so unless you post your code, we can't help.
Re: Need help [/report command] -
Jpew - 03.08.2016
Try following this script
http://pastebin.com/raw/KDz2mAjq
Re: Need help [/report command] -
Shinja - 03.08.2016
Its easy, just format a string and send it to admins, and maybe a gametext "NEW REPORT"
Re: Need help [/report command] -
OmerKhan - 03.08.2016
thnx for the help guys
![Smiley](images/smilies/smile.png)
But i am trying to use this cmd and every time i try to compile it my pawno crashes
Код:
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 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)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
format(string, sizeof(string), "Report from [%d]%s: %s",playerid, sendername, (result));
ABroadCast(COLOR_LIGHTYELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your report message was sent to online administrators, thank you.");
}
return 1;
}
Re: Need help [/report command] -
AndySedeyn - 03.08.2016
EDIT: hold on, let me rewrite that. I read it incorrectly.
Your way of handling command parameters is outdated. Take a look at sscanf and preferably also a command processor.
EDIT2: are you sure it's that command crashing the compiler? It compiles fine for me.
Re: Need help [/report command] -
OmerKhan - 03.08.2016
Guys i am new to pawno thats why i can't handle common errors, I really need help at this
Re: Need help [/report command] -
AndySedeyn - 03.08.2016
Quote:
Originally Posted by OmerKhan
Guys i am new to pawno thats why i can't handle common errors, I really need help at this ![Smiley](images/smilies/smile.png)
|
I edited my previous post:
Quote:
Originally Posted by AndySedeyn
EDIT2: are you sure it's that command crashing the compiler? It compiles fine for me.
|
Re: Need help [/report command] -
OmerKhan - 03.08.2016
Ye it Crashes every time and I'll provide anything to you, I just need some help
Re: Need help [/report command] -
SyS - 03.08.2016
Quote:
Originally Posted by OmerKhan
Ye it Crashes every time and I'll provide anything to you, I just need some help ![Smiley](images/smilies/smile.png)
|
probably a brace issue try missing bracket finder and scan your code