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

Wysłany: 2016-02-27, 16:00


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

Kiedy wjad? w maker niewy?wietlanie mi si? nic



Kod:

local marker=createMarker( 2336.41, -111.00, 25.45, "cylinder", 5, 0, 0, 0, 155)
local cuboid=createColCuboid( 2336.41, -111.00, 25.45, 33, 80, 5)
local blip=createBlip( 2336.41, -111.00, 25.45, 2)

local wstep=true
local podatek=200

local text=createElement("text")
setElementPosition(text, 2336.41, -111.00, 26.45)
setElementData(text,"name","Gie?‚da\nUstawianie ceny.")

local wm={}
wm.window=guiCreateWindow(0.74, 0.33, 0.25, 0.50, "Gielda", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.label=guiCreateLabel(0.06, 0.07, 0.89, 0.07, "Wpisz cen?™ kt??ra ma widnie?‡ na poje??dzie.", true, wm.window)
guiLabelSetHorizontalAlign(wm.label, "center", false)
guiLabelSetVerticalAlign(wm.label, "center")
wm.label2=guiCreateLabel(0.06, 0.21, 0.89, 0.07, "Po odj?™ciu podatku cena wyniesie: 0 PLN", true, wm.window)
guiLabelSetHorizontalAlign(wm.label2, "center", false)
guiLabelSetVerticalAlign(wm.label2, "center")
wm.edit=guiCreateEdit(0.06, 0.40, 0.91, 0.10, "", true, wm.window)
wm.submit2=guiCreateButton(0.06, 0.55, 0.90, 0.16, "Zgadzam si?™", true, wm.window)
wm.submit=guiCreateButton(0.06, 0.75, 0.90, 0.20, "Akceptuj", true, wm.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) < 850 then
outputChatBox("* Posiadasz zbyt uszkodzony pojazd, id?? go napraw.", 255, 0, 0)
return
end
showCursor(true,false)
guiSetVisible(wm.window, true)
guiSetVisible(wm.label2, false)
guiSetVisible(wm.submit2, false)
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.window, false)
end)

addEventHandler("onClientGUIClick", resourceRoot, function()
if not wstep then return end
local cena=tonumber(guiGetText(wm.edit))
if not cena or cena < 1 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.submit2, true)
guiSetVisible(wm.label2, true)
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("Pojazd: %s\nCena: %d PLN\nPrzebieg: %dkm\nSprzedaj?…cy: %s", getVehicleName(veh), tonumber(cena), getElementData(veh,"vehicle:mileage"), getPlayerName(localPlayer))
setElementData(veh,"vehicle:desc",desc)
guiSetVisible(wm.window, false)
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)


Ostatnio zmieniony przez P.Wiśnia 2016-02-27, 16:17, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-27, 20:14


mlodasnygo







Wiek: 16
Na forum: 3973 dni
Posty: 205

Piwa: 518

Respekt: 161,8
Respekt: 161,8Respekt: 161,8

Jakies DB3?

I zmie? na [.lua] [./lua] bez kropek

Pozdrawiam

Podpis
600 dni - 10 marca 2017
:piwo: 500 piw :piwo: - 10 marca 2017
Postaw piwo autorowi tego posta
 

 
Tagi: marker :: niedziała
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Marker niedziała 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