RO/getPedAmmoInClip
		
		
		
		
		
		Jump to navigation
		Jump to search
		
		
	
Această funcție returnează un număr care conține muniția dintr-o armă specificată a lui ped. Vedeți Informații despre arme
Syntax
int getPedAmmoInClip ( ped thePed [, int weaponSlot = current ] )
OOP Syntax Help! I don't understand this!
- Method: ped:getAmmoInClip(...)
 - Variable: .ammoInClip
 
Argumente Necesare
- thePed: ped a cărui muniție doriți să verificați.
 
Argumente Opționale
- weaponSlot: Un număr reprezentând slotul pentru armă (setat la slotul selectat curent al ped-ului dacă nu este specificat).
 
Returnează
Returnează un int care conține cantitatea de muniție din clipul selectat sau specificat al dispozitivului specificat sau 0 dacă dispozitivul specificat este nevalid.
Exemplu
Acest exemplu arată cantitatea de muniție pe care jucătorul specificat o are în slotul său actual. De exemplu: „muniție cineva”.
function showAmmo(thePlayer, command, who ) local targetPlayer = getPlayerFromName ( who ) if ( thePlayer ) then local ammo = getPedAmmoInClip ( targetPlayer ) outputChatBox ( who .. " has " .. ammo .. " ammo in his active clip" ) else outputChatBox ( "Player '" .. who .. "' not found." ) end end addCommandHandler( "ammo", showAmmo )
Probleme
| Issue ID | Description | 
|---|---|
| #734 | Sometimes wrong count of player ammo, if get it in onPlayerWeaponFire | 
Tradus
de către Hydra (Gabriel45#6859 - Discord)
Vezi și
- canPedBeKnockedOffBike
 - getPedAnalogControlState
 - getPedAnimation
 - getPedBonePosition
 - getPedCameraRotation
 - getPedControlState
 - getPedMoveState
 - getPedOxygenLevel
 - getPedSimplestTask
 - getPedTargetCollision
 - getPedTargetEnd
 - getPedTargetStart
 - getPedTask
 - getPedVoice
 - getPedWeaponMuzzlePosition
 - givePedWeapon
 - isPedBleeding
 - isPedDoingTask
 - isPedTargetingMarkerEnabled
 - setAnalogControlState
 - setPedAimTarget
 - setPedAnalogControlState
 - setPedBleeding
 - setPedCameraRotation
 - setPedCanBeKnockedOffBike
 - setPedControlState
 - setPedEnterVehicle
 - setPedExitVehicle
 - IsPedFootBloodEnabled
 - setPedFootBloodEnabled
 - setPedLookAt
 - setPedOxygenLevel
 - setPedTargetingMarkerEnabled
 - setPedVoice
 - Shared
 - addPedClothes
 - getPedClothes
 - removePedClothes
 - createPed
 - getPedAmmoInClip
 - getPedArmor
 - getPedFightingStyle
 - getPedOccupiedVehicle
 - getPedOccupiedVehicleSeat
 - getPedStat
 - getPedTarget
 - getPedTotalAmmo
 - getPedWalkingStyle
 - getPedWeapon
 - getPedWeaponSlot
 - getPedContactElement
 - getValidPedModels
 - isPedChoking
 - isPedDead
 - isPedDoingGangDriveby
 - isPedDucked
 - isPedHeadless
 - isPedInVehicle
 - isPedOnGround
 - isPedReloadingWeapon
 - isPedWearingJetpack
 - killPed
 - removePedFromVehicle
 - setPedAnimation
 - setPedAnimationProgress
 - setPedAnimationSpeed
 - setPedArmor
 - setPedDoingGangDriveby
 - setPedFightingStyle
 - setPedHeadless
 - setPedStat
 - setPedWalkingStyle
 - setPedWeaponSlot
 - warpPedIntoVehicle