SA-MP Forums Archive
[PROBLEM] SendDeathMessage - 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: [PROBLEM] SendDeathMessage (/showthread.php?tid=420909)



[PROBLEM] SendDeathMessage - Loox - 07.03.2013

Well, first, when a player kills another player, the kill appears twice in the kill list, but I haven't got any SendDeathMessage in my gamemode.


Re: [PROBLEM] SendDeathMessage - Denying - 07.03.2013

Can I see the OnPlayerDeath CallBack?


Respuesta: [PROBLEM] SendDeathMessage - Loox - 07.03.2013

Код:
public OnPlayerDeath(playerid, killerid, reason)
    {
    SetPlayerColor(playerid, 0x00000059);
    
    new killer_msg[200];
    new Float:health, Float:armour;
    GetPlayerHealth(killerid,health);
    GetPlayerArmour(killerid,armour);
    
    if(gTeam[killerid] == 1)
    {
    format(killer_msg,200,"{0000FF}%s {FFFFFF}killed {DC143C}%s {FFFFFF}(HP: %d / %.1f ft / Weapon: %s)",GetName(killerid), GetName(playerid), floatround(health+armour),GetDistanceBetweenPlayers(killerid, playerid), GetWepName(reason));
    SendClientMessageToAll(-1, killer_msg);
    }
    else if(gTeam[killerid] == 2)
    {
    format(killer_msg,200,"{DC143C}%s {FFFFFF}killed {0000FF}%s {FFFFFF}(HP: %d / %.1f ft / Weapon: %s)",GetName(killerid), GetName(playerid), floatround(health+armour),GetDistanceBetweenPlayers(killerid, playerid), GetWepName(reason));
    SendClientMessageToAll(-1, killer_msg);
    }
    
    new playerid2;
    new string[100];
    new name[MAX_PLAYER_NAME];
    
    GivePlayerMoney(killerid, 1000);

	pInfo[playerid][pDeaths]++;
	pInfo[killerid][pKills]++;
	
	killsround[killerid]++;
	deathsround[playerid]++;

	if(IsBeingSpeced[playerid] == 1)
    {
        for(new i=0;i<MAX_PLAYERS;++i)
        {
            if(spectatorid[i] == playerid)
            {
                TogglePlayerSpectating(i,false);
            }
        }
    }
    if(gTeam[killerid] == TEAM1)
    {
        Team1Kills++;
	}
	else if(gTeam[killerid] == TEAM2)
	{
	    Team2Kills++;
	}
	return 1;
    }



Re: [PROBLEM] SendDeathMessage - Denying - 07.03.2013

It sends the message as SendDeathMessage? ( kill list )
If yes.. I have no idea what to do - sorry.


Re: [PROBLEM] SendDeathMessage - ReVo_ - 07.03.2013

filterscripts.


Respuesta: [PROBLEM] SendDeathMessage - Loox - 07.03.2013

Nope, I saw all the filterscripts, and nothing..


Re: [PROBLEM] SendDeathMessage - L.Hudson - 07.03.2013

Where do u put SendDeathMessage at the top of OnPlayerDeath or the bottom also have you tried killing someone without putting SendDeathMessage and still show the death list?


Respuesta: [PROBLEM] SendDeathMessage - Loox - 07.03.2013

I tried it, I deleted SendDeathMessage from the gamemode, and when I killed other player the kill appears 2 times..


Re: [PROBLEM] SendDeathMessage - L.Hudson - 07.03.2013

can you show us the WHOLE OnPlayerDeath? cause what you showed above doesnt appear that it's the whole one...


Respuesta: [PROBLEM] SendDeathMessage - Loox - 07.03.2013

This is all..

Код:
public OnPlayerDeath(playerid, killerid, reason)
    {
    SetPlayerColor(playerid, 0x00000059);
    
    new killer_msg[200];
    new Float:health, Float:armour;
    GetPlayerHealth(killerid,health);
    GetPlayerArmour(killerid,armour);
    
    if(gTeam[killerid] == 1)
    {
    format(killer_msg,200,"{0000FF}%s {FFFFFF}killed {DC143C}%s {FFFFFF}(HP: %d / %.1f ft / Weapon: %s)",GetName(killerid), GetName(playerid), floatround(health+armour),GetDistanceBetweenPlayers(killerid, playerid), GetWepName(reason));
    SendClientMessageToAll(-1, killer_msg);
    }
    else if(gTeam[killerid] == 2)
    {
    format(killer_msg,200,"{DC143C}%s {FFFFFF}killed {0000FF}%s {FFFFFF}(HP: %d / %.1f ft / Weapon: %s)",GetName(killerid), GetName(playerid), floatround(health+armour),GetDistanceBetweenPlayers(killerid, playerid), GetWepName(reason));
    SendClientMessageToAll(-1, killer_msg);
    }
    
    new playerid2;
    new string[100];
    new name[MAX_PLAYER_NAME];
    
    GivePlayerMoney(killerid, 1000);

	pInfo[playerid][pDeaths]++;
	pInfo[killerid][pKills]++;
	
	killsround[killerid]++;
	deathsround[playerid]++;

	if(IsBeingSpeced[playerid] == 1)
    {
        for(new i=0;i<MAX_PLAYERS;++i)
        {
            if(spectatorid[i] == playerid)
            {
                TogglePlayerSpectating(i,false);
            }
        }
    }
    if(gTeam[killerid] == TEAM1)
    {
        Team1Kills++;
	}
	else if(gTeam[killerid] == TEAM2)
	{
	    Team2Kills++;
	}
	return 1;
    }