Jump to content

[resolved]How to add this function for the window?


Turbesz

Recommended Posts

I want add this (aclGroupAddObject, giveWeapon, and cargodmode script) to this window script for a button, the godmode, and invisible are good but but those functions not.

Help me pls:c This is the code:

outputChatBox("#FFF000FullFunPlay #FF0000Ajándék #FFF000Panel #000FFFby Turbesz #FFffFF[F2]",0,255,255,true) 
  
  
window = guiCreateWindow(322, 223, 783, 193, "AJÁNDÉK PANEL | TELJESEN TURBESZ ÁLTAL", false) 
guiWindowSetSizable(window, false) 
guiSetVisible (window, false) 
guiSetProperty(window, "CaptionColour", "FF00D655") 
button2 = guiCreateButton(9, 24, 126, 34, "HALHATATLANSÁG", false, window) 
guiSetProperty(button2, "NormalTextColour", "FF2FFE00") 
button3 = guiCreateButton(9, 68, 126, 35, "AUTÓ HALHATATLANSÁG 1X", false, window) 
guiSetProperty(button3, "NormalTextColour", "FF2FFE00") 
button33 = guiCreateButton(9, 110, 126, 32, "MINIGUN", false, window) 
guiSetProperty(button33, "NormalTextColour", "FF2FFE00") 
button4 = guiCreateButton(10, 150, 125, 33, "TANK", false, window) 
guiSetProperty(button4, "NormalTextColour", "FF2FFE00") 
button5 = guiCreateButton(143, 25, 131, 33, "SZÍNESÍRÁS", false, window) 
guiSetProperty(button5, "NormalTextColour", "FFFEFFFE") 
button6 = guiCreateButton(143, 68, 131, 35, "FEGYVER CSOMAG", false, window) 
guiSetProperty(button6, "NormalTextColour", "FFFEFFFE") 
button7 = guiCreateButton(144, 109, 130, 33, "LÁTHATATLANSÁG", false, window) 
guiSetProperty(button7, "NormalTextColour", "FFFEFFFE") 
memo = guiCreateMemo(277, 25, 496, 117, "\nSzia, üdv a FullFunPlay Szerveren! \n\nEz a panel, egy MÁGIKUS!!! ISMÉTLEM MÁGIKUS PANEL!!! Csak nektek, turbesztől, a tulajtól. \n\nItt kiválaszthatsz több valamit, 12 óránként! \n\nJó szórakozást a panellel!", false, window) 
guiMemoSetReadOnly(memo, true)     
button = guiCreateButton(146, 152, 627, 31, "BEZÁRÁS          BEZÁRÁS          BEZÁRÁS          BEZÁRÁS          BEZÁRÁS", false, window) 
  
  
  
function OpenWin() 
    if guiGetVisible ( window ) == false then 
       guiSetVisible ( window, true ) 
       showCursor(true) 
    end 
end 
bindKey ( "F2", "down", OpenWin) 
  
function Bezaras() 
    guiSetVisible(window, false) 
    showCursor ( false ) 
    
end 
addEventHandler ( "onClientGUIClick", button, Bezaras) 
  
local aButtons = { button7 } 
addEventHandler('onClientGUIClick',root, 
    function (      ) 
        for i,v in ipairs ( aButtons ) do 
            if source == v then 
            if getElementData ( source,'AntiButtonFlood' ) == true then return outputChatBox('Várjál 12 órát. Buggoltatásért bann jár.') end 
                setElementData ( source,'AntiButtonFlood',true ) 
                setElementAlpha(localPlayer, 0) 
                setTimer ( setElementData,43200,1,source,'AntiButtonFlood',false ) 
        end 
    end 
end 
) 
  
local aButtons1 = { button2 } 
addEventHandler('onClientGUIClick',root, 
    function (      ) 
        for i,v in ipairs ( aButtons1 ) do 
            if source == v then 
            if getElementData ( source,'AntiButtonFlood' ) == true then return outputChatBox('Várjál 12 órát. Buggoltatásért bann jár.') end 
                setElementData ( source,'AntiButtonFlood',true ) 
        function godmode ( ) 
        cancelEvent ( ) 
        end 
  
        addEventHandler ( "onClientGUIClick", button2, 
        function ( ) 
        addEventHandler ( "onClientPlayerDamage", localPlayer, godmode ) 
        end 
        ,false 
) 
        setTimer ( setElementData,43200,1,source,'AntiButtonFlood',false ) 
        end 
    end 
end 
) 

