Screenshot:
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi58.tinypic.com%2F2r6mr6s.jpg&hash=ecb7affa37a06ed7e643cfd4ed3545cda2f21b20)
MaxLines <- 8;
LineGap <- 15;
PosX <- -400;
PosY <- 380;
function onServerStart()
{
TextInfo <- array( MaxLines );
}
function onPlayerDeath(player, reason)
{
local Text="";
if (reason==70)
{
Text="*> "+player.Name+" committed suicide. <*";
}
else if (reason==39)
{
Text="*> "+player.Name+" died in a car crash. <*";
}
else if (reason==31)
{
Text="*> "+player.Name+" burned to death. <*";
}
else if (reason==14)
{
Text="*> "+player.Name+" choked to death. <*";
}
else if (reason==43)
{
Text="*> "+player.Name+" drowned. <*";
}
else if (reason==41 || reason==51)
{
Text="*> "+player.Name+" exploded. <*";
}
else if (reason==44)
{
Text="*> "+player.Name+" fell to death. <*";
}
else
{
Text="*> "+player.Name+" died for some reason. <*";
}
RightMessage(Text);
}
function onPlayerKill(player, killer, reason, bodypart)
{
RightMessage(DeathText(player, killer, reason, bodypart));
}
function onPlayerTeamKill(player, killer, reason, bodypart)
{
RightMessage(DeathText(player, killer, reason, bodypart));
}
function DeathText(player, killer, reason, bodypart)
{
local Text="";
if (reason == 14 || reason == 31 || reason == 39 || reason == 40 || reason == 41 || reason == 44 || reason == 51)
{
Text="*> "+killer.Name+" killed "+player.Name+" with "+GetWeaponName(reason)+". <*";
}
else
{
Text="*> "+killer.Name+" killed "+player.Name+" with "+GetWeaponName(reason)+" "+BodyPartText(bodypart)+". <*";
}
}
function RightMessage(Text)
{
if (TextInfo[0])
{
TextInfo[0].Delete();
}
for (local i=0; i<MaxLines-1; i++)
{
if (TextInfo[i+1])
{
TextInfo[i] = TextInfo[i+1];
TextInfo[i].SetPosForAll(PosX, PosY+(i)*LineGap);
}
}
TextInfo[MaxLines-1] = CreateTextdraw(Text, PosX, PosY+(MaxLines-1)*LineGap, 0xFFB0B0B0);
TextInfo[MaxLines-1].ShowForAll();
}
function BodyPartText(bodypart)
{
switch( bodypart )
{
case 0:return "to body";
case 1:return "to torso";
case 2:return "to left arm";
case 3:return "to right arm";
case 4:return "to left leg";
case 5:return "to right leg";
case 6:return "to head";
case 7:return "hitting his car";
default:return "unknown";
}
}
Set DeathMessages to false in server.conf.
And you can use "RightMessage" function to show any text you want.
Will death messages remove ever ? Can't see that.
Quote from: sseebbyy on Oct 19, 2014, 10:11 AMWill death messages remove ever ? Can't see that.
It won't remove.
shows me Error TextInfo doesnt exists idk what is the problem
Quote from: RATHORE on Nov 20, 2014, 07:16 AMshows me Error TextInfo doesnt exists idk what is the problem
Show the full error report.
If you are going to use this script, do not forget to add a script that will remove the too old death messsages. ;)
It gives me this error
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ftiny-img.com%2Fimage.php%3Fdi%3D0OTU&hash=dfcacb3862fd9ce01048d98a3a4a37127ad50a31)
Did you forgot to add this piece of code?
function onServerStart()
{
TextInfo <- array( MaxLines );
}
I have added but still showing this error
Quote from: RATHORE on Nov 21, 2014, 10:28 AMI have added but still showing this error
It isn't any wrong for me... :(
Problem solved :)
I am getting error
http://s24.postimg.org/5u3dzgf85/Capture.png
First of all a f*ing bump of 2014 topic, and secondly, if you look into that image you see:
Player 'imran' ID 0 connected
on console so what does that mean? Let me tell you, you are imran and you just wanted to screw up the forum once again by bumping a topic and posting a error which was generated by you not by the snippet.
If you can't read.
Why DAFUQ are you trying to script? :-\
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fs1.postimg.org%2F70js6emv3%2FCapture.png&hash=73c4b6d18d1d2f39a41a406818624b052f52729e)
TextInfo[MaxLines-1] = CreateTextdraw(Text, PosX, PosY+(MaxLines-1)*LineGap, 0xFFB0B0B0);
this is line 78 tell me what is error??
How are we supposed to know an error which occurs on your computer? Learn some debugging skills do some experiments and come up with your findings and we'll be glad to help from our side.
Quote from: abbasi on Jun 28, 2015, 05:55 PM TextInfo[MaxLines-1] = CreateTextdraw(Text, PosX, PosY+(MaxLines-1)*LineGap, 0xFFB0B0B0);
this is line 78 tell me what is error??
As you can see from the Locals dump, Text is NULL. There's your error, now go find the solution yourself.
:/