that my last one used and not working too
function cmdArmedPed(player,_)
local x, y, z = getElementPosition(player) -- Get your position
local thePed = createPed(0, x + 1, y, z) -- Create a CJ ped nearby
setTimer ( function ( ped )
giveWeapon( ped, 31, 5000, true) -- Give him 5000 rounds of M4
setControlState( ped, "fire", true) -- Make him shoot continuously
end, 100, 1, thePed )
end
addCommandHandler("armedped", cmdArmedPed)