Edited by Guest
Link to comment

No, it's working.

button2 = cargodmode (not working)

button33 = minigun (not working)

button4 = tank (not working)

button5 = aclGroupAddObject (for the colorful writing) (not working)

:(

@Edit:

now aclGroupAddObject is working but aclGroupRemoveObject when player quit, not working... :(

Link to comment
No, it's working.

button2 = cargodmode (not working)

button33 = minigun (not working)

button4 = tank (not working)

button5 = aclGroupAddObject (for the colorful writing) (not working)

:(

@Edit:

now aclGroupAddObject is working but aclGroupRemoveObject when player quit, not working... :(

For the immortal car, give tank and minigun, try this:

outputChatBox("#FF0000--Rang #FFffFFvásárlás #00ff00panel-- #ff0000F10!",0,255,255,true) 
  
  
window = guiCreateWindow(322, 223, 783, 193, "AJÁNDÉK PANEL | TELJESEN TURBESZ ÁLTAL", false) 
guiWindowSetSizable(window, false) 
guiSetVisible (window, false) 
guiSetProperty(window, "CaptionColour", "FF00D655") 
button2 = guiCreateButton(9, 24, 126, 34, "HALHATATLANSÁG", false, window) 
guiSetProperty(button2, "NormalTextColour", "FF2FFE00") 
button3 = guiCreateButton(9, 68, 126, 35, "AUTÓ HALHATATLANSÁG 1X", false, window) 
guiSetProperty(button3, "NormalTextColour", "FF2FFE00") 
button33 = guiCreateButton(9, 110, 126, 32, "MINIGUN", false, window) 
guiSetProperty(button33, "NormalTextColour", "FF2FFE00") 
button4 = guiCreateButton(10, 150, 125, 33, "TANK", false, window) 
guiSetProperty(button4, "NormalTextColour", "FF2FFE00") 
button5 = guiCreateButton(143, 25, 131, 33, "SZÍNESÍRÁS", false, window) 
guiSetProperty(button5, "NormalTextColour", "FFFEFFFE") 
button6 = guiCreateButton(143, 68, 131, 35, "FEGYVER CSOMAG", false, window) 
guiSetProperty(button6, "NormalTextColour", "FFFEFFFE") 
button7 = guiCreateButton(144, 109, 130, 33, "LÁTHATATLANSÁG", false, window) 
guiSetProperty(button7, "NormalTextColour", "FFFEFFFE") 
memo = guiCreateMemo(277, 25, 496, 117, "\nSzia, üdv a FullFunPlay Szerveren! \n\nEz a panel, egy MÁGIKUS!!! ISMÉTLEM MÁGIKUS PANEL!!! Csak nektek, turbesztől, a tulajtól. \n\nItt kiválaszthatsz egy valamit, 12 óránként! \n\nJó szórakozást a panellel!", false, window) 
guiMemoSetReadOnly(memo, true)     
button = guiCreateButton(146, 152, 627, 31, "BEZÁRÁS          BEZÁRÁS          BEZÁRÁS          BEZÁRÁS          BEZÁRÁS", false, window) 
  
  
  
function OpenWin() 
    if guiGetVisible ( window ) == false then 
       guiSetVisible ( window, true ) 
       showCursor(true) 
    end 
end 
bindKey ( "F10", "down", OpenWin) 
  
function Bezaras() 
    guiSetVisible(window, false) 
    showCursor ( false ) 
     
end 
addEventHandler ( "onClientGUIClick", button, Bezaras) 
  
  
--minigun 
addEventHandler('onClientGUIClick',root, 
function () 
    if source == button33 then 
           triggerServerEvent("giveMinigun", localPlayer) 
    end 
end 
) 
  
--tank 
addEventHandler('onClientGUIClick',root, 
function () 
local x,y,z = getElementPosition(localPlayer) 
    if source == button4 then 
       TANK =  createVehicle(432, x + 2,y,z ) 
    end 
end 
) 
  
--car godmode 
addEventHandler('onClientGUIClick',root, 
function () 
local car = getPedOccupiedVehicle(localPlayer) 
    if source == button2 then 
        if isVehicleDamageProof(car) == false then 
           setVehicleDamageProof(car, true) 
        else 
            if isVehicleDamageProof(car) == true then 
            setVehicleDamageProof(car, false) 
            end 
        end 
    end 
end 
) 

Link to comment
--client 
addEventHandler('onClientGUIClick',root, 
function () 
    if source == button4 then 
triggerServerEvent("tank",locaPlayer,0,255,0,"---") 
    end 
end 
) 
  
  
--server 
  
addEvent("tank",true) 
  
  
addEventHandler("tank",root, 
  
  
function(r,g,b,text) 
  
  
local x,y,z = getElementPosition(source) 
  
  
  car =  createVehicle(432, x + 2,y,z ) 
   
  warpPlayerIntoVehicle(source,car) 
  
    outputChatBox(text,source,r,g,b) 
  
    end 
     
    ) 
     

Edited by Guest
Link to comment
doesn't work

try this

client

   
  --client 
addEventHandler('onClientGUIClick',root, 
function () 
    if source == button4 then 
triggerServerEvent("tank",getLocalPlayer(),0,255,0,"---") 
    end 
end 
) 

server

    --server 
  
    local car = { } 
addEvent("tank",true) 
  
  
addEventHandler("tank",root, 
  
  
function(r,g,b,text) 
  
if isElement(car[source]) then destroyElement(car[source]) end  
local x,y,z = getElementPosition(source) 
  
  
  car[source] =  createVehicle(432, x + 2,y,z ) 
     
  warpPedIntoVehicle(source,car[source]) 
  
    outputChatBox(text,source,r,g,b) 
  
    end 
     
    ) 
  
addEventHandler("onPlayerQuit",root, 
  
  
function  () 
  
destroyElement(car[source]) 
  
end 
  
) 

Edited by Guest
Link to comment
doesn't work

try this

client

   
  --client 
addEventHandler('onClientGUIClick',root, 
function () 
    if source == button4 then 
triggerServerEvent("tank",getLocalPlayer(),0,255,0,"---") 
    end 
end 
) 

server

    --server 
  
addEvent("tank",true) 
  
  
addEventHandler("tank",root, 
  
  
function(r,g,b,text) 
  
  
local x,y,z = getElementPosition(source) 
  
  
  car =  createVehicle(432, x + 2,y,z ) 
   
  warpPlayerIntoVehicle(source,car) 
  
    outputChatBox(text,source,r,g,b) 
  
    end 
     
    ) 

WarpPedIntoVehicle

Link to comment
doesn't work

try this

client

   
  --client 
addEventHandler('onClientGUIClick',root, 
function () 
    if source == button4 then 
triggerServerEvent("tank",getLocalPlayer(),0,255,0,"---") 
    end 
end 
) 

server

    --server 
  
addEvent("tank",true) 
  
  
addEventHandler("tank",root, 
  
  
function(r,g,b,text) 
  
  
local x,y,z = getElementPosition(source) 
  
  
  car =  createVehicle(432, x + 2,y,z ) 
   
  warpPlayerIntoVehicle(source,car) 
  
    outputChatBox(text,source,r,g,b) 
  
    end 
     
    ) 

aaa many thanks! :DD

But, what's the solution to the aclGroupRemoveObject when player quit? :?:

Link to comment

like this just not add. Remove

--server

function addToGroup( group )   
    group = aclGetGroup( group ) 
    if group == false or group == nil then 
        error( "The value of the 'group' is nil or false !" ) 
    end 
    account = getPlayerAccount( source ) 
    if not isGuestAccount( account ) then 
        local name = getAccountName( account ) 
        local add = aclGroupAddObject( group, "user."..name ) 
        if add then 
            outputChatBox( "Színesen írsz, amíg ki nem lépsz.", root, 0, 255, 0, true ) 
            triggerClientEvent( source, "hideall", source ) 
        else 
            outputChatBox( "Eleve színesen írsz már.", source, 255, 0, 0, true ) 
        end 
    else 
        outputChatBox( "Regisztrálj, és jelentkezz be.", source, 255, 0, 0, true ) 
    end 
end 
addEvent( "addToGroup", true ) 
addEventHandler( "addToGroup", root, addToGroup ) 

--client

addEventHandler("onClientGUIClick",getRootElement(), 
    function() 
        if source == button5 then 
            group = "Admin" 
            triggerServerEvent("addToGroup", getLocalPlayer(), group) 
        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...