Wysłany: 2019-04-23, 21:50
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ?t?? chcia?bym co? takiego mamy gui silnik?w do kupna wszystko git, lecz chcia?bym tak, ?e jak gracz ma zamontowany silnika 1.6 to nie mo?e zamontowa? od razu 2.0,2.2.tylko 1.8
kod
c.lua
local pyrek = dxCreateFont ( "pyrek.ttf" , 30 )
GUIEditor = {
button = {},
window = {}
}
GUIEditor . window [ 1 ] = guiCreateWindow ( 803 , 127 , 412 , 530 , "MONTAZ LICZNIKOW" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
-- GUIEditor . button [ 1 ] = guiCreateButton ( 14 , 23 , 388 , 24 , "Limonkowy" , false , GUIEditor . window [ 1 ])
-- guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FF70FD4A" )
GUIEditor . button [ 2 ] = guiCreateButton ( 14 , 61 , 388 , 24 , "1.6\n1.500.000" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 2 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FFFBE44B" )
GUIEditor . button [ 3 ] = guiCreateButton ( 14 , 95 , 388 , 24 , "1.8\n1.000.000" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 3 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 3 ], "NormalTextColour" , "FFD50000" )
--[[ addEventHandler ( "onClientRender" , root ,
function()
dxDrawText ( "KOLORY" , 456 , 332 , 919 , 384 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "bankgothic" , "center" , "center" , false , false , true , false , false )
dxDrawLine (( screenW - 609 ) / 2 , ( screenH - 0 ) / 2 , (( screenW - 609 ) / 2 ) + 609 , ( ( screenH - 0 ) / 2 ) + 0 , tocolor ( 255 , 255 , 255 , 255 ), 1 , true )
dxDrawLine ( 379 , 337 , 988 , 337 , tocolor ( 255 , 255 , 255 , 255 ), 1 , true )
dxDrawText ( "Witaj Graczu!\n\nWitaj w panelu montowania pod?wietlenia liczniku!\nAby zakupi? pod?wietlenie kliknij w przycisk\n poni?ej z interesuj?cym ci? kolorem" , 393 , 23 , 978 , 322 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "clear" , "center" , "center" , false , false , true , false , false )
end
)
--]]
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
)
marker = createMarker (- 1715.96 , 749.77 , 24.24 - 0.4555 , 'cylinder' , p16555 , 255 , 80 , 0 )
function hit ( plr , md )
if plr ~= localPlayer then return end
if not isPedInVehicle ( localPlayer ) then return end
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , hit )
function p16 ()
if source ~= GUIEditor . button [ 2 ] then return end
triggerServerEvent ( "p16" , localPlayer )
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , root , p16 )
function p18 ()
if source ~= GUIEditor . button [ 3 ] then return end
triggerServerEvent ( "p18" , localPlayer )
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , root , p18 )
function zamknij ()
if source ~= GUIEditor . button [ 15 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
addEventHandler ( "onClientGUIClick" , root , zamknij )
function zamykamy ()
if source ~= GUIEditor . button [ 15 ] then return end
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , root , zamykamy )
s.lua
--[[
@ author Mikael < mikael . mta @ wp . pl >
Skrypt wykonany dla New World 2016
]]
-- createBlip ( 1667.46 , 1742.19 , 10.51 , 27 , 0 , 0 , 0 , 255 )
p16 = 1
p18 = 1
-- local licz = {}
-- local t = createElement ( 'text' )
-- setElementData ( t , 'name' , 'Automatyczny monta? Licznikow.' )
-- setElementPosition ( t , 107.38 , 1048.21 , 13.46 )
addEvent ( "p16" , true )
addEventHandler ( "p16" , root , function()
if getPlayerMoney ( source ) < p16 then
outputChatBox ( "✘ Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p16 )
local vehicle = getPedOccupiedVehicle ( source )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.6cm3" )
outputChatBox ( "✔ Zwiekszyles pojemnosc do 1.6dm3 !" , source , 255 , 255 , 255 )
end )
addEvent ( "p18" , true )
addEventHandler ( "p18" , root , function()
if getPlayerMoney ( source ) < p18 then
outputChatBox ( "✘ Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p18 )
local vehicle = getPedOccupiedVehicle ( source )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.8cm3" )
outputChatBox ( "✔ Zwieszkyles pojemnosc do 1.8" , source , 255 , 255 , 255 )
end )
Wysłany: 2019-04-23, 21:54
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
Pyrek24 , Pobierz aktualny silnik w poje?dzie
i p??niej ustaw w kodzie t? elementdat?, ?e je?eli pojazd ma silnik 1.6 to nie mo?e kupi? 2.0 tylko musi mie? 1.8 ?eby to zrobi?.
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Wysłany: 2019-04-23, 23:20
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Kod: if getElementData(vehicle, "Pojemnosc:silnika", "1.6cm3") or getElementData(vehicle, "Pojemnosc:silnika", "1.8cm3")
Co dalej?
Wysłany: 2019-04-24, 00:18
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3208 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
Pyrek24 , Do kupowania pojemno?ci np. 1.8, ustaw elementdate, ?e pojemno?? nie mo?e by? ~= "1.6" a je?li b?dzie inna to return end.
Wysłany: 2019-04-24, 12:44
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Zrobi?em co? takiego, ale chyba jest ?le pom?g?by? ?
if getElementData ( vehicle , "Pojemnosc:silnika" , "1.4cm3" ) then return end
if not getElementData ( vehicle , "Pojemnosc:silnika" , "1.8cm3" ) then
outputChatBox ( "Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6" )
Więcej szczegółów
Wystawiono 1 piw(a):skribolek
Wysłany: 2019-04-24, 13:29
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Wystarczy co? takiego:
if ( getElementData ( vehicle , "Pojemnosc:silnika" ) ~= "1.6cm3" ) then
outputChatBox ( "Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6" )
end
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Wysłany: 2019-04-24, 13:57
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Wilq dzi?ki, lecz nie mog? tego dopasowa? do kodu, poniewa? jak to dopasowa?em to wyskakuje na czacie notka ze zamontowa?em silnik i ze nie mog? zamontowa? silnika.
Wysłany: 2019-04-24, 14:41
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Poka? ca?y kod po zmianach, kt?re wprowadzi?e?.
Ostatnio zmieniony przez Wilq 2019-04-24, 17:12, w całości zmieniany 1 raz
Wysłany: 2019-04-24, 17:09
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Prosze.
p16 = 999999
p18 = 1499999
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Automatyczny monta? Licznikow.' )
setElementPosition ( t , 107.38 , 1048.21 , 13.46 )
addEvent ( "p16" , true )
addEventHandler ( "p16" , root , function()
if getPlayerMoney ( source ) < p16 then
outputChatBox ( "✘ Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p16 )
local vehicle = getPedOccupiedVehicle ( source )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.6cm3" )
outputChatBox ( "✔ Zwiekszyles pojemnosc do 1.6dm3 !" , source , 255 , 255 , 255 )
end )
addEvent ( "p18" , true )
addEventHandler ( "p18" , root , function()
if getPlayerMoney ( source ) < p18 then
outputChatBox ( "✘ Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p18 )
local vehicle = getPedOccupiedVehicle ( source )
if ( getElementData ( vehicle , "Pojemnosc:silnika" ) ~= "1.8cm3" ) then
outputChatBox ( "Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6" )
outputChatBox ( "✔ Zwieszkyles pojemnosc do 18" , source , 255 , 255 , 255 )
end
[/code][/quote]
Wysłany: 2019-04-24, 17:14
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Zobacz teraz:
p16 = 999999
p18 = 1499999
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Automatyczny monta? Licznikow.' )
setElementPosition ( t , 107.38 , 1048.21 , 13.46 )
addEvent ( "p16" , true )
addEventHandler ( "p16" , root , function()
if getPlayerMoney ( source ) < p16 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p16 )
local vehicle = getPedOccupiedVehicle ( source )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.6cm3" )
outputChatBox ( "Zwiekszyles pojemnosc do 1.6dm3 !" , source , 255 , 255 , 255 )
end )
addEvent ( "p18" , true )
addEventHandler ( "p18" , root , function()
if getPlayerMoney ( source ) < p18 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
local vehicle = getPedOccupiedVehicle ( source )
if ( getElementData ( vehicle , "Pojemnosc:silnika" ) ~= "1.6cm3" ) then
outputChatBox ( "Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6" )
end
takePlayerMoney ( source , p18 )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.8cm3" )
outputChatBox ( "Zwieszkyles pojemnosc do 18" , source , 255 , 255 , 255 )
end )
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Wysłany: 2019-04-24, 18:02
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Mordko wyskakuje ta notka, ale montuje 1.8, a nie powinno
Kod: Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6
Wysłany: 2019-04-24, 18:09
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
p16 = 999999
p18 = 1499999
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Automatyczny monta? Licznikow.' )
setElementPosition ( t , 107.38 , 1048.21 , 13.46 )
addEvent ( "p16" , true )
addEventHandler ( "p16" , root , function()
if getPlayerMoney ( source ) < p16 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
takePlayerMoney ( source , p16 )
local vehicle = getPedOccupiedVehicle ( source )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.6cm3" )
outputChatBox ( "Zwiekszyles pojemnosc do 1.6dm3 !" , source , 255 , 255 , 255 )
end )
addEvent ( "p18" , true )
addEventHandler ( "p18" , root , function()
if getPlayerMoney ( source ) < p18 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 0 , 0 )
return
end
local vehicle = getPedOccupiedVehicle ( source )
if ( getElementData ( vehicle , "Pojemnosc:silnika" ) ~= "1.6cm3" ) then
outputChatBox ( "Nie mo?esz zamontowa? silnika 1.8 poniewa? nie zamonotwa?e? 1.6" )
return
end
takePlayerMoney ( source , p18 )
setElementData ( vehicle , "Pojemnosc:silnika" , "1.8cm3" )
outputChatBox ( "Zwieszkyles pojemnosc do 18" , source , 255 , 255 , 255 )
end )
Zapomnia?em doda? 'return'.
Wysłany: 2019-04-24, 19:37
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Dzi?ki ! Temat do zamkni?cia.
Tagi: kupowanie :: upgradów
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: