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



SendDeathMessageToPlayer - jackx3rx - 29.07.2014

I recently found out about the function "SendDeathMessageToPlayer" which sends a death message to an individual player. I decided to make a loop and send the entire kill feed to online admins so they can easily moderate DM etc.

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new string[128];
	if(killerid == INVALID_PLAYER_ID) return SpawnPlayer(playerid) && SendClientMessage(playerid,-1,"{AA3333}SERVER:{FFFFFF} Your killer has disconnected from the server, take a screenshot of this message if you wish to make a complaint.");
	{
		format(string,128,"{AA3333}SERVER:{FFFFFF} You were killed by %s, take a screenshot of this message if you wish to make a complaint.",RemoveUnderScore(killerid));
		SendClientMessage(playerid,-1,string);
		SpawnPlayer(playerid);
        for(new i = 0; i < MAX_PLAYERS; i++)
	    {
	        if(IsPlayerConnected(i))
	        {
	            if(PlayerInfo[i][pAdmin] > 1)
	            {
					SendDeathMessageToPlayer(i,killerid,playerid,reason);
				}
			}
		}
	}
	return 1;
}
I had the following error upon compiling my gamemode:

Код:
C:\Users\Jack\Documents\SAMP Vinewood RP\Vinewood Roleplay\gamemodes\vrp.pwn(223) : error 017: undefined symbol "SendDeathMessageToPlayer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 223 is the line which has 'SendDeathMessageToPlayer'.


Re: SendDeathMessageToPlayer - jackx3rx - 29.07.2014

The indent is perfect on my game mode, but when I copied and pasted the code it fucked up, no idea why.


Re: SendDeathMessageToPlayer - Konstantinos - 29.07.2014

It was added in SA-MP 0.3z R2-2. Any older version of a_samp.inc will give the error.


Re: SendDeathMessageToPlayer - jackx3rx - 29.07.2014

I just replaced my a_samp.Inc with the R2-2 one, same error occurs.


Re: SendDeathMessageToPlayer - Moudix - 31.07.2014

Deleted.