Jump to content

About my police job gui


Gtagasje

Recommended Posts

Hello again,

You guys helped me alot with the job gui, and I'm very thankfull for that, but, now I added it to a another marker also, to test if that would work, it shows a error about the syntax @ line 57 or 58..

This is the script:

Client:

  
local dutyMarker = createMarker ( 1547.88953, -1681.53955, 12.5, 'cylinder', 2.0, 0, 0, 225, 132 ) 
  
  
  
function createCopGui ( hitElement ) 
  
        PoliceGui = guiCreateWindow(227,106,342,376,"MLAW Police job",false) 
  
        Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,PoliceGui) 
  
        Cancel = guiCreateButton(200,312,111,45,"Cancel",false,PoliceGui) 
  
        Doel = guiCreateMemo(63,44,234,242,"Police Job:\nAs police you will have a hourly payment. Further objectves comming soon!",false,PoliceGui) 
  
        guiMemoSetReadOnly( Doel,true ) 
  
end 
  
  
  
addEventHandler("onClientMarkerHit", dutyMarker, 
  
 function(hitElement) 
  
            if hitElement == localPlayer then 
  
            createCopGui ( hitElement ) 
  
            if (PoliceGui ~= nil) then 
  
            guiSetVisible(PoliceGui, true) 
  
            showCursor(true) 
  
            guiSetInputEnabled(true) 
  
            else 
  
            outputChatBox ("The police doesn't want you. Please re-enter the marker.") 
  
            end 
  
        end 
  
    end 
  
) 
  
function PoliceTeam(button,state) 
  
 if (source == Have_Job) then 
  
          triggerServerEvent("PoliceTeam",localPlayer) 
  
          guiSetInputEnabled(false) 
  
          guiSetVisible(CopGui, false) 
  
          showCursor(false) 
  
 elseif (source == Cancel) then 
  
          guiSetInputEnabled(false) 
  
          guiSetVisible(PoliceGui, false) 
  
          showCursor(false) 
  
     end 
  
end 
  
addEventHandler ("onClientGUIClick", root, PoliceTeam) 
  

Server:

  
local Police = createTeam ("Police", 0, 0, 255) 
  
function SetPlayerPolice() 
  
 setPlayerTeam (source, getTeamFromName("Police")) 
 setPlayerSkin (source, 280) 
  
end 
  
addEvent("PoliceTeam",true) 
  
addEventHandler("PoliceTeam", root, SetPlayerPolice) 
  

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