Not showing admin text - 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: Not showing admin text (
/showthread.php?tid=437520)
Not showing admin text -
DerickClark - 16.05.2013
if the player type a command.
going to say Used: .but not the name.if i i'm a admin shows the names.
Here Code:
Код:
// This function sends the given text to all admins
SendAdminText(playerid, command[], text[])
{
// Setup local variables
new Name[24], Msg[128];
// Loop through all players
for (new i; i < MAX_PLAYERS; i++)
{
// Check if the player is an admin
if (APlayerData[i][PlayerLevel] >= 7)
{
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Send the given text to the admin
format(Msg, 128, "{C9C9C9}%s used: %s %s", Name, command, text);
SendClientMessage(i, 0xFFFFFFFF, Msg);
}
}
// Also log all used commands in the server.log file
format(Msg, 128, "%s used: %s %s", Name, command, text);
print(Msg);
}
Re: Not showing admin text -
Threshold - 16.05.2013
pawn Код:
SendAdminText(playerid, command[], text[])
{
new Name[24], Msg[128];
GetPlayerName(playerid, Name, sizeof(Name));
format(Msg, sizeof(Msg), "%s used: %s %s", Name, command, text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(APlayerData[i][PlayerLevel] > 6)
{
SendClientMessage(i, 0xC9C9C9FF, Msg);
}
}
}
printf("%s used: %s %s", Name, command, text);
return 1;
}
I assume this would work... otherwise, show us how you're using this function.