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



SendDeathMessage question - Flashy - 02.06.2010

Hello,

I was wondering way I get always one death icon in my deathlist? When I get burned and I day it shows my one icon. When I jump from a high building and die it shows me the same icon.

https://sampwiki.blast.hk/wiki/Weapons

How can I add this icons on SetDeathMessage?


Re: SendDeathMessage question - GangsTa_ - 02.06.2010

I think thats not a definition with SetDeathMessage.
Check wiki


Re: SendDeathMessage question - Flashy - 02.06.2010

I only want that it shows me when I killed a player with bat or knife that the icon with "bat" or "knife" appears.
Also when I jump and die it shows me a "jumping figur".

Help ;/


Re: SendDeathMessage question - woot - 02.06.2010

https://sampwiki.blast.hk/wiki/SendDeathMessage

The "reason" is the weapon ID in your case


Re: SendDeathMessage question - Flashy - 02.06.2010

I have done this before but I get one error. That was why I make this topic.
--> How to fix it?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{




    if(gPlayerUsingLoopingAnim[playerid])
    {
    gPlayerUsingLoopingAnim[playerid] = 0;
    TextDrawHideForPlayer(playerid,txtAnimHelper);
    }

    new pName[24], KillerFile[50], PlayerFile[50], kName[24];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(killerid, kName, sizeof(kName));
    format(KillerFile, sizeof(KillerFile), "/users/%s.ini", kName);
    format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
   
    if(killerid == INVALID_PLAYER_ID)
    {
    SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
    PlayerInfo[playerid][Deaths]++;
    dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
    }
    else
    {
      SendDeathMessage(killerid, playerid, reason);
        PlayerInfo[killerid][Kills]++;
        PlayerInfo[playerid][Deaths]++;
        dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(KillerFile, "Kills", PlayerInfo[killerid][Kills]);
    }
    else
    {
        SendDeathMessage(killerid, playerid, 0);
        PlayerInfo[killerid][Kills]++;
        PlayerInfo[playerid][Deaths]++;
        dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(KillerFile, "Kills", PlayerInfo[killerid][Kills]);
    }

    return 1;
}

ERROR: Adminscript.pwn(941) : error 029: invalid expression, assumed zero


The "else" is wrong

dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
dini_IntSet(KillerFile, "Kills", PlayerInfo[killerid][Kills]);
}
else
{
SendDeathMessage(killerid, playerid, 0);
PlayerInfo[killerid][Kills]++;


Re: SendDeathMessage question - IcyBlight - 02.06.2010

Death messages shows how you die.

If you want it show only when you've been killed by weapons, I think you can do something along the lines of if(reason == something) then show the message, if the reason is suicide, don't.


Re: SendDeathMessage question - MadeMan - 02.06.2010

You have same code 2 times, so remove one

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(gPlayerUsingLoopingAnim[playerid])
    {
        gPlayerUsingLoopingAnim[playerid] = 0;
        TextDrawHideForPlayer(playerid,txtAnimHelper);
    }

    new pName[24], KillerFile[50], PlayerFile[50], kName[24];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(killerid, kName, sizeof(kName));
    format(KillerFile, sizeof(KillerFile), "/users/%s.ini", kName);
    format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
   
    if(killerid == INVALID_PLAYER_ID)
    {
        SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
        PlayerInfo[playerid][Deaths]++;
        dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
    }
    else
    {
        SendDeathMessage(killerid, playerid, reason);
        PlayerInfo[killerid][Kills]++;
        PlayerInfo[playerid][Deaths]++;
        dini_IntSet(PlayerFile, "Deaths", PlayerInfo[playerid][Deaths]);
        dini_IntSet(KillerFile, "Kills", PlayerInfo[killerid][Kills]);
    }
    return 1;
}