getPedWeapon | Multi Theft Auto: Wiki Skip to content

getPedWeapon

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function tells you which weapon type is in a certain weapon slot of a ped.

Syntax

getPedWeapon ( )

Code Examples

server
-- Find a player called someguy and find his current weapon id.
local weaponType = getPedWeapon ( getRandomPlayer() )
-- If a weapon type was returned then
if ( weaponType ) then
outputChatBox ( "someguy's current Weapon-type: " .. weaponType .. "." ) -- Display the weapon type in the chat box
end

See Also