SendDeathMessage to admins
#1

Is there any way to only SendDeathMessage to admins instead of broadcasting it to the whole server?

Something like this:
pawn Код:
public OnPlayerDeath
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(UserStats[i][Admin] > 0) SendDeathMessage..
    }
}
Reply
#2

No, there isn't such a function, but you can always make a textdraw with the killfeed in it.
Reply
#3

Was mistaken, do as Mean told you
Reply
#4

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerAdmin(playerid))
   {
        SendDeathMessage(killerid, playerid, reason);
   }
    return 1;
}
Try this...
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerAdmin(playerid))
   {
        SendDeathMessage(killerid, playerid, reason);
   }
    return 1;
}
Try this...
That won't work. That code will send a death message to everyone if the player who died was an admin.
Reply
#6

Are you sure? Because if you add only the SendDeathMessage the message will go to everyone, so check if is admin and then send it.

I will test it anw, you may have right!

EDIT: I just test it and working for me.
Reply
#7

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Are you sure? Because if you add only the SendDeathMessage the message will go to everyone, so check if is admin and then send it.

I will test it anw, you may have right!

EDIT: I just test it and working for me.
ofc, you were an admin, you died and you got death msg

With your code, when an ADMIN dies, a death message gets sent to EVERYONE.
Reply
#8

No, only one way:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(UserStats[i][Admin] > 0) SendDeathMessage..
    }
}
Reply
#9

Quote:
Originally Posted by Fergy
Посмотреть сообщение
No, only one way:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(UserStats[i][Admin] > 0) SendDeathMessage..
    }
}
SendDeathMessage sends a death message to everyone (it doesn't have a parameter which specifies to who it will be sent), that means your code would spam the death message depending on the amount of administrators online.

The only way to do what he is asking for is to do it with textdraws.
Reply
#10

Quote:
Originally Posted by Mean
Посмотреть сообщение
SendDeathMessage sends a death message to everyone (it doesn't have a parameter which specifies to who it will be sent), that means your code would spam the death message depending on the amount of administrators online.
Ou yeah, sorry...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)