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

Yo guys...
I was wondering...
Can any one tell me how to do like this:

Divine Shoots a Newbie with ak47 ...
Newbie gets a personal message that he was show with ak47...
Newbie shoos Divine with deagle ...
Divine gets a personal message that he was killed with deagle...
killer name is not needed :P
...
well you get the point ^^ ... cus i dont wanna use the deathlist witch is ... ehhh.... the "f9" button list ^^ :P
...
P.S. ..
What does SetPlayerBadWeapons, or something like that do ? and how to use it ?
....
THNX in advance
Reply
#2

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...
Reply
#3

What happens when the player commits suicide?
Reply
#4

Would this work?
pawn Код:
OnPlayerDeath(playerid, killerid, reason){
{
if (reason == minigun);
sendclientmessage(playerid, orange, "N00b pwned with minigun!");
}
{
if (reason == fist);
sendclientmessage(playerid, red, "OMF YOU NOOB");
You get what I mean ? ... but can any one help me with it ?
and what does Set Player Bad Weapons thingy do ? and how I use it ?
Reply
#5

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.
Reply
#6

ok thnx for help guys
I think I got it now
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)