Help .lua easy

Nehemisuz

Новичок
Автор темы
9
0
Версия SA-MP
  1. 0.3.7 (R1)
  2. Другая
What is the error?, I want the name on which the shot was received the damege.
local sampev = require 'lib.samp.events'


function sampev.onSendTakeDamage(playerID, damage, weaponID, bodypart)
if playerID ~= 65535 then
nickname = sampGetPlayerNickname(playerID).." [{FF0000}" .. playerID .. "{FF0000}]"
else
nickname = "Maikao"
end

sampAddChatMessage("{FFFFFF}Weapon:{FF0000} "..weapons[weaponID].."[{FF6666}"..weaponID .. "{FF0000}]" .. "{FFFFFF}, Player:{FF0000} " ..nickname .. "{FFFFF0}, Damge:{FF0000} " .. damage)

local message = string.format('{FFFFFF}in:{FF0000} %s ' , bodypart.. '{FFFFFF} '..bodypartID)
sampAddChatMessage(message, -1)
end



weapons = {
[0] = "Fist",
[1] = "Brass knuckles",
[2] = "Golf club",
[3] = "Nitestick",
[4] = "Knife",
[5] = "Baseball bat",
[6] = "Shovel",
[7] = "Pool cue",
[8] = "Katana",
[9] = "Chainsaw",
[10] = "Dildo",
[11] = "Dildo 2",
[12] = "Vibrator",
[13] = "Vibrator 2",
[14] = "Flowers",
[15] = "Cane",
[16] = "Granade",
[17] = "Teargas",
[18] = "Molotov",
[19] = "Vehicle M4",
[20] = "Vehicle minigun",
[21] = "Nehemisuz",
[22] = "Pistol",
[23] = "Silenced",
[24] = "Deagle",
[25] = "Shotgun",
[26] = "Sawn-off",
[27] = "Combat shotgun",
[28] = "Uzi",
[29] = "Mp5",
[30] = "AK-47",
[31] = "M4",
[32] = "Tec9",
[33] = "Cuntgun",
[34] = "Sniper rifle",
[35] = "RPG",
[36] = "Bazooka",
[37] = "Flamethrower",
[38] = "Minigun",
[39] = "C4",
[40] = "Detonator",
[41] = "Spray can",
[42] = "Fire extinguisher",
[43] = "Camera",
[44] = "Nigh vision",
[45] = "Thermal googles",
[46] = "Parachute",
[47] = "Fake pistol",
[49] = "Vehicle",
[51] = "Explosion",
[53] = "Drowned",
[54] = "Collision",
[200] = "Connect",
[201] = "Disconnect",
}