Jump to content

pleas help me


Recommended Posts

pleas help

warning: medic1\client.lua:33: bad argument @ 'addEventHandler' [expected element at argument 2 got nil mta]

GUIEditor = {
button = {}
} 
local spaaa
addEventHandler("onClientResourceStart", resourceRoot,
function()
    spaaa = guiCreateButton(494, 849, 309, 73, "spawn", false) 
    guiSetVisible ( spaaa,false)	
end
)


function ahmed()
    guiSetVisible (spaaa,true)
    showCursor(true)	
end
addCommandHandler("aa",ahmed)
--addEventHandler("onClientPlayerWasted",root,ahmed)
-- onClientPlayerWasted soon


function spaw(button)
--local x, y , z = getElementPosition (theplayer)
    if button == "left" then
        setElementHealth(localPlayer,100)
        local a,z,y = 1182.58582, -1323.69434, 13.57902
        setElementPosition (localPlayer,1182.58582, -1323.69434, 13.57902)
        guiSetVisible ( spaaa,false)
        showCursor(false)
    end
end
--addCommandHandler("bb",spaw)
addEventHandler( "onClientGUIClick", spaaa, spaw, false )

--1182.58582, -1323.69434, 13.57902










function createMinigunWeapon()
    -- Create the weapon 1 meter above the player
    local x, y, z = getElementPosition(localPlayer)
    local weapon = createWeapon("minigun", x + 1, y, z)
    -- Give it some ammo and fire it
    setWeaponClipAmmo(weapon, 99999)
    setWeaponState(weapon, "firing")

    -- Optionally adjust for model rotation (this value will be different for other weapons)
    setWeaponProperty(weapon, "fire_rotation", 0, -30, 0)
end
addCommandHandler("createminigun", createMinigunWeapon)













--[[GUIEditor = { 
    button = {}, 
    window = {} 
} 
GUIEditor.window[1] = guiCreateWindow(174, 135, 490, 299, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
    guiSetVisible(GUIEditor.window[1], true) 
    showCursor (true)
GUIEditor.button[1] = guiCreateButton(449, 29, 27, 35, "X", false, GUIEditor.window[1]) 
  
function hidegui()
    guiSetVisible(GUIEditor.window[1], false) 
    showCursor ( false ) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hidegui, false ) ]]

 

Link to comment
GUIEditor = {
button = {}
} 
local spaaa
addEventHandler("onClientResourceStart", resourceRoot,
function()
    spaaa = guiCreateButton(494, 849, 309, 73, "spawn", false)
    addEventHandler("onClientGUIClick", spaaa, spaw, false) 
    guiSetVisible ( spaaa,false)
end
)


function ahmed()
    guiSetVisible (spaaa,true)
    showCursor(true)
end
addCommandHandler("aa",ahmed)
--addEventHandler("onClientPlayerWasted",root,ahmed)
-- onClientPlayerWasted soon


function spaw(button)
--local x, y , z = getElementPosition (theplayer)
    if button == "left" then
        setElementHealth(localPlayer,100)
        local a,z,y = 1182.58582, -1323.69434, 13.57902
        setElementPosition (localPlayer,1182.58582, -1323.69434, 13.57902)
        guiSetVisible ( spaaa,false)
        showCursor(false)
    end
end
--addCommandHandler("bb",spaw)


--1182.58582, -1323.69434, 13.57902










function createMinigunWeapon()
    -- Create the weapon 1 meter above the player
    local x, y, z = getElementPosition(localPlayer)
    local weapon = createWeapon("minigun", x + 1, y, z)
    -- Give it some ammo and fire it
    setWeaponClipAmmo(weapon, 99999)
    setWeaponState(weapon, "firing")

    -- Optionally adjust for model rotation (this value will be different for other weapons)
    setWeaponProperty(weapon, "fire_rotation", 0, -30, 0)
end
addCommandHandler("createminigun", createMinigunWeapon)













--[[GUIEditor = { 
    button = {}, 
    window = {} 
} 
GUIEditor.window[1] = guiCreateWindow(174, 135, 490, 299, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
    guiSetVisible(GUIEditor.window[1], true) 
    showCursor (true)
GUIEditor.button[1] = guiCreateButton(449, 29, 27, 35, "X", false, GUIEditor.window[1]) 

function hidegui()
    guiSetVisible(GUIEditor.window[1], false) 
    showCursor ( false ) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hidegui, false ) ]]

 

Link to comment
6 hours ago, Shady1 said:
GUIEditor = {
button = {}
} 
local spaaa
addEventHandler("onClientResourceStart", resourceRoot,
function()
    spaaa = guiCreateButton(494, 849, 309, 73, "spawn", false)
    addEventHandler("onClientGUIClick", spaaa, spaw, false) 
    guiSetVisible ( spaaa,false)
end
)


function ahmed()
    guiSetVisible (spaaa,true)
    showCursor(true)
end
addCommandHandler("aa",ahmed)
--addEventHandler("onClientPlayerWasted",root,ahmed)
-- onClientPlayerWasted soon


function spaw(button)
--local x, y , z = getElementPosition (theplayer)
    if button == "left" then
        setElementHealth(localPlayer,100)
        local a,z,y = 1182.58582, -1323.69434, 13.57902
        setElementPosition (localPlayer,1182.58582, -1323.69434, 13.57902)
        guiSetVisible ( spaaa,false)
        showCursor(false)
    end
end
--addCommandHandler("bb",spaw)


--1182.58582, -1323.69434, 13.57902










function createMinigunWeapon()
    -- Create the weapon 1 meter above the player
    local x, y, z = getElementPosition(localPlayer)
    local weapon = createWeapon("minigun", x + 1, y, z)
    -- Give it some ammo and fire it
    setWeaponClipAmmo(weapon, 99999)
    setWeaponState(weapon, "firing")

    -- Optionally adjust for model rotation (this value will be different for other weapons)
    setWeaponProperty(weapon, "fire_rotation", 0, -30, 0)
end
addCommandHandler("createminigun", createMinigunWeapon)













--[[GUIEditor = { 
    button = {}, 
    window = {} 
} 
GUIEditor.window[1] = guiCreateWindow(174, 135, 490, 299, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
    guiSetVisible(GUIEditor.window[1], true) 
    showCursor (true)
GUIEditor.button[1] = guiCreateButton(449, 29, 27, 35, "X", false, GUIEditor.window[1]) 

function hidegui()
    guiSetVisible(GUIEditor.window[1], false) 
    showCursor ( false ) 
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hidegui, false ) ]]

why i want when i press spaaa button work the function 

 

Link to comment

Yo también necesito ayuda a poner este script para que me funcione con acl 

Lado del cliente

function stopDamage ()
        cancelEvent()
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopDamage )
addEventHandler ( "onClientPlayerStealthKill", getRootElement(), stopDamage )
addEventHandler ( "onClientPedDamage", getRootElement(), stopDamage )

Lado del server

function stopDamage1 ( )
        fixVehicle ( root )
end
addEventHandler( "onVehicleExplode", getRootElement(), stopDamage1 )

setVehicleDamageProof ( root, true ) 
fixVehicle ( root ) -- this fixes all vehicles and makes sure no exploded vehicles exist before the script starts

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