Jump to content

Ac130 camera bug PLS HELP!


Xwad

Recommended Posts

Posted

1 fast question. I edited the script becaouse i dont like the addcomandhandle so i changed to an event for OnVehicleEnter but it does not work:/ Becaouse i have a vehicle shop and there i can buy ac130 but i can only shoot when i create the ac130 with command:/

  
function createAc130(thePlayer, cmd) 
    local x,y,z = getElementPosition(thePlayer) 
    ac130 = createVehicle(592, x+10,y,z+2) 
    setElementData(ac130, "ac130", true) 
     
    gun = createObject(2985, 0, 0, 0) 
    attachElements(gun, ac130, -2, 0, 0, 0, 180, 0) 
    setElementData(ac130, "gun", gun) 
end 
addEventHandler("OnVehicleEnter", createAc130) 
  

Posted

try this one

function createAc130(thePlayer) 
    local model = getElementModel(source) 
        if model == 592 then -- Andromada    
        gun = createObject(2985, 0, 0, 0) 
        attachElements(gun, source, -2, 0, 0, 0, 180, 0) 
        setElementData(source, "ac130", true) 
        setElementData(source, "gun", gun) 
    end  
end 
addEventHandler("OnVehicleEnter", createAc130) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Use @Walid code but change

addEventHandler("OnVehicleEnter", createAc130) 

to this

addEventHandler("onVehicleEnter", root, createAc130) 

Posted

nooo xD its working but i dont want it like this becaouse its not creating the ac130 with usable guns when i buy it its just will create when i enter that plane:/ I mean when i enter an andromada then it will spawn the ac130.

Posted
how can can i make that if i enter the andromada then i can use the guns? And no commands?

I already gave you the code try it :

function createAc130(thePlayer) 
    local model = getElementModel(source) 
        if model == 592 then -- Andromada    
        gun = createObject(2985, 0, 0, 0) 
        attachElements(gun, source, -2, 0, 0, 0, 180, 0) 
        setElementData(source, "ac130", true) 
        setElementData(source, "gun", gun) 
    end 
end 
addEventHandler("OnVehicleEnter",root,createAc130) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
function createAc130(thePlayer) 
    local model = getElementModel(source) 
    if model == 592 then -- Andromada   
        gun = createObject(2985, 0, 0, 0) 
        attachElements(gun, source, -2, 0, 0, 0, 180, 0) 
        setElementData(source, "ac130", true) 
        setElementData(source, "gun", gun) 
    end 
end 
addEventHandler("onVehicleEnter",root,createAc130) 

Posted
it dosent work:/ I cant use the guns when i enter the plane:(

replace "OnVehicleEnter" with "onVehicleEnter".

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

server

--------------------------- 
--(c) by MazzMan/Maxim 
--------------------------- 
  
setFarClipDistance(2000) 
setCloudsEnabled(false) 
function createMissel(cx, cy, cz, x, y, z, time, ammoType) 
    if(ammoType)then 
        if(ammoType ~= "small")then 
            missel = createObject(1636, cx, cy, cz-0.2) 
            moveObject(missel, time, x, y, z) 
        end 
        if(time >= 50)then 
            triggerClientEvent("onClientCreateEffect", getRootElement(), cx, cy, cz, x, y, z, ammoType, time) 
            setTimer(function() 
                if(ammoType == "small")then 
                    createExplosion(x, y, z, 12, client) 
                elseif(ammoType == "middle")then 
                    createExplosion(x, y, z, 2, client) 
                else 
                    createExplosion(x, y, z, 10, client) 
                end 
                if(ammoType ~= "small")then 
                    destroyElement(missel) 
                end 
            end, time, 1) 
        else 
            if(ammoType ~= "small")then 
                destroyElement(missel) 
            end 
        end 
    else 
        return false 
    end 
end 
addEvent("onAc130Shoot", true) 
addEventHandler("onAc130Shoot", getRootElement(), createMissel) 
  
function createAc130(thePlayer, cmd) 
    local x,y,z = getElementPosition(thePlayer) 
    ac130 = createVehicle(592, x+10,y,z+2) 
    setElementData(ac130, "ac130", true) 
     
    gun = createObject(2985, 0, 0, 0) 
    attachElements(gun, ac130, -2, 0, 0, 0, 180, 0) 
    setElementData(ac130, "gun", gun) 
end 
addCommandHandler("ac130", createAc130) 
  
addEventHandler ( "onVehicleEnter", root, 
    function ( player, seat ) 
        if ( getElementModel ( source ) == 592 ) then 
            setElementData ( source, "ac130", true ) 
            gun = createObject ( 2985, 0, 0, 0 ) 
            attachElements ( gun, source, -2, 0, 0, 0, 180, 0 ) 
            setElementData ( source, "gun", gun ) 
            triggerServerEvent ( player, "fromserver:enter", source, player, seat ) 
        end 
    end 
) 
  
  
addEvent("getPlayerSeat", true) 
addEventHandler("getPlayerSeat", getRootElement(), function (thePlayer) 
    local seat = getPedOccupiedVehicleSeat(thePlayer) 
    setElementData(thePlayer, "seat", seat) 
end) 

client

http://pastebin.com/hLZKgUhg

Posted

its the same:/ Maybe the problem is becaouse when i buy the plane then the script warp me into the vehicle.

Posted
and is there any event for that? for warping in vehicle?:D

No ,maybe you can use setTimer to check if the player is inside a plane.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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