Jump to content

I need help


Dimos7

Recommended Posts

local marker = createMarker(255.6, 77.3, 1002.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
function job(player) 
    local data = getElementData(player, "Job") 
        if (data == "Police Officer") then 
         Window =  guiCreateWindow(50, 20, 5, 6, "Select Uniform",true) 
            guiCreateTabPanel(40, 10, 1, 1, true, "Select Uniform") 
            guiCreateScrollBar(12, 50, 10, 12, false, false, Window) 
            if (guiCreateLabel(0.02, 0.04, 0.94, 0.2 , "LS Uniform", true) == true) then 
                setPedClothes(280, 17, 4)  
                setPlayerNametagColor(0,0,255) 
                giveWeapon(player, 3, 1) 
                giveWeapon(player, 24, 100) 
                giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0.04, 0.06, 0.94, 0.2, "SF Uniform", true) == true) then 
                setPedClothes(281, 17, 4) 
                setPlayerNametagColor(0, 0, 255) 
                giveWeapon(player, 3, 1) 
                giveWeapon(player, 24, 100) 
                giveWeapon(player, 41, 5000) 
            else             
            if (guiCreateLabel(0.06, 0.08, 0.94, 0.2, "lV Uniform", true) == true) then 
               setPedClothes(282, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0.08, 0.10, 0.94, 0.2 ,"RCSD Uniform", true) ==true) then 
               setPedClothes(283, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0.10, 0.12, 0.94, 0.2, "Bike Uniform", true) == true) then 
                setPedClothes(284, 17, 4) 
                setPlayerNametagColor(0, 0, 255) 
                giveWeapon(player, 3, 1) 
                giveWeapon(player, 24, 100) 
                giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0.12, 0.14, 0.94, 0.2, "SWAT Uniform", true) == true) then 
               setPedClothes(285, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0.14, 0.16, 0.94, 0.2, "BCSD Uniform", true) == true) then 
                setPedClothes(288, 17, 4) 
                setPlayerNametagColor(0, 0, 255) 
                giveWeapon(player, 3, 1) 
                giveWeapon(player, 24, 100) 
                giveWeapon(player, 41, 5000) 
            if (guiCreateLabel(0.16, 0.18, 0.94, 0.2, "LS Uniform",true) == true) then 
                setPedClothes(265, 17, 4) 
                setPlayerNametagColor(0, 0, 255) 
                giveWeapon(player, 3, 1) 
                giveWeapon(player, 24, 100) 
                giveWeapon(player, 41, 5000) 
            else 
            if (guiCreateLabel(0,18, 0,20, 0.94, 0.2, "LS Uniform", true) == true) then 
               setPedClothes(266, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
            end 
            end 
            end 
            end 
            end 
            end 
            end 
            end 
            end 
            guiCreateButton(1, 2, 0.94, 0.2, "Ok", true) 
            guiCreateButton(2, 4, 0.94, 0.2, "Go off duty", true) 
            guiCreateButton(4, 8, 0.94, 0.2, "Cancel",true)          
      end 
end 
addEventHandler("onMarkerHit", marker, job) 

not apreas nothing

Edited by Guest
Link to comment
local marker = createMarker(255.6, 77.3, 1002.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
function job(player) 
    local data = getElementData(player, "Job") 
        if (data == "Police Officer") then 
               setPedClothes(280, 17, 4)  
               setPlayerNametagColor(0,0,255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(281, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(282, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(283, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(284, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(285, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(288, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(265, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000) 
               setPedClothes(266, 17, 4) 
               setPlayerNametagColor(0, 0, 255) 
               giveWeapon(player, 3, 1) 
               giveWeapon(player, 24, 100) 
               giveWeapon(player, 41, 5000)  
      end 
end 
addEventHandler("onMarkerHit", marker, job) 

well its for change skin put police

Link to comment

Client:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
local skin = getElementModel(localPlayer) 
  
function Police (player) 
    local data = getElementData(player, "Rank") 
     
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true)  
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
            if (data == "SWAT Officer") then 
            guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          else 
                outputChatBox("You don't have access", player, 255, 0, 0) 
           end 
             guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
            
           if (data == "Sergeant") and (skin == true)  and (color == true)then 
               guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true)  
            else 
               outputChatBox("You don't have access", player, 255, 0, 0) 
            end 
            o = guiCreateButton(1, 2, 0.94, 0.2, "Ok",false , Window) 
            g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
            c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onMarkerHit", marker, police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
   end 
 end 
 addEventHandler("onClientGUIClick", getElementRoot() ,C) 
  
 function O() 
    if source == o then 
       triggerServerEvent("SAPDTeam",localPlayer) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false) 
    end 
end 
addEventHandelr("onClientGUIClick", getElementRoot(), O) 
  
function G() 
      if source == g and skin == true and color == true then 
         getElementModel(source) 
         triggerServerEvent("CitizenTeam",localPlayer) 
         setElementData(source, "Job", "None") 
         guiSetVisible(Window, false) 
         showCursor(false) 
       end 
end 
addEventHandler("onClientGUIClick", getElementRoot(), G)     

Server:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
local skin = getElementModel(source) 
createTeam("SAPD", 0, 0, 255) 
  
  
function Police (player) 
    local data = getElementData(player, "Rank") 
       if (data == "Officer") then 
          setElementModel(player, 246) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 265) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 266) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 267) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 280) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 281) 
          setPlayerTeam(player, SAPD) 
          setElementModel(player, 282) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 283) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 284) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       if (data == "SWAT Officer")then 
          setElementModel(player, 285) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       end 
          setElementModel(player, 288) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
           
       if (data == "Sergeant") and skin == true then 
            getElementModel(player) 
            setPlayerTeam(player, Citizen) 
            giveWeapon(player, 3, 1) 
            giveWeapon(player, 24, 100) 
            giveWeapon(player, 41, 5000) 
        end 
        end 
