Some little help ;D - 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: Some little help ;D (
/showthread.php?tid=94342)
Some little help ;D -
Striker_Moe - 29.08.2009
How can I change this function so the adminґs name is displayed too?
Код:
if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
{
if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new result[128];
result = bigstrtok(cmdtext, idx);
if(!strlen(result))
{
SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an admin message.");
return 1;
}
format(string, sizeof(string), "::: Admin: %s :::", result);
SendClientMessageToAll(LIGHTRED, string);
printf("%s", string);
}
else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
return 1;
}
Re: Some little help ;D -
Correlli - 29.08.2009
Change:
pawn Код:
format(string, sizeof(string), "::: Admin: %s :::", result);
SendClientMessageToAll(LIGHTRED, string);
to:
pawn Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "::: Admin %s: %s :::", playername, result);
SendClientMessageToAll(LIGHTRED, string);
Re: Some little help ;D -
ded - 29.08.2009
Код:
if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
{
if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new result[128];
result = bigstrtok(cmdtext, idx);
if(!strlen(result))
{
SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an admin message.");
return 1;
}
format(string, sizeof(string), "::: Admin %s: %s :::", sendername, result);
SendClientMessageToAll(LIGHTRED, string);
printf("%s", string);
}
else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
return 1;
}