Jump to content

Ped aim and shoot


Xeno

Recommended Posts

Posted

Hey dudes

I want to no how i make peds aim and shoot, i have tried and i fail :? , here is my ped script.

function pedLoad()
local ped2 = createPed (287, -1373, -206, 14, 1050, 1050, 0 ) 
giveWeapon( ped2, 31, 500, true )
setTimer( giveWeapon, 1000, 4, ped2, 31, 500, true)
 
 
local ped = createPed (287, -1374, -206, 14, 1050, 1050, 0 ) 
giveWeapon( ped, 31, 500, true )
setTimer( giveWeapon, 1000, 4, ped, 31, 500, true)
end
 
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )

Posted

one, two, three, four...

FOUR!

four posts down, you have IDENTICAL problem..

You should search before asking, that's one, or at least look through first page..

please..

and no, i won't paste link to that topic here.. just get back to the Scripting forum and select that topic.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

siiighh.. let me qoute myself .. :?

i think you should:

1 give weapon

2 get ped position

3 get "target" position,

4 do magic-math, and set rotation so ped will be facing at target

5 then set aim target

6 and make it shoot

you are creating peds and giving them weapons..

hurray, point "1" done..

now do the 2-6 ;)

i saw you scripted flying UFO, so i think you can script that too

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

1. i had help with that UFO and i had an example to help me

2. i dont want them to shoot a player just shoot forward

3. would i start with setPedControlState( ped, "fire", true )somthing like that?

Posted

yup, but you have to set a target anyway i think, so just select random point, or point in front of your ped..

at least try something :)

edit: btw: i always want to check out your ufo script, give me ip/hostname + post of your server :) i had the same idea much before you asked that btw, but didnt have time to make it :P

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Im not teh owner, but its EXF clan just search it, i dont no ip lol, ill be in there now.

And anyway im sure you could do a much better job than me, mine sucks.

Posted

ill check it out when i get back home.. if its working, its not that bad xD

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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