EinfachFischi


Wiek: 23 Na forum: 2745 dni Posty: 9
Nick w MP: Damianek
|
|
|
|
Witam mam paczke z serwer .SkyGame otoz probuje wznowic panel logowania ale ciagle sie nie udaje. Przy wyborze spawnu ( ustawilem dobre kordy ) tepalo na kordy 0 0 0 zamiast na te co wpisalem. Prosze o pomoc.
local screenW, screenH = guiGetScreenSize()
panelspawn = false
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*screenW,cy*screenH
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
if
type( sEventName ) == 'string' and
isElement( pElementAttachedTo ) and
type( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
function renderZoneBox()
if panelspawn == true then
local Alpha, Alpha2 = interpolateBetween(0, 0, 0, 170, 255, 0, ((getTickCount() - czasspawn) / 2500), "Linear")
dxDrawImage(screenW * 0.3287, screenH * 0.0130, screenW * 0.3419, screenH * 0.2318, "Img/Logo.png", 0, 0, 0, tocolor(255, 255, 255, Alpha2), false)
dxDrawImage(screenW * 0.2262, screenH * 0.1823, screenW * 0.5483, screenH * 0.6549, "Img/okn.png", 0, 0, 0, tocolor(0, 0, 0, Alpha), false)
if not isMouseIn(screenW * 0.4231, screenH * 0.4115, screenW * 0.1545, screenH * 0.0573) then --Przycisk 1
dxDrawImage(screenW * 0.4231, screenH * 0.4115, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, Alpha), false)
else
dxDrawImage(screenW * 0.4231, screenH * 0.4115, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, 240), false)
end
if not isMouseIn(screenW * 0.4231, screenH * 0.5052, screenW * 0.1545, screenH * 0.0573) then --Przycisk 1
dxDrawImage(screenW * 0.4231, screenH * 0.5052, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, Alpha), false)
else
dxDrawImage(screenW * 0.4231, screenH * 0.5052, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, 240), false)
end
if not isMouseIn(screenW * 0.4231, screenH * 0.5938, screenW * 0.1545, screenH * 0.0573) then --Przycisk 1
dxDrawImage(screenW * 0.4231, screenH * 0.5938, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, Alpha), false)
else
dxDrawImage(screenW * 0.4231, screenH * 0.5938, screenW * 0.1545, screenH * 0.0573, "Img/ebox.png", 0, 0, 0, tocolor(255, 255, 255, 240), false)
end
dxDrawText("Witaj na .skyGame!\nWyb?r spawnu", (screenW * 0.3411) + 1, (screenH * 0.2891) + 1, (screenW * 0.6589) + 1, (screenH * 0.3750) + 1, tocolor(0, 0, 0, Alpha2), 1.50, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Witaj na .skyGame!\nWyb?r spawnu", screenW * 0.3411, screenH * 0.2891, screenW * 0.6589, screenH * 0.3750, tocolor(255, 255, 255, Alpha2), 1.50, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Spawn SF", (screenW * 0.4231) + 1, (screenH * 0.4128) + 1, (screenW * 0.5769) + 1, (screenH * 0.4648) + 1, tocolor(0, 0, 0, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Spawn SF", screenW * 0.4231, screenH * 0.4128, screenW * 0.5769, screenH * 0.4648, tocolor(255, 255, 255, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Przechowywalnia SF", (screenW * 0.4231) + 1, (screenH * 0.5078) + 1, (screenW * 0.5769) + 1, (screenH * 0.5599) + 1, tocolor(0, 0, 0, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Przechowywalnia SF", screenW * 0.4231, screenH * 0.5078, screenW * 0.5769, screenH * 0.5599, tocolor(255, 255, 255, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Dom", (screenW * 0.4231) + 1, (screenH * 0.5964) + 1, (screenW * 0.5769) + 1, (screenH * 0.6484) + 1, tocolor(0, 0, 0, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Dom", screenW * 0.4231, screenH * 0.5964, screenW * 0.5769, screenH * 0.6484, tocolor(255, 255, 255, Alpha2), 1.30, "default-bold", "center", "center", false, false, false, false, false)
end
end
addEventHandler("onClientClick", root, function(button,state)
if panelspawn and button == "left" and state == "down" then
if isMouseIn(screenW * 0.4231, screenH * 0.4115, screenW * 0.1545, screenH * 0.0573) then
setElementData(localPlayer,"player:spawn",{-1594.1815185547,801.21350097656,6.8203125+0.1})
closeZones()
end
if isMouseIn(screenW * 0.4231, screenH * 0.5052, screenW * 0.1545, screenH * 0.0573) then
setElementData(localPlayer,"player:spawn",{-1594.1815185547,801.21350097656,6.8203125+0.1})
closeZones()
end
if isMouseIn(screenW * 0.4231, screenH * 0.5938, screenW * 0.1545, screenH * 0.0573) then
local domek=getElementData(localPlayer,"player:house")
if not domek then
setElementData(localPlayer,"player:spawn",{-1597.20,799.47,6.82+0.1})
outputChatBox("Niestety Nie posiadasz domku!")
end
closeZones()
end
end
end)
function closeZones()
setTimer( function()
removeEventHandler("onClientRender", root, renderZoneBox)
showCursor(false)
setPlayerHudComponentVisible ("area_name", false)
setPlayerHudComponentVisible ("radio", false)
showPlayerHudComponent("radar",true)
panelspawn = false
showChat(true)
setElementData(localPlayer,"hud:wloczony",true)
triggerEvent("stop:muzaLogin",getRootElement(),localPlayer)
triggerServerEvent("core:spawnPlayer", localPlayer)
setTimer(triggerEvent, 250, 1, "gui:start", localPlayer)
end, 400, 1)
end
addEvent("pokaz:wyborspawnu", true)
addEventHandler("pokaz:wyborspawnu", getRootElement(), function()
if isEventHandlerAdded("onClientRender",root,renderZoneBox) then
removeEventHandler ( "onClientRender", root, renderZoneBox)
end
setTimer( function()
panelspawn = true
showPlayerHudComponent("all",false)
showCursor(true)
guiSetInputMode("no_binds_when_editing")
addEventHandler("onClientRender", root, renderZoneBox)
czasspawn = getTickCount()
end,2000,1)
end)
|
|