Jump to content

Question


xeon17

Recommended Posts

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

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

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

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

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

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

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