Jump to content

Recommended Posts

Posted

ola,

queria saber como posso verificar se um jogador tem uma arma certa ( no caso pistola)?

eu tentei algumas função diferentes mas nao consegui

local ammo = getPedAmmoInClip ( hitElement, 2 ) 
if (ammo > 0) then 
giveWeapon(hitElement, 22, 5, true) 

Posted
getPedWeapon(thePed, 2) 

Use getPedTotalAmmo com o slot da pistola se quiser verificar a munição da arma do ped.

Mas lembre-se que primeiro você deve verificar se o ped tem essa arma.

Posted
local arma = getPedWeapon (  thePed, 2 ) 
if arma then 
local ammo getPedTotalAmmo (  thePed, 2 ) 
if ammo then 

retorna o slot, mas o slot pode ser uma das 3 armas diferentes. como poderia saber se esse slot tem pistola?

Posted
local arma = getPedWeapon (  thePed, 2 ) 
if (arma == 22) then 
local ammo = getPedTotalAmmo (  thePed, 2 ) 
if (ammo >0) then 

então isto pode funcionar?

Posted

De nada.

Consulte bem o MTA Wiki sempre tiver alguma dúvida, principalmente, tente fazer o script por você mesmo (você pode estar sempre fazendo isso, mas procure evitar ao máximo abrir um tópico por pequenas dúvidas, abra um tópico quando realmente precisar).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...