Jump to content

Question


xeon17

Recommended Posts

Damn

the weapon no fire anymore , nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

addCommandHandler ('mini', 
function ( ) 
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    
for _, nThat in ipairs ( getElementsByType ('vehicle' )) do     
x, y, z = getElementPosition ( nMax ) 
x, y, z = getElementPosition ( nThat ) 
setWeaponTarget ( minigunw ,nMax, 255 )  
setWeaponTarget ( minigunw ,nThat, 255 )  
      end 
   end 
end 
) 
  

Link to comment

Lol.

addCommandHandler ('mini', 
function ( ) 
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 
for _, nThat in ipairs ( getElementsByType ('vehicle' )) do     
x, y, z = getElementPosition ( nThat ) 
setWeaponTarget ( minigunw ,nThat, 255 ) 
   end 
end 
) 
  

Link to comment
I tried to do it like you before , but no work..

the weapon no fire ://// on players & vehicles

Try Change this ,

  
x, y, z = getElementPosition ( nMax ) 
x, y, z = getElementPosition ( nThat ) 

To ,

yz, yy, zz = getElementPosition ( nMax ) 
x, y, z = getElementPosition ( nThat ) 
Link to comment

Nope :/

addCommandHandler ('mini', 
function ( ) 
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   
yz, yy, zz = getElementPosition ( nMax ) 
setWeaponTarget ( minigunw ,nMax, 255 ) 
      end 
for _, nThat in ipairs ( getElementsByType ('vehicle' )) do     
x, y, z = getElementPosition ( nThat ) 
setWeaponTarget ( minigunw ,nThat, 255 ) 
   end 
end 
) 
  

Link to comment

Now it works ,

addCommandHandler ('mini', 
function ( ) 
    for _, nMax in ipairs ( getElementsByType ('player' )) do 
  for _, nThat in ipairs ( getElementsByType ('vehicle' )) do    
local nx, ny, nz = getElementPosition ( nMax ) 
local x, y, z = getElementPosition ( nThat )  
local minigunw = createWeapon ( 'minigun', nx, ny, nz +1 ) 
local minigunw = createWeapon ( 'minigun', x, y, z +1 ) 
setWeaponClipAmmo ( minigunw,99999) 
setWeaponState ( minigunw,"firing") 
setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) 
setWeaponTarget ( minigunw ,nMax, 255 ) 
setWeaponTarget ( minigunw ,nThat, 255 ) 
  end 
  end 
end 
) 
Link to comment

Bugged :/

Now the script create two mini guns , one do nothing the other one shot at vehicles.

and at every vehicle a minigun created , it should be when i write /mini , on my position a minigun get created and the minigun shot on vehicles with players in and players.

Link to comment
Bugged :/

Now the script create two mini guns , one do nothing the other one shot at vehicles.

and at every vehicle a minigun created , it should be when i write /mini , on my position a minigun get created and the minigun shot on vehicles with players in and players.

Yeah Now it shoots on vehicles and the other one not do anything because there is no players you have to be out of the vehicle

so it work

، i have an idea of making 1 mini gun shoot at 2 targts , but i am going out now when iam back , i will do it in other way .

Link to comment
Bugged :/

Now the script create two mini guns , one do nothing the other one shot at vehicles.

and at every vehicle a minigun created , it should be when i write /mini , on my position a minigun get created and the minigun shot on vehicles with players in and players.

، i have an idea of making 1 mini gun shoot at 2 targts , but i am going out now when iam back , i will do it in other way .

Would be awesome !

Link to comment

well , i tryed for 4 hours to fix this dam script but if i remove the loop and make triggerEvent it create 1 weapon but not firing and if i return the loop it create 1 weapon for every car in the server ... and keep firing

i tryed to make it 2 commands , but still the same dam issue

i guess maybe it's a bug or something ?

addCommandHandler ('mini1', 
function ( ) 
for _, nThat in ipairs ( getElementsByType ('vehicle' )) do   
local x, y, z = getElementPosition ( nThat ) 
local minigunw = createWeapon ( 'minigun', x, y, z +1 ) 
setWeaponClipAmmo ( minigunw,99999) 
setWeaponState ( minigunw,"firing") 
setWeaponTarget ( minigunw ,nThat, 255 ) 
setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) 
  end 
  end 
) 
  
addCommandHandler ('mini2', 
function ( ) 
    for _, nMax in ipairs ( getElementsByType ('player' )) do 
local nx, ny, nz = getElementPosition ( nMax ) 
local minigunw = createWeapon ( 'minigun', nx, ny, nz +1 ) 
setWeaponClipAmmo ( minigunw,99999) 
setWeaponState ( minigunw,"firing") 
setWeaponTarget ( minigunw ,nMax, 255 ) 
setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) 
    end 
  end 
) 
Link to comment

Now the minigun for players work , but the minigun for vehicles dosen't fire..

addCommandHandler ('mini1', 
function ( ) 
local xx , yy , zz = getElementPosition ( localPlayer ) 
local minigunw = createWeapon ( 'minigun', xx, yy, zz +1 ) 
setWeaponClipAmmo ( minigunw,99999) 
setWeaponState ( minigunw,"firing") 
setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) 
for _, nThat in ipairs ( getElementsByType ('vehicle' )) do   
local x, y, z = getElementPosition ( nThat ) 
setWeaponTarget ( minigunw ,nThat, 255 ) 
  end 
  end 
) 
  
addCommandHandler ('mini2', 
function ( ) 
local xx,yy,zz = getElementPosition ( localPlayer ) 
local minigunw = createWeapon ( 'minigun', xx, yy, zz +1 ) 
setWeaponClipAmmo ( minigunw,99999) 
setWeaponState ( minigunw,"firing") 
setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) 
  for _, nMax in ipairs ( getElementsByType ('player' )) do 
local nx, ny, nz = 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...