Xeno Posted April 9, 2010 Posted April 9, 2010 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 )
dzek (varez) Posted April 9, 2010 Posted April 9, 2010 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.
dzek (varez) Posted April 9, 2010 Posted April 9, 2010 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
Xeno Posted April 9, 2010 Author Posted April 9, 2010 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?
dzek (varez) Posted April 9, 2010 Posted April 9, 2010 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
Xeno Posted April 9, 2010 Author Posted April 9, 2010 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.
dzek (varez) Posted April 9, 2010 Posted April 9, 2010 ill check it out when i get back home.. if its working, its not that bad
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now