end 
addEventHandler("onMarkerHit", marker, Police)   

server side getElementModel(source) exepct a element got a nill also it possible to the team no apreas at chat?

Link to comment

i try take player skin before take another when put in team

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
  
function Police (player) 
    local data = getElementData(player, "Rank") 
    local skin = getElementModel(source) 
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true)  
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
          guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
          guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true)  
          o = guiCreateButton(1, 2, 0.94, 0.2, "OK",false , Window) 
          g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
          c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onMarkerHit", marker, Police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
   end 
 end 
 addEventHandler("onClientGUIClick", rootElement,C) 
  
 function O() 
    if source == o then 
       triggerServerEvent("SAPDTeam",localPlayer) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false) 
    end 
end 
addEventHandelr("onClientGUIClick",rootElement, O) 
  
function G() 
    local skin = getElementModel(source) 
      if source == g then 
         getElementModel(source) 
         triggerServerEvent("CitizenTeam",localPlayer) 
         setElementData(source, "Job", "None") 
         guiSetVisible(Window, false) 
         showCursor(false) 
       end 
end 
addEventHandler("onClientGUIClick",rootElement, G) 

also apreas error 47 addeventhandler a nill value

and warning at 37 bad argument help please

Link to comment
local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
  
function Police (player) 
    local data = getElementData(player, "Rank") 
    local skin = getElementModel(player) 
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true) 
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
          guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
          guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true) 
          o = guiCreateButton(1, 2, 0.94, 0.2, "OK",false , Window) 
          g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
          c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onClientMarkerHit", marker, Police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
   end 
 end 
 addEventHandler("onClientGUIClick", getElementRoot(),C) 
  
 function O(player) 
    if source == o then 
       triggerServerEvent("SAPDTeam",player) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false) 
    end 
end 
addEventHandler("onClientGUIClick", getElementRoot(), O) 
  
function G(player) 
    local skin = getElementModel(player) 
      if source == g then 
         getElementModel(player) 
         triggerServerEvent("CitizenTeam",player) 
         setElementData(source, "Job", "None") 
         guiSetVisible(Window, false) 
         showCursor(false) 
       end 
