SendDeathMessageToPlayer
#1

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'.
Reply
#2

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

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

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

Deleted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)