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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Report command (
/showthread.php?tid=268371)
Report command -
MeNMyselv - 12.07.2011
hey guyz!! again
,
i need a script that you can report someone and i searched on ****** and the forum but i couldn't find it.
just like: "/report (ID) (reason)".
hope you can help
Srry if bad English cause im Dutch
THNX for interest and maybe for help
Re: Report command -
[MG]Dimi - 12.07.2011
PHP код:
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;
}
WoodPecker gave you this code in your topic today -.-
Re: Report command -
MeNMyselv - 12.07.2011
@[MG]Dimi
yeah i know but i need another cause this one didn't work -.-
Re: Report command -
MeNMyselv - 12.07.2011
@[MG]Dimi
and here are the errors:
Код:
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 017: undefined symbol "sendername"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 017: undefined symbol "sendername"
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : error 029: invalid expression, assumed zero
D:\Documents and Settings\ben\Mijn documenten\SAMP Server\gamemodes\LSF4A.pwn(325) : fatal error 107: too many error messages on one line
Re: Report command -
MeNMyselv - 12.07.2011
no one has a solution??
Re: Report command -
Shadoww5 - 12.07.2011
PHP код:
if(strcmp(cmd, "/report", true) == 0)
{
new str[200];
GetPlayerName(playerid, str, 24);
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, 0xFFFFFFFF, "USAGE: /report [text]");
format(str, sizeof str, "Report from [%d] %s: %s", playerid, str, result);
for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerAdmin(i)) SendClientMessage(i, 0xFFFF00FF, str); }
SendClientMessage(playerid, 0xFFFF00FF, "Your report message was sent to online administrators, thank you.");
return 1;
}
Note: The report will only be sent to RCON ADMINS.