how to send admin messege - 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: how to send admin messege (
/showthread.php?tid=418338)
how to send admin messege -
Joe_Goro - 24.02.2013
i know there is sendclientmessege but it's for all players how to send it to admins only ?
Re: how to send admin messege -
tyler12 - 24.02.2013
Код:
stock SendAdminMessage(color,text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i,color,text);
}
}
return 1;
}
Re: how to send admin messege -
Joe_Goro - 24.02.2013
no i mean i have this in my script
Код:
CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendadminMessage(COLOR_DARKRED, 1, string);
return 1;
}
send admin message is eroorr so there is another type ? if idid
sendclientmessege it's succes but i wanna this for admin
Re: how to send admin messege -
DaRk_RaiN - 24.02.2013
pawn Код:
CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendClientMessage(i, COLOR_DARKRED, string);
}
return 1;
}