Jump to content

help plz with gui


top sniper

Recommended Posts

Posted

hi

i made a gui

and i whant a help

what is the code for Freeze all 4 10 min onClick button?

----

-- Bind --

--- On Click ---

function onClick (button, state, absoluteX, absoluteY)

????????

-------------

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

Post your entire script and explain yourself better.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I mean if one pressed the button freezes all

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

-- client side:

myButton = guiCreateButton(args) -- You must supply the button arguments. 
  
addEventHandler("onClientGUIClick",myButton, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end, false) 

-- server side:

addEvent("freezeAllPlayers",true) 
addEventHandler("freezeAllPlayers",root, 
function () 
for index, player in pairs(getElementsByType("player")) do 
    if (player ~= source) then 
         setElementFrozen(player, true) 
    end 
end 
outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0) 
end) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

thanxxxxxxxxxx

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted
-- Bind -- 
--- On Click --- 
function onClick (button, state, absoluteX, absoluteY) 
myButton = guiCreateButton(args) -- You must supply the button arguments. 
  
addEventHandler("onClientGUIClick",myButton, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end, false) 
     

like this?

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted
  
addEvent("freezeAllPlayers",true) 
addEventHandler("freezeAllPlayers",root, 
  
function() 
  
local PlayerMoney = getPlayerMoney(source) 
  
if ( PlayerMoney >= 1200) then  
  
for index, player in pairs(getElementsByType("player")) do 
    if (player ~= source) then 
     setPedFrozen(player, true) 
    end 
end 
outputChatBox(getPlayerName(source) .." has Bought FreezPlayers",getRootElement(),255,0,0) 
end) 

Posted

Dev-Point, please don't do double post.

And also, the problem is already solved, my server side script works perfectly fine.

He has only to fill the guiCreateButton arguments.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You don't know how to supply the arguments or you don't know what does it mean?

guiCreateButton ( float x, float y, float width, float height, string text, bool relative, [ element parent = nil ] ) 

These are the arguments.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i dont whant to use it for a shop ..

i whant to made a q panel for admins ..

and i whant freeze all function on it only ..

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted
outputChatBox(".:Show Azan by ===[TopSniper]===| #FFFF1APress F3 To Open it :.",0,255,0,true) 
  
--- Windows --- 
local myWindow = guiCreateWindow ( 0, 0, 2, 2, "Information", true )  
  
qZwin = guiCreateButton(200,400,100,100,"وقت الاذان",false,zWin) 
  
  
function onresourceStart () 
  bindKey ("F3", "down", showWindow) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
  
-- Bind -- 
function showWindow () 
getVisible = guiGetVisible (zWin) 
if (getVisible == true) then 
    guiSetVisible (zWin, false) 
    showCursor (false) 
    guiSetInputEnabled(false) 
end 
if (getVisible == false) then 
    guiSetVisible (zWin, true) 
    showCursor (true) 
    guiSetInputEnabled(true) 
end 
end 
  
-- Bind -- 
--- On Click --- 
function onClick (button, state, absoluteX, absoluteY) 
    outputChatBox("*** حاان وقت الاذاان قم الى الصلااة***",255,255,0) 
        outputChatBox("*** وقت الصلاة تم تجميد الاعبين 10 دقائق admin freeze all 10 min***",255,255,0) 
playSound("a.mp3") 
     
     
  
     
         
  
end 
  
addEventHandler ("onClientGUIClick", getRootElement(), onClick) 
  
  
  

why when i add

myButton = guiCreateButton(args) -- You must supply the button arguments. 
  
addEventHandler("onClientGUIClick",myButton, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end, false) 

its dont work? :@

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

does any one know what is whant means?

myButton = guiCreateButton(args) -- You must supply the button arguments. 
  
addEventHandler("onClientGUIClick",myButton, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end) 

the other code is seem full of errors lol

CiTLh.png
Posted

server side

addEvent("freezeAllPlayers",true) 
addEventHandler("freezeAllPlayers",root, 
function () 
for index, player in pairs(getElementsByType("player")) do 
    if (player ~= source) then 
         setElementFrozen(player, true) 
    end 
end 
outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0) 
end 

client side

outputChatBox(".:Azan Time by ===[TopSniper]===| #FFFF1APress F3 To Open it :.",0,255,0,true) 
  
--- Windows --- 
zWin = guiCreateWindow(200,200,700,700,"Azan",false) 
  
qZwin = guiCreateButton(200,400,100,100,"وقت الاذان",false,zWin) 
  
  
function onresourceStart () 
  bindKey ("F3", "down", showWindow) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
  
-- Bind -- 
function showWindow () 
getVisible = guiGetVisible (zWin) 
if (getVisible == true) then 
    guiSetVisible (zWin, false) 
    showCursor (false) 
    guiSetInputEnabled(false) 
end 
if (getVisible == false) then 
    guiSetVisible (zWin, true) 
    showCursor (true) 
    guiSetInputEnabled(true) 
end 
end 
  
-- Bind -- 
--- On Click --- 
function onClick (button, state, absoluteX, absoluteY) 
    outputChatBox("*** حاان وقت الاذاان قم الى الصلااة***",255,255,0) 
        outputChatBox("*** وقت الصلاة تم تجميد الاعبين 10 دقائق admin freeze all 10 min***",255,255,0) 
playSound("a.mp3") 
myButton = guiCreateButton(args) -- You must supply the button arguments. 
  
addEventHandler("onClientGUIClick",myButton, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end) 
  
    
     
     
  
     
         
  
end 
  
addEventHandler ("onClientGUIClick", getRootElement(), onClick) 
  
  
  