end 
addEventHandler("onClientGUIClick", getElementRoot(), G) 

still gate the wraning expect element go a nill value

Edited by Guest
Link to comment

Server side:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
createTeam("SAPD", 0, 0, 255) 
createTeam("Citizen", 255, 255, 255) 
  
  
function Police (player) 
    local skin = getElementModel(player) 
    local data = getElementData(player, "Rank") 
       if (data == "Officer") then 
          setElementModel(player, 246) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 265) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 266) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 267) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 280) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 281) 
          setPlayerTeam(player, SAPD) 
          setElementModel(player, 282) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 283) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 284) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       if (data == "SWAT Officer")then 
          setElementModel(player, 285) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       else 
          outputChatBox("You don't have access", player, 255, 0, 0) 
       end 
          setElementModel(player, 288) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
           
       if (data == "Sergeant") then 
            getElementModel(player) 
            setPlayerTeam(player, Citizen) 
            giveWeapon(player, 3, 1) 
            giveWeapon(player, 24, 100) 
            giveWeapon(player, 41, 5000) 
        else 
           outputChatBox("You don't have access", player, 255, 0, 0)         
        end 
        end 
end 
addEventHandler("onMarkerHit", marker, Police) 

Client Side:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
  
function Police (player) 
    local data = getElementData(player, "Rank") 
    local skin = getElementModel(player) 
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true)  
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
          guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
          guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true)  
          o = guiCreateButton(1, 2, 0.94, 0.2, "OK",false , Window) 
          g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
          c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onClientMarkerHit", marker, Police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
   end 
 end 
 addEventHandler("onClientGUIClick", getElementRoot(),C) 
  
 function O(player) 
    if source == o then 
       triggerServerEvent("SAPDTeam",player) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false) 
    end 
end 
addEventHandler("onClientGUIClick", getElementRoot(), O) 
  
function G(player) 
    local skin = getElementModel(player) 
      if source == g then 
         getElementModel(player) 
         triggerServerEvent("CitizenTeam",player) 
         setElementData(source, "Job", "None") 
         guiSetVisible(Window, false) 
         showCursor(false) 
       end 
end 
addEventHandler("onClientGUIClick", getElementRoot(), G) 

http://i.imgur.com/Q7NCsDC.png

Edited by Guest
Link to comment
local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
  
  
  
function Police (player) 
    local skin = getElementModel(player) 
    local data = getElementData(player, "Rank") 
       if (data == "Officer") then 
                  
          setElementModel(player, 284) 
           
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
  end 
       if (data == "SWAT Officer")then 
          setElementModel(player, 285) 
    giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       else 
          outputChatBox("You don't have access", player, 255, 0, 0) 
       end 
        setElementModel(player, 288) 
           
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
           
       if (data == "Sergeant") then 
  
                        giveWeapon(player, 3, 1) 
            giveWeapon(player, 24, 100) 
            giveWeapon(player, 41, 5000) 
        else 
           outputChatBox("You don't have access", player, 255, 0, 0)         
        end 
end 
addEventHandler("onMarkerHit", marker, Police) 

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
 local c,o,g = nil,nil,nil 
  
function Police (player) 
    local data = getElementData(player, "Rank") 
    local skin = getElementModel(player) 
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true)  
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
          guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
          guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true)  
          o = guiCreateButton(1, 2, 0.94, 0.2, "OK",false , Window) 
          g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
          c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onClientMarkerHit", marker, Police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
  elseif source == o then 
triggerServerEvent("SAPDTeam",player) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false)  
elseif source == g then 
  
         getElementModel(player) 
  
         triggerServerEvent("CitizenTeam",player) 
  
         setElementData(source, "Job", "None") 
  
         guiSetVisible(Window, false) 
  
         showCursor(false) 
   end 
 end 
 addEventHandler("onClientGUIClick", root,C) 
  
  

Edited by Guest
Link to comment

Client side:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
local o,g,c = nil, nil, nil 
  
function Police (player) 
    local data = getElementData(player, "Rank") 
    local skin = getElementModel(player) 
      if (data == "Officer") then 
          Window = guiCreateWindow(0.50, 0.20, 5, 6, "Select Uniform", true) 
          guiSetVisible (Window, true) 
          showCursor(true) 
          guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Female Uniform", true) 
          guiCreateLabel(0.04, 0.08, 0.94, 0.2, "Street Cop 1 Uniform",true) 
          guiCreateLabel(0.06, 0.08, 0.94, 0.2, "Street Cop 2 Uniform", true) 
          guiCreateLabel(0.08, 0.08, 0.94, 0.2, "Street Cop 3 Uniform", true) 
          guiCreateLabel(0.10, 0.08, 0.94, 0.2, "LS Uniform", true) 
          guiCreateLabel(0.12, 0.08, 0.94, 0.2, "SF Uniform",true) 
          guiCreateLabel(0.14, 0.08, 0.94, 0.2, "LV Uniform",true) 
          guiCreateLabel(0.16, 0.08, 0.94, 0.2, "RCSD Uniform", true)  
          guiCreateLabel(0.18, 0.08, 0.94, 0.2, "Bike Uniform", true) 
          guiCreateLabel(0.20, 0.08, 0.94, 0.2, "SWAT Uniform", true) 
          guiCreateLabel(0.22, 0.08, 0.94, 0.2, "BCSD Uniform", true) 
          guiCreateLabel(0.24, 0.08, 094, 0.2, "Own Skin", true)  
          o = guiCreateButton(1, 2, 0.94, 0.2, "OK",false , Window) 
          g = guiCreateButton(2, 2, 0.94, 0.2, "Go off duty", false, Window) 
          c = guiCreateButton(3, 2, 0.94, 0.2, " Cancel", false, Window) 
        end 
end   
addEventHandler("onClientMarkerHit", marker, Police) 
  
function C() 
   if source == c then 
       guiSetVisisble(Window,false) 
       showCursor(false) 
   else 
     if source == o then 
       triggerServerEvent("SAPDTeam",player) 
       setElementData(source, "Job", "Police Officer") 
       guiSetVisible(Window, false) 
       showCursor(false) 
  else 
   if source == g then 
      getElementModel(player) 
      triggerServerEvent("CitizenTeam",player) 
      setElementData(source, "Job", "None") 
      guiSetVisible(Window, false) 
      showCursor(false) 
    end 
    end 
    end 
    end 
  
 addEventHandler("onClientGUIClick", root,C) 

Server side:

local marker = createMarker(255.6, 77.3, 1003.7, "cylinder", 1.5, 0, 0, 255, 255) 
setElementInterior(marker, 6) 
createTeam("SAPD", 0, 0, 255) 
createTeam("Citizen", 255, 255, 255) 
  
  
function Police (player) 
    local skin = getElementModel(player) 
    local data = getElementData(player, "Rank") 
       if (data == "Officer") then 
          setElementModel(player, 246) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 265) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 266) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 267) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 280) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 281) 
          setPlayerTeam(player, SAPD) 
          setElementModel(player, 282) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 283) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
          setElementModel(player, 284) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       if (data == "SWAT Officer")then 
          setElementModel(player, 285) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
       else 
          outputChatBox("You don't have access", player, 255, 0, 0) 
       end 
          setElementModel(player, 288) 
          setPlayerTeam(player, SAPD) 
          giveWeapon(player, 3, 1) 
          giveWeapon(player, 24, 100) 
          giveWeapon(player, 41, 5000) 
           
       if (data == "Sergeant") then 
            getElementModel(player) 
            setPlayerTeam(player, Citizen) 
            giveWeapon(player, 3, 1) 
            giveWeapon(player, 24, 100) 
            giveWeapon(player, 41, 5000) 
        else 
           outputChatBox("You don't have access", player, 255, 0, 0)         
        end 
        end 
end 
addEventHandler("onMarkerHit", marker, Police) 

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