Kill reason to player something.... ?
#7

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by OmeRinG
pawn Код:
//This goes in the bottom of the script
stock GetWeaponNameFromReason(reason) {
    new weapons[][] = {
        "Unarmed", "Brass Knuckles", "Golf Club","Nite Stick", "Knife", "Baseball Bat", "Shovel",
        "Pool Cue", "Katana", "Chainsaw", "Purple Dildo", "Small White Vibrator", "Large White Vibrator", "Silver Vibrator",
        "Flowers", "Cane", "Grenade", "Tear Gas", "Molotov Cocktail", "Vehicle Missile", "Hydra Flare", "Jetpack", "9mm",
        "Silenced 9mm", "Desert Eagle", "Shotgun", "Sawnoff Shotgun", "Combat Shotgun", "Micro SMG (Uzi)", "SMG (MP5)", "AK47", "M4",
        "Tec9", "Country Rifle", "Sniper Rifle", "Rocket Launcher", "Heatseeker rocket launcher", "Flamethrower", "Minigun", "Satchel Charge",
        "Detonator", "Spraycan", "Fire Extinguisher", "Camera", "Nightvision Goggles", "Infrared Vision", "Parachute", "Fake Pistol",
        "Vehicle", "Helicopter Blades", "Explosion", "Drowned", "Collision" };
    new wn[50];
    format(wn,sizeof(wn),"%s",weapons[reason]);
    return wn;
}
//This goes in OnPlayerDeath:
public OnPlayerDeath(playerid, killerid, reason)
{
    new string[100];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(killerid,name,sizeof(name));
    format(string,sizeof(string),"%s (ID: %d) has killed you with a %s.", name, killerid, GetWeaponNameFromReason(reason));
    SendClientMessage(playerid,0xff000000,string);
    return 1;
}
OK it's tested and it works great... say a big thanks for that because it wasn't premade I made it for you...
So wasted..
pawn Код:
//In OnPlayerDeath callback.
new string[32];
GetWeaponName(reason,string,sizeof(string));
format(string,sizeof(string),"%d was killed by %d (weapon: %s)",playerid,killerid,string);
//Then send it to who ever you want..
SendClientMessageToAll(color,string); //for example.
OUCH :S
didn't know it existed...
Reply


Messages In This Thread
Kill reason to player something.... ? - by Divine - 18.05.2009, 20:07
Re: Kill reason to player something.... ? - by OmeRinG - 18.05.2009, 20:28
Re: Kill reason to player something.... ? - by Weirdosport - 18.05.2009, 21:30
Re: Kill reason to player something.... ? - by Divine - 19.05.2009, 12:51
Re: Kill reason to player something.... ? - by MenaceX^ - 19.05.2009, 13:02
Re: Kill reason to player something.... ? - by Divine - 19.05.2009, 14:20
Re: Kill reason to player something.... ? - by OmeRinG - 19.05.2009, 14:46

Forum Jump:


Users browsing this thread: 1 Guest(s)