where is the proplem??????????????????????????????

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

where is the proplem???????????????????????

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

134479106051.png

==================================================================

Posted

Dev-Point, are you blind or what?

top sniper said: "I don't want to use it for a shop .. I want to make a panel for admins .."

-- server side:

-- client side:

outputChatBox(".:Azan Time by ===[TopSniper]===| #FFFF1APress F3 To Open it :.",0,255,0,true) 
  
--- Windows --- 
zWin = guiCreateWindow(200,200,700,700,"Azan",false) 
  
qZwin = guiCreateButton(200,400,100,100,"وقت الاذان",false,zWin) 
  
  
function onresourceStart () 
  bindKey ("F3", "down", showWindow) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) 
  
-- Bind -- 
function showWindow () 
getVisible = guiGetVisible (zWin) 
if (getVisible == true) then 
    guiSetVisible (zWin, false) 
    showCursor (false) 
    guiSetInputEnabled(false) 
end 
if (getVisible == false) then 
    guiSetVisible (zWin, true) 
    showCursor (true) 
    guiSetInputEnabled(true) 
end 
end 
  
addEventHandler("onClientGUIClick",qZwin, 
function () 
    triggerServerEvent("freezeAllPlayers",localPlayer) 
end) 

addEvent("freezeAllPlayers",true) 
addEventHandler("freezeAllPlayers",root, 
function () 
for index, player in pairs(getElementsByType("player")) do 
    if (player ~= source) then 
         setElementFrozen(player, true) 
    end 
end 
outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0) 
end) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Dev-Point, why can't you just try to help him? you keep saying that he want's to do something else.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I have no idea what's going on no more, but this is a script for it what he wants.

-- Freeze GUI 
function freezeGUI() 
    freeze_window = guiCreateWindow(836, 149, 206, 137, "Freeze GUI", false) 
    guiWindowSetSizable(freeze_window, false) 
    guiSetVisible(freeze_window, false) 
     
    freeze_freeze_button = guiCreateButton(16, 32, 172, 41, "Freeze all players", false, freeze_window) 
    freeze_unfreeze_button = guiCreateButton(16, 80, 172, 41, "Unfreeze all players", false, freeze_window) 
     
    addEventHandler("onClientGUIClick", freeze_freeze_button, freezePlayers) 
    addEventHandler("onClientGUIClick", freeze_unfreeze_button, unfreezePlayers) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), freezeGUI) 
  
-- Toggle the GUI 
function freezeToggleGUI() 
    local status = guiGetVisible(freeze_window) 
     
    if status == true then 
        guiSetVisible(freeze_window, false) 
        showCursor(false) 
    else 
        guiSetVisible(freeze_window, true) 
        showCursor(true) 
    end 
end 
addCommandHandler("gui", freezeToggleGUI) 
  
-- Freeze everyone 
function freezePlayers() 
    local players = getElementsByType("player") 
    local status = getElementData(freeze_unfreeze_button, "Frozen") 
     
    if status == false then 
        outputChatBox("All players frozen.", 120, 255, 120, false) 
        for i,v in ipairs(players) do 
            setElementFrozen(v, true) 
            guiSetVisible(freeze_window, false) 
            showCursor(false) 
            setElementData(freeze_unfreeze_button, "Frozen", true) 
        end 
    else 
        outputChatBox("All players are already frozen.", 255, 0, 0, false) 
    end 
end 
  
-- Unfreeze everyone 
function unfreezePlayers() 
    local players = getElementsByType("player") 
    local status = getElementData(freeze_unfreeze_button, "Frozen") 
     
    if status == true then 
        outputChatBox("All players unfrozen.", 120, 255, 120) 
        for i,v in ipairs(players) do 
            setElementFrozen(v, false) 
            guiSetVisible(freeze_window, false) 
            showCursor(false) 
            setElementData(freeze_unfreeze_button, "Frozen", false) 
        end 
    else 
        outputChatBox("All players are already unfrozen.", 255, 0, 0) 
    end 
end 

If I helped you, please click the like button on the right ;) Thanks!

Posted
Dev-Point, are you blind or what?

top sniper said: "I don't want to use it for a shop .. I want to make a panel for admins .."

-- server side:

-- client side:

LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL

outputChatBox(".:Azan Time by ===[TopSniper]===| #FFFF1APress F3 To Open it :.",0,255,0,true)

--- Windows ---

zWin = guiCreateWindow(200,200,700,700,"Azan",false)

qZwin = guiCreateButton(200,400,100,100,"وقت الاذان",false,zWin)

function onresourceStart ()

bindKey ("F3", "down", showWindow)

end

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart)

-- Bind --

function showWindow ()

getVisible = guiGetVisible (zWin)

if (getVisible == true) then

guiSetVisible (zWin, false)

showCursor (false)

guiSetInputEnabled(false)

end

if (getVisible == false) then

guiSetVisible (zWin, true)

showCursor (true)

guiSetInputEnabled(true)

end

end

addEventHandler("onClientGUIClick",qZwin,

function ()

triggerServerEvent("freezeAllPlayers",localPlayer)

end)

LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL

addEvent("freezeAllPlayers",true)

addEventHandler("freezeAllPlayers",root,

function ()

for index, player in pairs(getElementsByType("player")) do

if (player ~= source) then

setElementFrozen(player, true)

end

end

outputChatBox(getPlayerName(source) .." has frozen everyone.",getRootElement(),255,0,0)

end)

this works fine thanxx

..

but Is there code make the scribt can opens only by adminss?

==================================================================

~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~

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