Wysłany: 2018-03-19, 23:35
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
Witam, posiadam GM PYS 3.0 i mam problem, poniewa? gdy uszkodzi si? pojazd podczas zdawania prawa jazdy to posta? zostaje w tym miejscu a chcia?bym ?eby cofa?o do miejsca zdawania
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
--[[ local marker2 = createMarker (- 2050.29 ,- 106.16 , 35.24 , "corona" , 2 , 170 , 200 , 0 )
addEventHandler ( "onMarkerHit" , marker2 , function( el , md )
setElementPosition ( el ,- 2044.69 ,- 94.57 , 35.17 )
end )--]]
-- local zone = createColCuboid (- 157.62562561035 , 1108.4052734375 , 18.613729476929 , 7 , 9.8 , 6.4 )
addEvent ( "license:do" , true )
addEventHandler ( "license:do" , resourceRoot , function( cost , selected )
if tonumber ( cost ) <= getPlayerMoney ( client ) then
takePlayerMoney ( client , cost )
end
local veh = nil
--if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("* Miejsce respu zaj?te, poczekaj a? kto? wyjedzie.",client) return end
if selected == "A" then veh = createVehicle ( 586 , - 1943.73 , 1001.21 , 35.18 , 356.3 , 0.1 , 270 )
elseif selected == "B" then veh = createVehicle ( 436 , - 1943.73 , 1001.21 , 35.18 , 356.1 , 0.1 , 270 )
elseif selected == "C" then veh = createVehicle ( 414 , - 1943.73 , 1001.21 , 35.18 , 360 , 0.4 , 270 )
elseif selected == "L" then veh = createVehicle ( 593 , - 1943.73 , 1001.21 , 35.18 , 360.0 , 179.0 ) end
if not veh then return end
if selected == "L" then
setElementData ( veh , "vehicle:desc" , "Egzamin Licencji Lotniczej\nKategoria " .. selected .. "\n! Prosz? zachowa? ostro?no?? !" )
else
setElementData ( veh , "vehicle:desc" , "Egzamin Prawa Jazdy\nKategoria " .. selected .. "\n! Prosz? zachowa? ostro?no?? !" )
end
setElementData ( veh , "vehicle:mileage" , 16442 )
setElementData ( veh , "vehicle:fuel" , 100 )
setElementData ( veh , "vehicle:lic" , true )
setElementDimension ( client , 0 )
setElementInterior ( client , 0 )
showPlayerHudComponent ( client , "radar" , true )
warpPedIntoVehicle ( client , veh )
triggerClientEvent ( client , "license:start" , resourceRoot , selected , veh )
-- outputChatBox ( "* " .. getPlayerName ( client ).. " rozpocz??(??a) egzamin prawa jazdy, kategoria: " .. selected .. "" , root , 255 , 0 , 0 )
end )
addEvent ( "license:vehdel" , true )
addEventHandler ( "license:vehdel" , resourceRoot , function( veh )
destroyElement ( veh )
end )
addEventHandler ( "onPlayerQuit" , root , function()
local veh = getPedOccupiedVehicle ( source )
if not veh then return end
if getVehicleController ( veh ) ~= source then return end
if not getElementData ( veh , "vehicle:lic" ) then return end
destroyElement ( veh )
end )
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
if not getElementData ( source , "vehicle:lic" ) then return end
destroyElement ( source )
outputChatBox ( "* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!" , kierowca , 255 , 0 , 0 )
triggerClientEvent ( kierowca , "license:finish" , resourceRoot , true )
end )
addEventHandler ( "onVehicleStartExit" , resourceRoot , function()
cancelEvent ()
end )
addCommandHandler ( "lotgp" , function( plr , cmd )
local x , y , z = getElementPosition ( plr )
local p = string . format ( "{%.02f, %.02f, %.02f}," , x , y , z )
outputChatBox ( p , plr )
end )
addCommandHandler ( "lotgp2" , function( plr , cmd )
local veh = getPedOccupiedVehicle ( plr )
if not veh then return end
local x , y , z = getElementPosition ( veh )
local rx , ry , rz = getElementRotation ( veh )
local p = string . format ( "%.02f, %.02f, %.02f, %.02f, %.02f, %.02f" , x , y , z , rx , ry , rz )
outputChatBox ( p , plr )
end )
Ostatnio zmieniony przez Atroth 2018-03-21, 22:41, w całości zmieniany 1 raz
Wysłany: 2018-03-20, 17:18
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Wysłany: 2018-03-20, 18:03
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
"Ciastuu?" napisał/a :
Dopisywalem ale nie wiem dokladnie gdzie to powinno sie znajdowac. Mog?by? to zrobi??
Wysłany: 2018-03-20, 18:38
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
W tym miejscu dodajesz powy?szy kod,
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
if not getElementData ( source , "vehicle:lic" ) then return end
destroyElement ( source )
outputChatBox ( "* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!" , kierowca , 255 , 0 , 0 )
triggerClientEvent ( kierowca , "license:finish" , resourceRoot , true )
end )
Wysłany: 2018-03-20, 19:12
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
Zrobi?em tak i nadal nie cofa
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
if not getElementData ( source , "vehicle:lic" ) then return end
destroyElement ( source )
outputChatBox ( "* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!" , kierowca , 255 , 0 , 0 )
triggerClientEvent ( kierowca , "license:finish" , resourceRoot , true )
setElementPosition ( source , - 1958.48 , 1045.23 , 55.72 )
end )
Wysłany: 2018-03-20, 21:35
TeeNekk
Cienzaruwka :v
Wiek: 23 Na forum: 3210 dni Posty: 264
Nick w MP: TeeNekk.
Piwa : 919
"readreis" napisał/a :Zrobi?em tak i nadal nie cofa
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
if not getElementData ( source , "vehicle:lic" ) then return end
destroyElement ( source )
outputChatBox ( "* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!" , kierowca , 255 , 0 , 0 )
triggerClientEvent ( kierowca , "license:finish" , resourceRoot , true )
setElementPosition ( source , - 1958.48 , 1045.23 , 55.72 )
end )
w tym przypadku el. source jest odpowiedzialny za pojazd. zamie? na: setElementPosition ( kierowca , - 1958.48 , 1045.23 , 55.72 )
Wysłany: 2018-03-20, 21:47
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
"TeeNekk" napisał/a : "readreis" napisał/a :Zrobi?em tak i nadal nie cofa
addEventHandler ( "onVehicleDamage" , resourceRoot , function( loss )
local kierowca = getVehicleController ( source )
if not kierowca then return end
if not getElementData ( source , "vehicle:lic" ) then return end
destroyElement ( source )
outputChatBox ( "* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!" , kierowca , 255 , 0 , 0 )
triggerClientEvent ( kierowca , "license:finish" , resourceRoot , true )
setElementPosition ( source , - 1958.48 , 1045.23 , 55.72 )
end )
w tym przypadku el. source jest odpowiedzialny za pojazd. zamie? na: setElementPosition ( kierowca , - 1958.48 , 1045.23 , 55.72 )
Te? nie dzia?a ;/
Wysłany: 2018-03-21, 19:52
TeeNekk
Cienzaruwka :v
Wiek: 23 Na forum: 3210 dni Posty: 264
Nick w MP: TeeNekk.
Piwa : 919
"readreis" napisał/a :
musi dzia?a?. Jaie? b??dy z /debugscript 3? i poka? jak to wklei?e?, bo mo?e pope?ni?e? b??d.
Wysłany: 2018-03-21, 19:53
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
teraz zmienilem troche kod i cofa mnie w wyznaczone miejsce wraz z autem ;/
Wysłany: 2018-03-21, 19:57
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
"readreis" napisał/a :teraz zmienilem troche kod i cofa mnie w wyznaczone miejsce wraz z autem ;/
Poka? ten kod
Więcej szczegółów
Wystawiono 1 piw(a):readreis
Wysłany: 2018-03-21, 19:58
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
addEvent ( "onVehicleDamage" , true )
addEventHandler ( "onVehicleDamage" , root , function()
setElementPosition ( source , - 2000.34 , 1045.16 , 55.57 )
setElementData ( source , "pj_p2" , false )
outputChatBox ( "** Obla?e?/a? egzamin na prawo jazdy! Pojazd uszkodzony!" , source )
toggleControl ( source , "enter_exit" , true )
end )
w db3 wyskakuje:
WARNIN:[pystories]/[skrypty]/pystories-offices/license/s_zdawanie.lua:70: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle]
Wysłany: 2018-03-21, 20:46
TeeNekk
Cienzaruwka :v
Wiek: 23 Na forum: 3210 dni Posty: 264
Nick w MP: TeeNekk.
Piwa : 919
"readreis" napisał/a : addEvent ( "onVehicleDamage" , true )
addEventHandler ( "onVehicleDamage" , root , function()
setElementPosition ( source , - 2000.34 , 1045.16 , 55.57 )
setElementData ( source , "pj_p2" , false )
outputChatBox ( "** Obla?e?/a? egzamin na prawo jazdy! Pojazd uszkodzony!" , source )
toggleControl ( source , "enter_exit" , true )
end )
w db3 wyskakuje:
WARNIN:[pystories]/[skrypty]/pystories-offices/license/s_zdawanie.lua:70: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle]
Przy evencie onVehicleDamage SOURCE odpowiada za pojazd! wi?c, nic dziwnego ?e cofa ci? wraz z pojazdem.
addEventHandler ( "onVehicleDamage" , root ,function()
if getElementData ( source , "vehicle:lic" ) then
local kierowca = getVehicleController ( source )
destroyElement ( source )
setElementPosition ( kierowca , - 2000.34 , 1045.16 , 55.57 )
outputChatBox ( "Obla?e?/a? egzamin" , kierowca , 255 , 0 , 0 )
end
end )
musi dzia?a?. Testowane.
Wysłany: 2018-03-21, 22:33
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
TeeNekk , nie rozumiem czemu u mnie to nie dziala z twoim kodem usuwa auto postac zostaje w tym samym miejscu a punkty z egzaminu nie znikaja ;/ poddaje sie
Wysłany: 2018-03-22, 19:47
TeeNekk
Cienzaruwka :v
Wiek: 23 Na forum: 3210 dni Posty: 264
Nick w MP: TeeNekk.
Piwa : 919
a usun??e? to? addEvent ( "onVehicleDamage" , true )
Podpis
Pomogłem Ci
[you]
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Wysłany: 2018-03-22, 22:02
readreis
Wiek: 37 Na forum: 3908 dni Posty: 62
Piwa : 4
TeeNekk , caly kod podmienilem na twoj
Tagi: pys :: 3.0 :: prawo :: jazdy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: