Jump to content

How to do this


mjau

Recommended Posts

Posted

Hi i have created a spawnmenu script with gui but now i want one of the buttons i press to open a new gui i have made waht should i use to do this cuz setGuiVisible dont work and shows no erros

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
  
function createthegui() 
GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) 
GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) 
GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) 
GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) 
GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) 
GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWidnowCreate, false) 
addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) 
end 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
  
function armyWindowCreate() 
GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) 
GUIEditor_Button[1] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) 
end 

Posted

This is a mess, if i'm right you are cleaning the window's table again.

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
  
function createthegui() 
GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) 
GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) 
GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) 
GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) 
GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) 
GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWindowCreate, false) -- you put armyWidnow, but is armyWindow. 
addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) 
end 
  
function armyWindowCreate() 
GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) 
GUIEditor_Button[1] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) 
end 

I'm guessing the main GUI is shown, right?

Posted

dont think you gat me right

i mean i have one window opened with a command and one of the buttons on that window i want to open andother window and close the first one

Posted
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
  
function createthegui() 
GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) 
GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) 
GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) 
GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) 
GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) 
GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWindowCreate, false) -- you put armyWidnow, but is armyWindow. 
addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) 
end 
  
function armyWindowCreate() 
guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) 
GUIEditor_Button[1] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) 
end 

Posted

Dude... you had like 4 buttons in the same place! that way it was never going to work, but that wasn't the only error.

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
  
function armyWindowCreate() 
guiSetVisible(GUIEditor_Window[1], false) 
GUIEditor_Window[2] = guiCreateWindow(409,90,101,298,"Army Rangers",false) 
GUIEditor_Button[6] = guiCreateButton(9,26,83,46,"Airforce",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(9,79,83,49,"Assault unit",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(9,134,83,49,"Special forces",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(9,188,83,45,"Recruit",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(9,244,83,43,"Back",false,GUIEditor_Window[1]) 
end 
  
function armyspawn() 
end 
  
function createthegui() 
GUIEditor_Window[1] = guiCreateWindow(307,67,288,305,"FARPG:Spawnmenu",false) 
GUIEditor_Button[1] = guiCreateButton(9,23,102,46,"Army Rangers...",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(9,79,104,41,"Police...",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(9,130,104,43,"Criminal...",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(9,185,104,44,"Civiillian...",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(9,237,104,43,"Admin...",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(142,29,132,44,"Army Rangers \nOnly",false,GUIEditor_Window[1]) 
GUIEditor_Memo[2] = guiCreateMemo(142,79,133,40,"Police Team",false,GUIEditor_Window[1]) 
GUIEditor_Memo[3] = guiCreateMemo(142,129,131,42,"For the badasses",false,GUIEditor_Window[1]) 
GUIEditor_Memo[4] = guiCreateMemo(143,179,129,41,"Peaceful way to\nEarn money",false,GUIEditor_Window[1]) 
GUIEditor_Memo[5] = guiCreateMemo(144,239,131,42,"Admin ONLY",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", GUIEditor_Button[1], armyWindowCreate, false) -- you put armyWidnow, but is armyWindow. 
addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) 
end 

Posted

t i will im srry if im a bit annoying but iwas up all night scripting yesterday so i think the most simple thing could pissed me off xD

Edit: the 4 buttons was me not understandign the copy function in guieditor since i didnt read the chat xD

Posted (edited)

Ok another question how to restrcit this to an ACL group ?

here is what i have tried to do but dont work

function airForceMove(x,y,z,rotation,skin) 
    if x and y and z and rotation and skin then 
     accountname = getAccountName (getPlayerAccount(v)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
        spawnPlayer(source,x,y,z,rotation,skin) 
        setCameraTarget(source,source) 
        end 
    end 
end 
addEvent("airForceMove",true) 
addEventHandler("airForceMove",root,airForceMove) 
end 

Edited by Guest
Posted

You just copy and paste from some random script and think it'll work? nah, that's not how it works... also, you are messing client with server side.

Posted
xD srry and i copied itfrom wiki cuz i didnt know how to use it but i edited it now so its server side but tell me how i use isObjectInAclgroup
Posted
function airForceMove(x,y,z,rotation,skin) 
    if x and y and z and rotation and skin then 
    local accountname = getAccountName (getPlayerAccount(source)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
        spawnPlayer(source,x,y,z,rotation,skin) 
        setCameraTarget(source,source) 
        end 
    end 
end 
addEvent("airForceMove",true) 
addEventHandler("airForceMove",root,airForceMove) 

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