Wysłany: 2018-02-02, 11:13
chojnas
Serwerowspomagacz
Wiek: 23 Na forum: 3082 dni Posty: 126
Nick w MP: xChojnas
Piwa : 383
Witam, mam pewien problem ze skryptem, a mianowicie chcialem zrobic dwa markery na duty tunera, pierwszy dziala, lecz drugi juz nie. Nie pokazuje sie na serwerze, dodatkowo nie ma zadnych error?w w konsoli.
skrypt: --[[
Developed by Yolos
All rights reserved !
You cannot use this without permission !
--]]
local jobs ={
[ "Tuner-LS" ]={
code = "Tuner-LS" ,
desc = "-" ,
desc2 = "Praca Tunera" ,
positionMarker ={ 1781.55 ,- 1918.80 , 13.39 },
text = "* Nie jeste? zatrudniony(a) jako tuner w tym warsztacie." ,
cuboid ={ 1781.55 ,- 1918.80 , 13.39 , 30.5 },
maxEmployees = 1 ,
[ Swiatla LS ]={
code = "Tuner-SF" ,
desc = "-" ,
desc2 = "Praca Tunera" ,
positionMarker ={ 1804.00 ,- 1694.33 , 13.54 },
text = "* Nie jeste? zatrudniony(a) jako tuner w tym warsztacie." ,
cuboid ={ 1791.6979980469 , - 1688.6943359375 , 12.510934829712 , 1.6 , 0.80000000000002 , 10 },
maxEmployees = 1
},
}
for i , v in pairs ( jobs ) do
local marker = createMarker ( v . positionMarker [ 1 ], v . positionMarker [ 2 ], v . positionMarker [ 3 ]- 0.90 , "cylinder" , 1.2 , 78 , 255 , 0 , 155 )
setElementDimension ( marker , v . positionMarker [ 5 ] or 0 )
setElementInterior ( marker , v . positionMarker [ 4 ] or 0 )
setElementData ( marker , "m:duty" , v . code or 0 )
local cs = createColSphere ( v . cuboid [ 1 ], v . cuboid [ 2 ], v . cuboid [ 3 ], v . cuboid [ 4 ], v . cuboid [ 5 ], v . cuboid [ 6 ])
setElementData ( cs , "m:duty" , v . code )
addEventHandler ( "onColShapeLeave" , cs , function( el , md )
if getElementData ( el , "player:duty" ) == getElementData ( source , "m:duty" ) then
setElementData ( el , "player:duty" , false )
outputChatBox ( "Zako?czy?e?/a? prace." , el )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
end
end )
local t = createElement ( "text" )
setElementDimension ( t , v . positionMarker [ 5 ] or 0 )
setElementInterior ( t , v . positionMarker [ 4 ] or 0 )
setElementData ( t , "name" , v . desc .. "\n" .. v . desc2 )
setElementPosition ( t , v . positionMarker [ 1 ], v . positionMarker [ 2 ], v . positionMarker [ 3 ])
end
addEventHandler ( "onMarkerHit" , resourceRoot , function( el , md )
if getElementType ( el )~= "player" then return end
local duty = getElementData ( source , "m:duty" )
if not duty then return end
local uid = getElementData ( el , "player:uid" )
if not getPlayerJob ( el , duty ) then
outputChatBox ( jobs [ duty ]. text , el , 255 , 0 , 0 )
return
end
if not getElementData ( el , "player:duty" ) then
if jobs [ duty ]. getEmployees then
if getEmployees ( duty ) >= jobs [ duty ]. maxEmployees then
outputChatBox ( " W tej pracy pracuje ju? maksymalna ilo?? os?b (" .. jobs [ duty ]. maxEmployees .. ")" , el , 255 , 0 , 0 )
return
end
end
if jobs [ duty ]. weapon then giveWeapon ( el , jobs [ duty ]. weapon , 1000 ) end
setElementData ( el , "player:duty" , duty )
outputChatBox ( "Rozpocz??e?/a? prac?." , el )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_jobs SET actived=NOW() WHERE code=? and uid=?" , duty , uid )
else
if getElementData ( el , "player:duty" ) ~= getElementData ( source , "m:duty" ) then outputChatBox ( "* Id? i zwolnij si? u frakcji!" , el ) return end
if jobs [ duty ]. weapon then takeWeapon ( el , jobs [ duty ]. weapon ) end
setElementData ( el , "player:duty" , false )
outputChatBox ( "Zako?czy?e?/a? prace." , el )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
end
end )
createBlip ( 1781.55 ,- 1918.80 , 13.39 , 27 )
Tuner LS dziala, lecz Swiatla LS juz nie bardzo.;/ Pilnie prosze o pomoc.
Podpis
New experience incoming..
Wysłany: 2018-02-02, 11:22
LovingDead
Wiek: 29 Na forum: 4868 dni Posty: 34
Piwa : 3
Nie sprawdza?em ca?ego kodu, ale skoro piszesz, ?e pierwszy dzia?a a drugi nie, to szukaj problemu w tabeli.
Kod: Kod:
R??nica widoczna?
Wysłany: 2018-02-02, 11:38
chojnas
Serwerowspomagacz
Wiek: 23 Na forum: 3082 dni Posty: 126
Nick w MP: xChojnas
Piwa : 383
Ta dzieki
Podpis
New experience incoming..
Wysłany: 2018-02-02, 13:37
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
Zabrak?o znaku " na przysz?o??, zanim wstawisz kod na gtao przeanalizuj jeszcze raz skrypt i polecam komend? /debugscript 3 tam pokazuje jakie s? b??dy jakiego znaku nie ma itd.
Tagi: czemu :: marker :: quottuneraquot :: się :: nie :: pokazuje?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: