getValidPedModels
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function returns all valid ped models. The syntax is different for server and client sides.
Syntax
table getValidPedModels ( [ bool includeCustom = true ] )Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- includeCustom (default: true): MISSING_PARAM_DESC
Returns
- table: value
Returns a table with all valid ped models that exist on the client, containing the custom model IDs unless includeCustom is false.
Code Examples
server
This example will check if the specified skin ID is a valid skin via a command.
function isValidSkin( thePlayer, command, specifiedSkin ) specifiedSkin = tonumber ( specifiedSkin ) if ( specifiedSkin ) then -- If skin specified local allSkins = getValidPedModels ( ) -- Get valid skin IDs local result = false -- Define result, it is currently false for _, skin in ipairs( allSkins ) do -- Check all skins if skin == specifiedSkin then -- If skin equals specified one, it is valid result = true -- So set it as result break -- stop looping through a table after we found the skin end end if ( result ) then -- If we got results outputChatBox( specifiedSkin .. " is a valid skin ID.", thePlayer, 0, 255, 0 ) -- It is valid, output it else -- If we didn't get results outputChatBox( specifiedSkin .. " is not a valid skin ID.", thePlayer, 0, 255, 0 ) -- No result, it is not valid end else outputChatBox( "Please specify a valid number to check!", thePlayer, 255, 0, 0 ) endendaddCommandHandler("checkskin",isValidSkin) -- bind 'checkskin' command to 'isValidSkin' functionSee Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle