Wysłany: 2016-12-23, 22:24
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
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" , 5 , 0 , 0 , 0 , 155 )
local cuboid = createColCuboid ( 1017.311 , - 325.75031 , 74.045311 , 47.5 , 42.25 , 2 )
local blip = createBlip ( 1038.05 ,- 323.72 , 74.05 , 30 )
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.74 , 0.33 , 0.25 , 0.50 , "KGP" , 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 , "" , 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 ) < 100 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 ( "**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 . 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 )
Wysłany: 2016-12-23, 22:28
ZZiomek
..::LUA::..
Wiek: 26 Na forum: 3867 dni Posty: 134
Nick w MP: NexBoy
Piwa : 5961
local marker = createMarker ( 1038.05 ,- 323.72 , 74.05 , "cylinder" , 5 , 0 , 0 , 0 , 155 )
local cuboid = createColCuboid ( 1017.311 , - 325.75031 , 74.045311 , 47.5 , 42.25 , 2 )
local blip = createBlip ( 1038.05 ,- 323.72 , 74.05 , 30 )
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.74 , 0.33 , 0.25 , 0.50 , "KGP" , 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 , "" , 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
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." , 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 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 ( "**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 . 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 )
Podpis
Dodaj na Steam: Kod: 1093365219
Discord: NoOne#3644
Wysłany: 2016-12-23, 23:44
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
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
Tagi: giełda
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: