[HELP] Who Killed Who Filterscript? -
JackoXD - 23.07.2013
Hey guys, thanks for reading this
I am making a deathmatch server and I want it to display who killed who in the chat box (also to display with what weapon, if possible, if not, don't worry about it). Can someone please help me with this?
Thanks
PS If I'm not making much sense just let me know, thanks again!
Re: [HELP] Who Killed Who Filterscript? -
ShaneOvSina - 24.07.2013
Take a look at this?
https://sampforum.blast.hk/showthread.php?tid=365661
It may help.
Re: [HELP] Who Killed Who Filterscript? -
JackoXD - 24.07.2013
Thank you! Do you know if it tells you what weapon they killed you with? And if it shows suicides?
Re: [HELP] Who Killed Who Filterscript? -
Vanter - 24.07.2013
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new pname[24];
new killername[24];
new string[128];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(killerid,killername,sizeof(killername));
format(string,sizeof(string),"[KILL] %s(%d) killed %s(%d). [Weapon: %s]",killername,killerid,pname,playerid,reason);
SendClientMessageToAll(COLOR_RED,string);
return 1;
}
Here
EDITED: to show the weapon
Re: [HELP] Who Killed Who Filterscript? -
JackoXD - 24.07.2013
Thanks Vanter! I'm guessing I have to define the COLOUR_RED in the Gamemode?
Re: [HELP] Who Killed Who Filterscript? -
Vanter - 24.07.2013
pawn Код:
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA //{00FF00}
#define COLOR_RED 0xFF0000AA //{FF0000}
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA //{FFFFFF}
#define COLOR_VIOLETBLUE 0x8A2BE2AA
#define COLOR_DEADCONNECT 0x808080AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_FORESTGREEN 0x228B22AA
#define COLOR_DODGERBLUE 0x1E90FFAA
#define COLOR_DARKOLIVEGREEN 0x556B2FAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_ROYALBLUE 0x4169FFAA
#define COLOR_ERROR 0xD2691EAA
#define COLOR_PINK 0xFF0080FF
#define COLOR_SEXYGREEN 0x00FF00FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIME 0x10F441AA
#define COLOR_CYAN 0x40FFFFFF
#define COLOR_ORANGERED 0xFF4500AA
Re: [HELP] Who Killed Who Filterscript? -
JackoXD - 24.07.2013
Thanks a lot! Tested and it works!
Re: [HELP] Who Killed Who Filterscript? -
JackoXD - 24.07.2013
Ok, so it all works nice, (Vanter) but the weapon isn't working? I killed my friend with a sniper and it said [WEAPON: "] and grenades and M4's don't show up correctly? No weapon is showing up, please help
Re: [HELP] Who Killed Who Filterscript? -
Vanter - 24.07.2013
try this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new pname[24];
new killername[24];
new msg[128];
new reasonMsg[32];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(killerid,killername,sizeof(killername));
if (killerid != INVALID_PLAYER_ID)
{
switch (reason)
{
case 0: reasonMsg = "Unarmed";
case 1: reasonMsg = "Brass Knuckles";
case 2: reasonMsg = "Golf Club";
case 3: reasonMsg = "Night Stick";
case 4: reasonMsg = "Knife";
case 5: reasonMsg = "Baseball Bat";
case 6: reasonMsg = "Shovel";
case 7: reasonMsg = "Pool Cue";
case 8: reasonMsg = "Katana";
case 9: reasonMsg = "Chainsaw";
case 10: reasonMsg = "Dildo";
case 11: reasonMsg = "Dildo";
case 12: reasonMsg = "Vibrator";
case 13: reasonMsg = "Vibrator";
case 14: reasonMsg = "Flowers";
case 15: reasonMsg = "Cane";
case 22: reasonMsg = "Pistol";
case 23: reasonMsg = "Silenced Pistol";
case 24: reasonMsg = "Desert Eagle";
case 25: reasonMsg = "Shotgun";
case 26: reasonMsg = "Sawn-off Shotgun";
case 27: reasonMsg = "Combat Shotgun";
case 28: reasonMsg = "MAC-10";
case 29: reasonMsg = "MP5";
case 30: reasonMsg = "AK-47";
case 31: reasonMsg = "M4";
case 32: reasonMsg = "TEC-9";
case 33: reasonMsg = "Country Rifle";
case 34: reasonMsg = "Sniper Rifle";
case 37: reasonMsg = "Fire";
case 38: reasonMsg = "Minigun";
case 41: reasonMsg = "Spray Can";
case 42: reasonMsg = "Fire Extinguisher";
case 49: reasonMsg = "Vehicle Collision";
case 50: reasonMsg = "Vehicle Collision";
case 51: reasonMsg = "Explosion";
default: reasonMsg = "Unknown";
}
format(string,sizeof(string),"[KILL] %s(%d) killed %s(%d). [Weapon: %s]",killername,killerid,pname,playerid,reasonMsg);
}
else
{
switch (reason)
{
case 53: format(msg, sizeof(msg), "04*** %s died. (Drowned)", pname);
case 54: format(msg, sizeof(msg), "04*** %s died. (Collision)", pname);
default: format(msg, sizeof(msg), "04*** %s died.", pname);
}
}
SendClientMessageToAll(COLOR_RED,string);
return 1;
}
EDITED: try now
Re: [HELP] Who Killed Who Filterscript? -
JackoXD - 24.07.2013
Thank you so much! Will try now!