SA-MP Forums Archive
SendDeathMessage to admins - 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: SendDeathMessage to admins (/showthread.php?tid=412895)



SendDeathMessage to admins - SKAzini - 03.02.2013

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..
    }
}



Re: SendDeathMessage to admins - Mean - 03.02.2013

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


AW: SendDeathMessage to admins - Nero_3D - 03.02.2013

Was mistaken, do as Mean told you


Re: SendDeathMessage to admins - ]Rafaellos[ - 03.02.2013

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


Re: SendDeathMessage to admins - Mean - 03.02.2013

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.


Re: SendDeathMessage to admins - ]Rafaellos[ - 03.02.2013

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.


Re: SendDeathMessage to admins - Mean - 03.02.2013

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.


Re: SendDeathMessage to admins - Fergy - 03.02.2013

No, only one way:

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



Re: SendDeathMessage to admins - Mean - 03.02.2013

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.


Re: SendDeathMessage to admins - Fergy - 03.02.2013

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...