Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-12-20, 22:51


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Witam!
Dzi? pisze na tym forum i prosz? o pomoc
Mianowicie chodzi o to ze jak zrobi?em(edytowa?em) wyb?r miasta (spawnu)
Problem polega na tym ze jak wybior? spawn Los Santos to mnie respi w lv (przyk?ad)



x,y=36.63,82.19 -- my width
intro_step=math.random(0,850)
local screenWscreenH guiGetScreenSize()
local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    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 renderZoneBox()
    dxDrawRectangle(sx*270/1025sy*150/14769sx*500/1025sy*458/167tocolor(25425425432), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    --dxDrawLine(sx*0/1024sy*199/768sx*1022/1024sy*200/768tocolor(31111193255), 5false)
    --dxDrawLine(sx*0/1024sy*509/768sx*1022/1024sy*510/768tocolor(31111193255), 5false)
    --dxDrawText("Your Adventure RPG"sx*0/1024sy*157/768sx*1024/1024sy*237/768white2.00"pricedown""center""center"false)

    --if not isMouseIn(sx*10/1024sy*48/768sx*225/1024sy*92/768then dxDrawRectangle(sx*10/1024sy*48/768sx*225/1024sy*92/768tocolor(31222140170), false)
    --else dxDrawRectangle(sx*10/1024sy*48/768sx*225/1024sy*92/768tocolor(2201000100), falseend
    --if not isMouseIn(sx*10/1024sy*192/768sx*225/1024sy*92/768then dxDrawRectangle(sx*10/1024sy*192/768sx*225/1024sy*92/768tocolor(31222140170), false)
    --else dxDrawRectangle(sx*10/1024sy*192/768sx*225/1024sy*92/768tocolor(2201000100), falseend
    --if not isMouseIn(sx*10/1024sy*336/768sx*225/1024sy*92/768then dxDrawRectangle(sx*10/1024sy*336/768sx*225/1024sy*92/768tocolor(31222140170), false)
    --else dxDrawRectangle(sx*10/1024sy*336/768sx*225/1024sy*92/768tocolor(2201000100), falseend
    --if not isMouseIn(sx*10/1024sy*480/768sx*225/1024sy*92/768then dxDrawRectangle(sx*10/1024sy*480/768sx*225/1024sy*92/768tocolor(31222140170), false)
    --else dxDrawRectangle(sx*10/1024sy*480/768sx*225/1024sy*92/768tocolor(2201000100), falseend
    --if not isMouseIn(sx*10/1024sy*624/768sx*225/1024sy*92/768then dxDrawRectangle(sx*10/1024sy*624/768sx*225/1024sy*92/768tocolor(31222140170), false)
    --else dxDrawRectangle(sx*10/1024sy*624/768sx*225/1024sy*92/768tocolor(2201000100), falseend
 
   dxDrawText("Los Santos"screenW 0.3164screenH 0.-200screenW 0.6953screenH 0.4194tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("San Fierro"screenW 0.3164screenH 0.-110screenW 0.6953screenH 0.4903tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("Las Venturas"screenW 0.3164screenH 0.050screenW 0.6953screenH 0.4903tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("El Quebrados"screenW 0.3164screenH 0.25screenW 0.6953screenH 0.4903tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("Fort Carson"screenW 0.3164screenH 0.26screenW 0.6953screenH 0.7056tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("Baza organizacji"screenW 0.3164screenH 0.5625screenW 0.6953screenH 0.6347tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
   dxDrawText("Dom"screenW 0.3164screenH 0.7625screenW 0.6953screenH 0.6347tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)  
    --dxDrawImage(sx 0.3118sy 0.0313sx 0.3838sy 0.1549"logo.png"000tocolor(255255255255), false)
    dxDrawImage(sx 0.3118sy 0.1813sx 0.3838sy 0.1549"misc/text.png"000tocolor(255255255255), false)
    dxDrawImage(63853338773"misc/text2.png"AristatesYuvarlak00tocolor(255255255255), false)
    --dxDrawImage(0019201080"misc/drift.png"AristatesYuvarlak00tocolor(255255255255), false)

    local zone1=math.sin(intro_step/500)*9000
    local zone2=math.cos(intro_step/500)*9000
   -- setCameraMatrix (2019.561343.0314.00zone1zone22)
    --setCameraMatrix(zone1zone2120zone1zone2120)
    intro_step=intro_step-1.5

end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then--FC
        if isMouseIn(sx*10/1024sy*198/768sx*225/1024sy*92/-768) and data.showed then
         setElementData(localPlayer,"player:spawn",{1479.51, -1713.0714.05+0.1})
         closeZones()
        end
---- EL ----
        if isMouseIn(screenW 0.3164screenH 0.25screenW 0.6953screenH 0.4903) and data.showed then
         setElementData(localPlayer,"player:spawn",{-1521.04,2642.03,55.84+0.1})
         closeZones()
        end
---- LV ----
        if isMouseIn(screenW 0.3164screenH 0.050screenW 0.6953screenH 0.4903) and data.showed then
         setElementData(localPlayer,"player:spawn",{1881.96,2287.28,10.98+0.1})
         closeZones()
        end
---- LS ----
        if isMouseIn(screenW 0.3164screenH 0.-200screenW 0.6953screenH 0.4194) and data.showed then
         setElementData(localPlayer,"player:spawn",{1477.59,-1714.39,14.05+0.1})
         closeZones()
        end
---- SF ----
        if isMouseIn(screenW 0.3164screenH 0.-110screenW 0.6953screenH 0.4903) and data.showed then
         setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
         closeZones()
        end
---- FC ----
        if isMouseIn(screenW 0.3164screenH 0.26screenW 0.6953screenH 0.7056) and data.showed then
         setElementData(localPlayer,"player:spawn",{48.88,1207.18,18.94+0.1})
         closeZones()
        end
---- INNE ----
        if isMouseIn(screenW 0.3164screenH 0.7625screenW 0.6953screenH 0.6347) and data.showed then
        local domek=getElementData(localPlayer,"player:house")
        if not domek then
        setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
        outputChatBox("Nie posiadasz domku!")
        end
        closeZones()
        end
        if isMouseIn(screenW 0.3164screenH 0.5625screenW 0.6953screenH 0.6347) and data.showed then
        local org=getElementData(localPlayer,"player:organization:spawn")
        if not org then
        setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
        outputChatBox("Nie posiadasz organizacji/Lub nie posiada ona spawnu!")
        closeZones()
        else
        setTimer(outputChatBox,1500,1,"Pomy?lnie zrespi?e? si? w organizacji.")
        setElementData(localPlayer,"player:spawn",{tonumber(org[1]),tonumber(org[2]),tonumber(org[3])})
        closeZones()
        end
        end
    end
end)

function closeZones()
    showChat(true)
    showCursor(false)
    fadeCamera(false)
    setElementAlpha(localPlayer,255)
    stopSound(data.misc)
    showPlayerHudComponent("all",false)
    showPlayerHudComponent("radar",true)
    showPlayerHudComponent("crosshair",true)
    showPlayerHudComponent("weapon",false)
    showPlayerHudComponent("health",false)
    showPlayerHudComponent("breath",false)
    showPlayerHudComponent("ammo",true)
    data.showed=false
    destroyElement(blurShader)
    -- Usuwamy elementy
    triggerServerEvent("core:spawnPlayer"localPlayer)
    setTimer(triggerEvent2501"gui:start"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
    blur false
end

function showZones(misc)
    data.misc=misc
    data.showed=true
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender"rootrenderZoneBoxend


Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 14:52


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

A kordy respienia w funkcji "player:spawn" zmieni?e??

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 15:08


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"BarteQ03" napisał/a:

A kordy respienia w funkcji "player:spawn" zmieni?e??

Tak

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-21, 17:57


nanKy







Wiek: 22
Na forum: 3866 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

Gdy klikniesz spawn LS tepa ci? to LV poniewa? masz if mouse in na innych ?e tak powiem koordynatach ni? powinno czyli popatrz po screenW,H ?eby mia?y takie same warto?ci jak te Rectangle pod napisem

Postaw piwo autorowi tego posta
 

 
Tagi: wybór :: spawnu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku