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

Wysłany: 2016-12-23, 22:24


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Mam problem bo chce aby gracze kt?rzy siedz? na g te? mogli Ustawia? cene


local marker=createMarker(1038.05,-323.72,74.05"cylinder"5000155)
local cuboid=createColCuboid(1017.311, -325.7503174.04531147.542.252)
local blip=createBlip(1038.05,-323.72,74.0530)

local wstep=false
local podatek=0

local text=createElement("text")
setElementPosition(text,166.59,-227.76,1.58)
setElementData(text,"name","KGP")

local wm={}
wm.window=guiCreateWindow(0.740.330.250.50"KGP"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.label=guiCreateLabel(0.060.070.890.07"Wpisz cen? kt?ra ma widnie? na poje?dzie."truewm.window)
guiLabelSetHorizontalAlign(wm.label"center"false)
guiLabelSetVerticalAlign(wm.label"center")
wm.label2=guiCreateLabel(0.060.210.890.07""truewm.window)
guiLabelSetHorizontalAlign(wm.label2"center"false)
guiLabelSetVerticalAlign(wm.label2"center"wm.edit=guiCreateEdit(0.060.400.910.10""truewm.window)
wm.submit2=guiCreateButton(0.060.550.900.16"Zgadzam si?"truewm.window)
wm.submit=guiCreateButton(0.060.750.900.20"Akceptuj"truewm.window)

addEventHandler("onClientMarkerHit"resourceRoot, function(el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end
    if getVehicleController(veh) ~= localPlayer then return end
    local spawn=getElementData(veh,"vehicle:id")
    if not spawn then return end
    if getElementHealth(veh) < 100 then
        outputChatBox("* Posiadasz zbyt uszkodzony pojazd, id? go napraw."25500)
        return
    end
    showCursor(true,false)
    guiSetVisible(wm.windowtrue)
    guiSetVisible(wm.label2false)
    guiSetVisible(wm.submit2false)
    guiSetInputMode("no_binds_when_editing")
end)

addEventHandler("onClientMarkerLeave"resourceRoot, function(el,md)
    if el~=localPlayer then return end
    if not wstep then return end
    showCursor(false)
    guiSetVisible(wm.windowfalse)
end)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if not wstep then return end
    local cena=tonumber(guiGetText(wm.edit))
    if not cena or cena or cena ~= math.floor(cena) or cena 999999 then
        outputChatBox("* Podano nieprawid?ow? cen?.")
        return
    end
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end
    if getVehicleController(veh) ~= localPlayer then return end
    if not getElementData(veh,"vehicle:id"then return end
    if source == wm.submit then
        --podatek=math.floor(cena/2)
        guiSetVisible(wm.submit2true)
        guiSetVisible(wm.label2true)
        guiSetText(wm.label2"Akceptujesz podan? cen?? "..cena.." PLN")
    end
    if source == wm.submit2 then
        local online=getPlayerFromName(getPlayerName(localPlayer))
        if online then jest="Dost?pny" else jest="Niedost?pny" end
        local desc=string.format("**KGP**\nPojazd: %s\nCena: %d PLN\nPrzebieg Pojazdu:%dkm\nPolicja/Stra? Miejska: %s"getVehicleName(veh), tonumber(cena), getElementData(veh,"vehicle:mileage"), getPlayerName(localPlayer))
        setElementData(veh,"vehicle:desc",desc)
        guiSetVisible(wm.windowfalse)
        showCursor(false)
    end
end)

addEventHandler("onClientColShapeHit"cuboid, function(el,md)
    if not md or el ~= localPlayer then return end
    if wstep then return end
    wstep=true
end)

addEventHandler("onClientColShapeLeave"cuboid, function(el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(el)
    if not veh then return end
    setElementData(veh,"vehicle:desc",false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 22:28


ZZiomek

..::LUA::..






Wiek: 26
Na forum: 3867 dni
Posty: 134
Nick w MP: NexBoy

Piwa: 5961

Respekt: 155,3
Respekt: 155,3Respekt: 155,3


local marker=createMarker(1038.05,-323.72,74.05"cylinder"5000155)
local cuboid=createColCuboid(1017.311, -325.7503174.04531147.542.252)
local blip=createBlip(1038.05,-323.72,74.0530)

local wstep=false
local podatek=0

local text=createElement("text")
setElementPosition(text,166.59,-227.76,1.58)
setElementData(text,"name","KGP")

local wm={}
wm.window=guiCreateWindow(0.740.330.250.50"KGP"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.label=guiCreateLabel(0.060.070.890.07"Wpisz cen? kt?ra ma widnie? na poje?dzie."truewm.window)
guiLabelSetHorizontalAlign(wm.label"center"false)
guiLabelSetVerticalAlign(wm.label"center")
wm.label2=guiCreateLabel(0.060.210.890.07""truewm.window)
guiLabelSetHorizontalAlign(wm.label2"center"false)
guiLabelSetVerticalAlign(wm.label2"center"wm.edit=guiCreateEdit(0.060.400.910.10""truewm.window)
wm.submit2=guiCreateButton(0.060.550.900.16"Zgadzam si?"truewm.window)
wm.submit=guiCreateButton(0.060.750.900.20"Akceptuj"truewm.window)

addEventHandler("onClientMarkerHit"resourceRoot, function(el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end
    local spawn=getElementData(veh,"vehicle:id")
    if not spawn then return end
    if getElementHealth(veh) < 100 then
        outputChatBox("* Posiadasz zbyt uszkodzony pojazd, id? go napraw."25500)
        return
    end
    showCursor(true,false)
    guiSetVisible(wm.windowtrue)
    guiSetVisible(wm.label2false)
    guiSetVisible(wm.submit2false)
    guiSetInputMode("no_binds_when_editing")
end)

addEventHandler("onClientMarkerLeave"resourceRoot, function(el,md)
    if el~=localPlayer then return end
    if not wstep then return end
    showCursor(false)
    guiSetVisible(wm.windowfalse)
end)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if not wstep then return end
    local cena=tonumber(guiGetText(wm.edit))
    if not cena or cena or cena ~= math.floor(cena) or cena 999999 then
        outputChatBox("* Podano nieprawid?ow? cen?.")
        return
    end
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end
    if not getElementData(veh,"vehicle:id"then return end
    if source == wm.submit then
        --podatek=math.floor(cena/2)
        guiSetVisible(wm.submit2true)
        guiSetVisible(wm.label2true)
        guiSetText(wm.label2"Akceptujesz podan? cen?? "..cena.." PLN")
    end
    if source == wm.submit2 then
        local online=getPlayerFromName(getPlayerName(localPlayer))
        if online then jest="Dost?pny" else jest="Niedost?pny" end
        local desc=string.format("**KGP**\nPojazd: %s\nCena: %d PLN\nPrzebieg Pojazdu:%dkm\nPolicja/Stra? Miejska: %s"getVehicleName(veh), tonumber(cena), getElementData(veh,"vehicle:mileage"), getPlayerName(localPlayer))
        setElementData(veh,"vehicle:desc",desc)
        guiSetVisible(wm.windowfalse)
        showCursor(false)
    end
end)

addEventHandler("onClientColShapeHit"cuboid, function(el,md)
    if not md or el ~= localPlayer then return end
    if wstep then return end
    wstep=true
end)

addEventHandler("onClientColShapeLeave"cuboid, function(el,md)
    if not md or el ~= localPlayer then return end
    if not wstep then return end
    local veh=getPedOccupiedVehicle(el)
    if not veh then return end
    setElementData(veh,"vehicle:desc",false)
end)


Podpis

Dodaj na Steam: Kod: 1093365219
Discord: NoOne#3644

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 23:44


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Znik?o i nic nie dza?a

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Tagi: giełda
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