01.01.2015, 16:50
No HY, He probably tested it like:
* He logs in as RCON administrator.
> The other player kills him with a minigun
= He gets the message (%s was automatically reported ...)
If you need to send the message to all the online RCON administrators, you just need to do this:
The callback would be like:
Also HY, If you're doing a for loop with players, you MUST check if the player is connected to the server (IsPlayerConnected)
* He logs in as RCON administrator.
> The other player kills him with a minigun
= He gets the message (%s was automatically reported ...)
If you need to send the message to all the online RCON administrators, you just need to do this:
The callback would be like:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 38)
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
new hackername[MAX_PLAYER_NAME], str[128]; //
GetPlayerName(playerid, hackername, sizeof(hackername)); // you get the name of the person who GOT killed (not the killer).
format(str, sizeof(str), "{FF0000}ATTENTION: %s has been automaticlly reported by the server for using hacks [REASON: Minigun]", killerid); // The player who died is called a 'hacker'.
SendClientMessage(playerid, -1, str); // only if the player is rcon-admin he will get the (Wrong)message.
SendClientMessage(i, -1, str);
}
}
}
}
return 1;
}