ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getWeaponNameFromID

Function

getWeaponNameFromID

Server and clientWeaponsIdentical to MTA:SA

Returns the GTA San Andreas weapon name for an ID (0-46).

Syntax

string getWeaponNameFromID(int id)

Arguments

idint
Weapon ID.

Returns

Weapon name or false.

Example

addEventHandler("onPlayerWasted", root, function(ammo, killer, weapon)
    if killer then
        outputChatBox(getPlayerName(killer) .. " zabił " .. getPlayerName(source) .. " (" .. (getWeaponNameFromID(weapon) or "?") .. ")")
    end
end)