xeon17 Posted August 9, 2014 Share Posted August 9, 2014 Hello guys i have a question about automatic weapons , how i can create a weapon and the weapons should attact/fire on every player or vehicle that is visible to the weapon , or near the weapon.. I know to make a weapon but the stuff with attacting i don't can anyone give me a example how i can do it , or the sctipt allready exist in the community. Thanks. Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 Search in the community for aimbot and you get what you want. For vehicles you just can edit it then. (I guess you want this?) Link to comment
abod99119911 Posted August 9, 2014 Share Posted August 9, 2014 Search in the community for aimbot and you get what you want. For vehicles you just can edit it then. (I guess you want this?) i think he mean that gun (anti rush) Link to comment
xeon17 Posted August 9, 2014 Author Share Posted August 9, 2014 I mean to create a gun ( a m4 or sniper ) and the gun should fire on everything ( vehicles with players and on players ) and take their health , the gun should be only fire on elements that are visable or near the gun.. @ About Community I tried but there is nothing , pure nothing about ''aimbot'' Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 You could try to check how this guy did it: https://community.multitheftauto.com/ind ... ls&id=9568 (Looking, not stealing.) Link to comment
xeon17 Posted August 9, 2014 Author Share Posted August 9, 2014 Damn , sounds maybe funny but i still no understand ._. this give weapons to peds , i want to create a simple weapon on the ground , in the script isn't stuff like createWeapon , setWeaponTarget etc etc Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 But it has shooting automatically towards vehicles and players. (It just shoots to the player, but hits vehicles if they are in) (Atleast, as far as I saw on the picture). You can rebuild it to a weapon on the ground. Instead of a ped, the gun. Link to comment
xeon17 Posted August 9, 2014 Author Share Posted August 9, 2014 I don't see anything in the script how to give weapons to peds or to create weapons.. Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 createObject --(I think?) createElement --(Maybe this then?) giveWeapon Link to comment
xeon17 Posted August 9, 2014 Author Share Posted August 9, 2014 I trought i need to use this function https://wiki.multitheftauto.com/wiki/CreateWeapon Link to comment
Et-win Posted August 9, 2014 Share Posted August 9, 2014 That's funny. The first time when I'm only searching for that code in server-side it's a client-side only code. Yes, that is the code. x3 Link to comment
xeon17 Posted August 9, 2014 Author Share Posted August 9, 2014 i'll try it and post later did i created it , will the functions work for the thing i want to create? Link to comment
xeon17 Posted August 13, 2014 Author Share Posted August 13, 2014 I tried but ._. Nothing happen , no bugs in debug.. function weapons ( localPlayer) if not (isAllownedPlayer(thePlayer)) then return end local x,y,z = getElementPosition(thePlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) Link to comment
Et-win Posted August 13, 2014 Share Posted August 13, 2014 function weapons ( localPlayer) if not (isAllownedPlayer(thePlayer)) then return end Parameter wrong. Link to comment
xeon17 Posted August 13, 2014 Author Share Posted August 13, 2014 Fixed ( but still no work ) Code: function weapons ( localPlayer) if not (isAllownedPlayer(localPlayer)) then return end local x,y,z = getElementPosition(localPlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) Link to comment
Et-win Posted August 13, 2014 Share Posted August 13, 2014 function weapons ( thePlayer) if not (isAllownedPlayer(thePlayer)) then return end outputChatBox("Test1") local x,y,z = getElementPosition(thePlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) Guess it is server-sided. Does it output "Test1" ? Link to comment
xeon17 Posted August 13, 2014 Author Share Posted August 13, 2014 It output nothing , the functions are client side ( weapon functions ) Link to comment
Et-win Posted August 13, 2014 Share Posted August 13, 2014 function weapons ( ) if not (isAllownedPlayer(localPlayer)) then return end outputChatBox("Test1") local x,y,z = getElementPosition(localPlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) *Also wonders why the weapon functions are not linked + colored* Link to comment
Max+ Posted August 13, 2014 Share Posted August 13, 2014 Et-win setWeaponTarget need to write how to target at , also there is a problem with minigun fire rotation also why they aren't colored becuase they are new , addCommandHandler ('mini', function ( ) if not (isAllownedPlayer(localPlayer)) then return end local nx, ny, nz = getElementPosition ( localPlayer ) local minigunw = createWeapon ( 'minigun', nx, ny, nz +1 ) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) for _, nMax in ipairs ( getElementsByType ('player' )) do x, y, z = getElementPosition ( nMax ) setWeaponTarget ( minigunw ,nMax, 255 ) end end ) Link to comment
Et-win Posted August 13, 2014 Share Posted August 13, 2014 Et-win setWeaponTarget need to write how to target at I'm blind. Link to comment
xeon17 Posted August 13, 2014 Author Share Posted August 13, 2014 the problem was in utill function because dosen't work in client side your code is awesome Max+ , but can you make better weapon rotation ? please. Link to comment
Max+ Posted August 13, 2014 Share Posted August 13, 2014 the problem was in utill function because dosen't work in client sideyour code is awesome Max+ , but can you make better weapon rotation ? please. what's the problem with the rotation ? + see the example about it , CreateWeapon Link to comment
xeon17 Posted August 13, 2014 Author Share Posted August 13, 2014 Ah forget what i said , the problem was the weapons always killed me when i created ( fixed ) can you make the weapons aslo fire on vehicles please ? ._. Link to comment
Et-win Posted August 13, 2014 Share Posted August 13, 2014 getElementsByType("vehicle") Link to comment
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