I need help with OnPlayerDeath
#1

Hello everyone. I would be very happy if someone could help me.
I got this code, but it wont work.
Here it is:
Код:
new IsOnDm[MAX_PLAYERS];
new aWeaponNames[][32] =
{
	{"Unarmed (Fist)"}, {"Brass Knuckles"}, {"Golf Club"}, {"Night Stick"}, {"Knife"}, {"Baseball Bat"},
 	{"Shovel"}, {"Pool Cue"}, {"Katana"}, {"Chainsaw"}, {"Purple Dildo"}, {"Big White Vibrator"},
	{"Medium White Vibrator"}, {"Small White Vibrator"}, {"Flowers"}, {"Cane"}, {"Grenade"}, {"Teargas"},
	{"Molotov"}, {"Empty Slot 1"}, {"Empty Slot 2"}, {"Empty Slot 3"},	{"Colt 45"}, {"Colt 45 (Silenced)"},
	{"Desert Eagle"}, {"Normal Shotgun"}, {"Sawnoff Shotgun"}, {"Combat Shotgun"}, {"Micro Uzi (Mac 10)"},
	{"MP5"}, {"AK47"}, {"M4"}, {"Tec9"}, {"Country Rifle"}, {"Sniper Rifle"}, {"Rocket Launcher"},
	{"Heat-Seeking Rocket Launcher"}, {"Flamethrower"}, {"Minigun"}, {"Satchel Charge"}, {"Detonator"},
	{"Spray Can"}, {"Fire Extinguisher"}, {"Camera"}, {"Night Vision Goggles"}, {"Infrared Vision Goggles"},
	{"Parachute"}, {"Fake Pistol"}
};

public OnPlayerDeath(playerid, killerid, reason)
{
	if(IsOnDm[killerid] == 1 && IsOnDm[playerid] == 1)
	{
	    SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
	    new KillerName[MAX_PLAYER_NAME];
	    new DeadName[MAX_PLAYER_NAME];
	    new string[200];
	    GetPlayerName(killerid, KillerName, sizeof(KillerName));
	    GetPlayerName(playerid, DeadName, sizeof(DeadName));
	    format(string, sizeof(string), "[DM]: %s died by %s", DeadName, KillerName);
	    /*-> THIS ONE WONT WORK*/ /*format(string, sizeof(string), "[DM]: %s died by weapon %s, Killer %s", DeadName, aWeaponNames[reason], KillerName);*/
	    SendClientMessageToAll(LIGHTBLUE, string);
	    return 1;
	}
	new string[200], name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "* Note: %s died.", name);
	SendClientMessageToAll(LIGHTBLUE, string);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(!strcmp(cmdtext, "/dm", true))
       {
              IsOnDm[playerid] = 1;
              // etc here ...
             return 1;
       }
       return 0;
}

Please help anyone if you can!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)