/report help - 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 help (
/showthread.php?tid=249811)
/report help -
Force_ - 20.04.2011
Hello, I tried to make a /report command using strcmp but I failed.
And I can't compile zcmd & sscanf in an FS for some reason.
Can anyone give me an strcmp /report command or an already-made zcmd & sscanf /report FS?
Thanks.
Re: /report help -
xir - 20.04.2011
You can't use strcmp & zcmd at the same time, you need to use one of them, however I suggest zcmd & sscanf.
pawn Код:
COMMAND:report(playerid, params[])
{
new string[128], pID, reporter[MAX_PLAYER_NAME], reported[MAX_PLAYER_NAME];
if(sscanf(params, "us[128]", pID, params[0])) return SendClientMessage(playerid, -1, "Usage: /report <playerid/playername> <reason>");
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "This player not connected");
GetPlayerName(playerid, reporter, sizeof(reporter));
GetPlayerName(pID, reported, sizeof(reported));
format(string, sizeof(string), "%s reports %s for: %s",reporter, reported, params[2]);
WhoToSend?Admins?(-1, string); // Edit this
return 1;
}
Re: /report help -
Force_ - 20.04.2011
Do I need to put it in a filterscript? or in OnPlayerCommandText..?
Re: /report help -
int3s0 - 20.04.2011
No, You can add it in gamemode. Don't add in any callback.
Re: /report help -
Force_ - 20.04.2011
Код:
(341) : warning 217: loose indentation
(477) : error 017: undefined symbol "SendMessageToAdmins"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
SendMessageToAdmins(COLOR_YELLOW, string);
Re: /report help -
xir - 20.04.2011
pawn Код:
forward SendMessageToAdmins(color, const string[]);
public SendMessageToAdmins(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][your admin variable] >=1)
{
SendClientMessage(i, COLOR_YELLOW, string);
}
}
return 1;
}
Now you can use that line
Re: /report help -
Force_ - 20.04.2011
Код:
(341) : warning 217: loose indentation
(486) : error 017: undefined symbol "PlayerInfo"
(486) : warning 215: expression has no effect
(486) : error 001: expected token: ";", but found "]"
(486) : error 029: invalid expression, assumed zero
(486) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Line 486 -
pawn Код:
if(PlayerInfo[i][Level] >=1)
By the way I'm using Xtreme Admin System.
Re: /report help -
Force_ - 20.04.2011
Bump.
Anyone?
Re: /report help -
xir - 20.04.2011
I dont know how xtreme admin works sorry, you can wait for someone who does
Re: /report help -
Rivera - 20.04.2011
pawn Код:
CMD:report(playerid, params[]) {
if(sscanf(params, "s[128]", params)) {
for(new i = 0; i < MAX_PLAYERS; ++i) {
if(IsPlayerAdmin(i)) {
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "Report from %s: %s", name, params);
SendClientMessage(i, -1, str);
}
}
}
else return SendClientMessage(playerid, -1, "Syntax Error: /report [message]");
return 1;
}