Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Pun1sh3r on Jun 12, 2022, 02:56 PM

Title: Deathlist with Icons (Just like SA:MP but with cool VC:MP Icons) [UPDATED]
Post by: Pun1sh3r on Jun 12, 2022, 02:56 PM
Hello everyone,

today I present you after long time my updated Version of my old Deathlist working with Textdraws and Sprites in the past.

How does the Deathlist looks?
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fustunting.com%2Fvcmp%2FDeathlist.png&hash=a42229066256dc790e74e1f609eccce45a08778a)
Names are always showed in the Deathlist with the Players Color

You can remove the connect & disconnect Messages in Chat and add it to the Deathlist!
How?

Add this to your onScriptLoad() callback:
SetJoinMessages(false); //This function will toggle the join messages on or off.
Add this to your onPlayerJoin(player) callback:
SendDeathMessageToAll(71, player.Name, player.Colour);

Add this to your onPlayerPart(player, reason) callback:
SendDeathMessageToAll(72, player.Name, player.Colour);

Now you can add Kill Messages to the Deathlist and disable it in Chat!
How to disable the Kill Messages in Chat?

Add this to your onScriptLoad() callback:
SetDeathMessages(false); //This function will toggle death messages on or off.
Add this to your onPlayerDeath(player, reason)  callback:
SendDeathMessageToAll(reason, player.Name, player.Colour);

Add this to your onPlayerKill(killer, player, reason, bodypart) callback:
SendDeathMessageToAll(reason, killer.Name, killer.Colour, player.Name, player.Colour);

DeathWindow function:
function SendDeathMessageToPlayer(player, reason, leftName, rgb, rightName = null, rgb2 = null)
{
    if (rightName)
{
SendDataToClient(player, 0x01, reason, leftName, rgb.r, rgb.g, rgb.b, rightName, rgb2.r, rgb2.g, rgb2.b);
}
    else
{
SendDataToClient(player, 0x01, reason, leftName, rgb.r, rgb.g, rgb.b);
}
return 1;
}

function SendDeathMessageToAll(reason, leftName, rgb, rightName = null, rgb2 = null)
{
    for (local plr, i = 0; i < GetMaxPlayers(); i++)
{
        plr = FindPlayer(i);
        if (plr)
{
if (rightName)
{
SendDataToClient(plr, 0x01, reason, leftName, rgb.r, rgb.g, rgb.b, rightName, rgb2.r, rgb2.g, rgb2.b);
}
else
{
SendDataToClient(plr, 0x01, reason, leftName, rgb.r, rgb.g, rgb.b);
}
}
}
return 1;
}

ClientSide Script is added in the Packages.
Download (http://ustunting.com/vcmp/Deathlist.rar) the full Package with Images, Server Side & Client Side Script

Feel free to download it now.

Please do not add any other Download links, this will be always Online I added as it is hosted on my Webserver.


Title: Re: Deathlist with Icons (Just like SA:MP but with cool VC:MP Icons) [UPDATED]
Post by: Gito Baloch on Jul 05, 2022, 03:48 PM
Wow man amazing! I was waiting for this desperately, Thanks alot.