Jump to content

Question


xeon17

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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)  

Posted

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) 

Posted
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" ?

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

Posted

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

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.

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

what's the problem with the rotation ?

+

see the example about it ,

CreateWeapon

Posted

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

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