Wysłany: 2018-04-02, 12:51
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
Witam jak zrobic montaz automatyczny mk i gz paczka pys3.0 i jak wgrac to mam .
Wysłany: 2018-04-02, 15:56
NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
Trzymaj chyba o to Ci chodzi?o.
Musisz ustawic sobie GUI.
Server Side:
MK1 = 450000 -- Kwota za tuning cz ?? ci PLN
MK2 = 450000
MK3 = 450000
Marker = createMarker (- 2529.21 ,- 9.30 , 25.62 - 3 , "cylinder" , 3.15 , 25 , 213 , 15 , 140 )
function TuningMarker ( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if not getPedOccupiedVehicle ( el ) then
outputChatBox ( "Wejd? do pojazdu!" , el , 255 , 255 , 255 )
return
end
triggerClientEvent ( el , "PokazGUI" , resourceRoot )
end
addEventHandler ( "onMarkerHit" , Marker , TuningMarker )
addEventHandler ( "onMarkerLeave" , Marker , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
end )
addEvent ( "DMK1" , true )
addEventHandler ( "DMK1" , root , function()
if getPlayerMoney ( source ) < MK1 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 255 , 255 )
return
end
takePlayerMoney ( source , MK1 )
local vehicle = getPedOccupiedVehicle ( source )
local id = getElementData ( vehicle , "vehicle:id" )
if not id then return end
local qr = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND mk1=?" , getElementData ( vehicle , "vehicle:id" ), "1" )
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255, true) return end
destroyElement ( vehicle )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk1=1 WHERE id=?" , id )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "MONTAZ MK1" , id )
outputChatBox ( "Zamontowa?e? MK1!" , source , 255 , 255 , 255 , true )
end )
addEvent ( "DMK2" , true )
addEventHandler ( "DMK2" , root , function()
if getPlayerMoney ( source ) < MK2 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 255 , 255 )
return
end
takePlayerMoney ( source , MK2 )
local vehicle = getPedOccupiedVehicle ( source )
local id = getElementData ( vehicle , "vehicle:id" )
if not id then return end
local qr = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND mk2=?" , getElementData ( vehicle , "vehicle:id" ), "1" )
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255, true) return end
destroyElement ( vehicle )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?" , id )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "MONTAZ MK2" , id )
outputChatBox ( "Zamontowa?e? MK2!" , source , 255 , 255 , 255 , true )
end )
addEvent ( "DMK3" , true )
addEventHandler ( "DMK3" , root , function()
if getPlayerMoney ( source ) < MK3 then
outputChatBox ( "Nie posiadasz tyle pieni?dzy!" , source , 255 , 255 , 255 )
return
end
takePlayerMoney ( source , MK3 )
local vehicle = getPedOccupiedVehicle ( source )
local id = getElementData ( vehicle , "vehicle:id" )
if not id then return end
local qr = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND mk3=?" , getElementData ( vehicle , "vehicle:id" ), "1" )
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255, true) return end
destroyElement ( vehicle )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk3=1 WHERE id=?" , id )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "MONTAZ MK3" , id )
outputChatBox ( "Zamontowa?e? MK3!" , source , 255 , 255 , 255 , true )
end )
Client Side:
local screenW , screenH = guiGetScreenSize ()
panel = false
function PanelGUI ()
DX USTAW SOBIE TU :)
end
addEvent ( "PokazGUI" , true )
addEventHandler ( "PokazGUI" , resourceRoot , function()
local pojazd = getPedOccupiedVehicle ( localPlayer )
if getVehicleController ( pojazd ) ~= localPlayer then return end
if panel == false then
addEventHandler ( "onClientRender" , root , PanelGUI )
tick = getTickCount ()
panel = true
showCursor ( true )
end
end )
function ZamknijOkno ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( SCREENW , SREENH , SCREENW , SCREENH -DO USTAWIENIA ) then
removeEventHandler ( "onClientRender" , root , PanelGUI )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), ZamknijOkno )
function MontazMK ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( SCREENW , SREENH , SCREENW , SCREENH -DO USTAWIENIA ) then
triggerServerEvent ( "DMK1" , localPlayer )
end
if panel and button == "left" and state == "down" then
if cursorPosition ( SCREENW , SREENH , SCREENW , SCREENH -DO USTAWIENIA ) then
triggerServerEvent ( "DMK2" , localPlayer )
end
if panel and button == "left" and state == "down" then
if cursorPosition ( SCREENW , SREENH , SCREENW , SCREENH -DO USTAWIENIA ) then
triggerServerEvent ( "DMK3" , localPlayer )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), MontazMK )
function cursorPosition ( x , y , w , h )
if ( not isCursorShowing ()) then
return false
end
local mx , my = getCursorPosition ()
local fullx , fully = guiGetScreenSize ()
cursorx , cursory = mx * fullx , my * fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Wysłany: 2018-04-02, 16:35
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
NoKill1997 , a w skryptach mam to nazwac server.lua czy jak ?
powiedz gdzie mam to wkleic daj mi mete itp
Wysłany: 2018-04-02, 17:10
NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
"dawidmajka" napisał/a :NoKill1997 , a w skryptach mam to nazwac server.lua czy jak ?
powiedz gdzie mam to wkleic daj mi mete itp
Meta:
< meta >
< script src = "Client.lua" type = "client" />
< script src = "Server.lua" type = "server" />
</ meta >
Aby skrypt poprawnie dzialal musisz ustawic GUI!
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Wysłany: 2018-04-02, 17:33
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
NoKill1997 , powiec 3 pliki ja kmam je nazwac meta i co dalej
Wysłany: 2018-04-02, 18:11
NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
"dawidmajka" napisał/a :NoKill1997 , powiec 3 pliki ja kmam je nazwac meta i co dalej
jeden nazywasz client.lua, do ktorego dajesz zawartosc client side drugi nazywasz Server.lua do ktorego dajesz zawartosc Server Side, a trzeci dodajesz meta.xml do ktorego dajesz zawartosc mety.
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Wysłany: 2018-04-02, 18:30
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
NoKill1997 , zrobilem tak dziala skrypt tylko problem bo jak wbijam w punkt autem to nic sie nie wyswietla
Wysłany: 2018-04-02, 19:37
NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
"dawidmajka" napisał/a :NoKill1997 , zrobilem tak dziala skrypt tylko problem bo jak wbijam w punkt autem to nic sie nie wyswietla
Pisalem Ci iz musisz wykonac GUI pod zasob.
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Wysłany: 2018-04-02, 20:37
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
NoKill1997 , ostatnie pytanie jak zrobic te gui pod zas?b
Wysłany: 2018-04-02, 21:01
NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
"dawidmajka" napisał/a :NoKill1997 , ostatnie pytanie jak zrobic te gui pod zas?b
Guiedytor.. Jezeli chcesz wiecej inforamcji na temat GUI podam Ci konakt do mnie na PW, to Ci wytlumacze na jakims komunikatorze glosowym.
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Wysłany: 2018-04-03, 10:20
dawidmajka
tfuj stary
Wiek: 22 Na forum: 3612 dni Posty: 137
Nick w MP: kutas
Piwa : 13
NoKill1997 , Discorda ci podac czy podasz mi discorda lub skype?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: