Dimos7 Posted September 1, 2014 Share Posted September 1, 2014 (edited) 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 September 1, 2014 by Guest Link to comment
Castillo Posted September 1, 2014 Share Posted September 1, 2014 For what I can see, you are mixing client and server side functions, that will never work. Link to comment
Dimos7 Posted September 1, 2014 Author Share Posted September 1, 2014 what is client function? Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 what is client function? One question , from where you have this script Link to comment
Dimos7 Posted September 1, 2014 Author Share Posted September 1, 2014 I use wiki most time why? Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 I use wiki most time why? You put client functions & server functions together. https://wiki.multitheftauto.com/wiki/Cli ... _Functions And what's this? setPedClothes(265, 17, 4) Link to comment
Dimos7 Posted September 1, 2014 Author Share Posted September 1, 2014 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
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 setPedClothes dosen't exist , you can use this function https://wiki.multitheftauto.com/wiki/AddPedClothes , but will only work for skin (ID 0 ) CJ. If you want to change skin of a player you can use , https://wiki.multitheftauto.com/wiki/SetElementModel Link to comment
Dimos7 Posted September 1, 2014 Author Share Posted September 1, 2014 so will need fix and client function now i guess ty Link to comment
Dimos7 Posted September 2, 2014 Author Share Posted September 2, 2014 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
Dimos7 Posted September 3, 2014 Author Share Posted September 3, 2014 can someone help me? Link to comment
Et-win Posted September 3, 2014 Share Posted September 3, 2014 What do you want to get with: local skin = getElementModel(source) ? Because you can't give up a 'source' if it's just in the script and not in a function which was started with a command/event. Link to comment
Dimos7 Posted September 3, 2014 Author Share Posted September 3, 2014 so if i put in function and put source will be good? Link to comment
Et-win Posted September 3, 2014 Share Posted September 3, 2014 https://wiki.multitheftauto.com/wiki/GetElementModel You know that this code doesn't return 'true' or 'false' at all? So why are you checking or 'skin' == 'true'? What are you trying to do with it? Link to comment
Dimos7 Posted September 3, 2014 Author Share Posted September 3, 2014 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
Saml1er Posted September 3, 2014 Share Posted September 3, 2014 47.addEventHandelr should be addEventHandler Link to comment
Dimos7 Posted September 3, 2014 Author Share Posted September 3, 2014 (edited) 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 September 4, 2014 by Guest Link to comment
Saml1er Posted September 4, 2014 Share Posted September 4, 2014 onMarkerHit is server event. Use 'onClientMarkerHit' and this should be player because source of this event is marker. local skin = getElementModel(source) take a ss of debug ( /debugscript 3 ) ingame. Link to comment
Dimos7 Posted September 4, 2014 Author Share Posted September 4, 2014 (edited) 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 September 4, 2014 by Guest Link to comment
Saml1er Posted September 4, 2014 Share Posted September 4, 2014 (edited) 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 September 4, 2014 by Guest Link to comment
Dimos7 Posted September 4, 2014 Author Share Posted September 4, 2014 you know if possible to team not apreas at tab? also no aprears nothing i put my self to rank officer and not do nothing Link to comment
Dimos7 Posted September 4, 2014 Author Share Posted September 4, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now