billal Posted May 12, 2016 Author Share Posted May 12, 2016 جرب كدا gme = getLocalPlayer() Gui = {} Gui.window = GuiWindow(290, 132, 210, 315, "spawn", false) Gui.window:setSizable(false) Gui.window:setVisible(false) Gui.radioButton1 = GuiRadioButton(21, 32, 163, 15, "الانتحار للمشفى", false, Gui.window) Gui.radioButton1:setProperty("NormalTextColour", "FFE95014") Gui.radioButton2 = GuiRadioButton(21, 78, 163, 15, "الانتحار للمقر", false, Gui.window) Gui.radioButton2:setProperty("NormalTextColour", "FF0DEF0D") Gui.radioButton3 = GuiRadioButton(21, 123, 167, 15, "الانتحار للبيت", false, Gui.window) Gui.radioButton3:setProperty("NormalTextColour", "FFE95014") Gui.radioButton4 = GuiRadioButton(21, 172, 158, 15, "الانتحار لمركز الشرطة", false, Gui.window) Gui.radioButton4:setProperty( "NormalTextColour", "FF0813F6") ---//////////////// bindKey("F2","down",function () if Gui.window:getVisible() == false then Gui.window:setVisible(true) showCursor(true) else Gui.window:setVisible(false) showCursor(false) end end) ---//////////////// Taple_Groups = { -- {Name=button Name,group=Group Name,x,y,z,interior=interior ID,Dimension=Dimension ID} {Name=Gui.radioButton2,group='army', 203,1911,18 ,interior=0,Dimension=0}, -- المقر {Name=Gui.radioButton4,group='police', 1542,-1676,14 ,interior=0,Dimension=0} -- مركز الشرطه } ---//////////////// addEventHandler ("onClientGUIClick",root,function () for _,v in pairs(Taple_Groups) do if gme:getData("Group") == v.group then if source == v.Name then if isTimer (timer) then killTimer (timer) end triggerServerEvent("Respawn",gme,v[1],v[2],v[3],v.interior,v.Dimension) outputChatBox(v[1]..','..v[2]..','..v[3]..','..v.interior..','..v.Dimension) return end end end end) ---//////////////// hs_table = { -- x y z rot view x view y view z [1]={ 1177, -1320, 14.137756347656, 270, 1200.6923828125, -1324.9873046875, 20.398437 }, [2]={ -2666, 630, 13.567041397095, 180, -2664.4501953125, 611.0771484375, 20.454549789429 }, [3]={ 1607, 1818, 10.8203125, 0, 1607.3310546875, 1839.7470703125, 16.8203125 }, [4]={ 2040, -1420, 16.9921875, 90, 2031.8486328125, -1419.5927734375, 22.9921875 }, [5]={ -2200, -2308, 30.625, -45, -2193.5888671875, -2301.6630859375, 36.625 }, [6]={ 208, -65.3, 1.4357746839523, 180, 208.310546875, -75.525390625, 7.4357746839523 }, [7]={ 1245.8, 336.9, 19.40625, -20, 1250.3759765625, 346.681640625, 25.40625 }, [8]={ -317.4, 1056.4, 19.59375, 0, -316.8125, 1066.306640625, 25.59375 }, [9]={ -1514.8, 2527.9, 55.6875, 1.790, -1514.283203125, 2536.412109375, 61.6875 },} ---//////////////// function get_nearest_hospital() local n_loc,min = nil,9999 for k,v in ipairs(hs_table) do local px,py= getElementPosition(gme) local dist = getDistanceBetweenPoints2D(px,py,v[1],v[2]) if dist < min then n_loc = v min = dist end if gme:getInterior() > 0 then break end end local isJailed = exports.GTWjail:isJailed(gme) if not isJailed then return n_loc[1]+math.random(-1,1),n_loc[2]+math.random(-1,1),n_loc[3],n_loc[4],n_loc[5],n_loc[6],n_loc[7] else return -2965+math.random(-5,5),2305+math.random(-5,5),9,270 end end ---//////////////// addEventHandler ("onClientGUIClick",root,function () if source == Gui.radioButton1 then timer = setTimer(function () local x,y,z = get_nearest_hospital(gme) triggerServerEvent("Respawn",gme,x,y,z,0,0) end,100,0) outputChatBox(getZoneName ( x, y, z)..")" ) end end) كفؤ جداااا اوسكار+اسف اني تعبتك كتير معايا 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