Jump to content

[HELP] GUI [HELP]


damien111

Recommended Posts

Posted

Ok, so i am trying to create a panel for the player that enteres the marker , and let him accept the job, and get the team, etc. It comes up for everyone everytime, and i know this is a noob question, but can someone help me?

client

  
GUIEditor = { 
    memo = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
  
        windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) 
        guiWindowSetSizable(windowjob9, false) 
  
         SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) 
         guiSetFont(GUIEditor.label[1], "sa-gothic") 
         SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) 
         SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) 
         SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) 
        guiSetFont(SwatButton, "sa-header")     
        guiSetVisible(windowjob9, false) 
         
local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) 
  
function Medicjob9(hitElement) 
     if getElementType(hitElement) == "player" then 
          if not guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, true) 
               showCursor(true) 
          end 
     end 
end 
addEventHandler("onClientMarkerHit", marker7, Medicjob9) 
  
function Medicjobleave9(leaveElement) 
     if getElementType(leaveElement) == "player" then 
          if guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, false) 
               showCursor(false) 
          end 
     end 
end 
addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) 
  
function joinTeam9() 
     triggerServerEvent("setSWAT",localPlayer) 
     guiSetVisible(windowjob9, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) 

server

  
    SwatTeam = getTeamFromName ( "SWAT" ) 
  
function joinSWAT() 
     setPlayerTeam(source,PoliceTeam) 
     setElementModel(source,285) 
     giveWeapon ( source, 31, 500, false ) 
     giveWeapon ( source, 25, 100, false ) 
     giveWeapon ( source, 23, 1, false ) 
     giveWeapon ( source, 24, 100, false ) 
     setElementData( source, "Occupation", "SWAT", true ) 
     outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) 
end 
addEvent("setSWAT", true) 
addEventHandler("setSWAT",root,joinSWAT) 

Posted

Server Problem;

Server-

function joinSWAT() 
     local SwatTeam = getTeamFromName("SWAT") 
     setPlayerTeam(source,SwatTeam) 
     setElementModel(source,285) 
     giveWeapon ( source, 31, 500, false ) 
     giveWeapon ( source, 25, 100, false ) 
     giveWeapon ( source, 23, 1, false ) 
     giveWeapon ( source, 24, 100, false ) 
     setElementData( source, "Occupation", "SWAT", true ) 
     outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) 
end 
addEvent("setSWAT", true) 
addEventHandler("setSWAT",getRootElement(),joinSWAT) 

I moved the getTeamFromName inside the function, tested it multiple times and seems to work. I think it's an easy solution.

And now Aurora is back again, pm for more info.

Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA.

Ex. Developer at Community of Social Gamers - CSG

Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP

9o6E8.png Ab-47

Posted

Add a

guiSetVisible(windowjob9, false) 

After you create the window.

When the marker is hit, it will set the Boolean to true

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
Add a
guiSetVisible(windowjob9, false) 

After you create the window.

When the marker is hit, it will set the Boolean to true

Look at line 18 of his client sided script, already stated.

And now Aurora is back again, pm for more info.

Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA.

Ex. Developer at Community of Social Gamers - CSG

Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP

9o6E8.png Ab-47

Posted
GUIEditor = { 
    memo = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
  
        windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) 
        guiWindowSetSizable(windowjob9, false) 
  
         SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) 
         guiSetFont(GUIEditor.label[1], "sa-gothic") 
         SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) 
         SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) 
         SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) 
        guiSetFont(SwatButton, "sa-header")     
        guiSetVisible(windowjob9, false) 
        
local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) 
  
function Medicjob9(hitElement) 
     if getElementType(hitElement) == "localPlayer" then 
          if not guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, true) 
               showCursor(true) 
          end 
     end 
end 
addEventHandler("onClientMarkerHit", marker7, Medicjob9) 
  
function Medicjobleave9(leaveElement) 
     if getElementType(leaveElement) == "localPlayer" then 
          if guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, false) 
               showCursor(false) 
          end 
     end 
end 
addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) 
  
function joinTeam9() 
     triggerServerEvent("setSWAT",localPlayer) 
     guiSetVisible(windowjob9, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) 
  

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Client:

  
GUIEditor = { 
    memo = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
  
        windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) 
        guiWindowSetSizable(windowjob9, false) 
  
         SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) 
         guiSetFont(SWATLabel, "sa-gothic") 
         SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) 
         SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) 
         SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) 
        guiSetFont(SwatButton, "sa-header")     
        guiSetVisible(windowjob9, false) 
        
local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) 
  
function Medicjob9(hitElement) 
     if getElementType(hitElement) == "player" then 
          if not guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, true) 
               showCursor(true) 
          end 
     end 
end 
addEventHandler("onClientMarkerHit", marker7, Medicjob9) 
  
function Medicjobleave9(leaveElement) 
     if getElementType(leaveElement) == "player" then 
          if guiGetVisible(windowjob9) then 
               guiSetVisible(windowjob9, false) 
               showCursor(false) 
          end 
     end 
end 
addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) 
  
function joinTeam9() 
     triggerServerEvent("setSWAT",localPlayer) 
     guiSetVisible(windowjob9, false) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) 

Omerta Roleplay

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