Jump to content

Ped Help


jkub

Recommended Posts

I need a ped behind the ammunation counter so when someone shoots at him he can shoot back at the attacker just like in the normal game. I already created the ped and placed him behind the counter but the code does not work right for shooting the attacker. Please help?

function pedDefend ( attacker, weapon, bodypart )
local x, y, z = getElementPosition ( attacker )
setPedWeaponSlot ( source, 3 )
setPedAimTarget ( source, x, y, z )
setPedLookAt ( source, 0, 0, 0, 999999, attacker )
setTimer ( setPedControlState, 200, 0, source, "fire", true )
end
 
addEventHandler ( "onClientPedDamage", getRootElement(), pedDefend )

Link to comment

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...