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.

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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)  

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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) 

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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 
) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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.

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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

A unique GangWar gamemode waiting for you!
Click here for more information.

560x95_FFFFFF_FF9900_000000_000000.png

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