Wysłany: 2015-11-29, 11:44
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Witam robie prace dorywcza i mam problem, jezeli wjade w marker to nic sie niedzieje
rozpocznijspedytor = createMarker ( 1121.35 ,- 1246.58 , 15.09 , "cylinder" , 3.0 , 0 , 255 , 255 , 255 )
addEvent ( "rozpocznijprace" , true )
function zresp ( player )
local auto = createVehicle ( 499 , 1106.56 ,- 1249.39 , 15.91 , 0.0 , 360.0 , 3.6 )
setElementData ( auto , "pojazd_wsiadaj" , true )
setElementData ( auto , "pojazd_paliwo" , 50 )
setElementData ( auto , "pojazd_opis" , "Praca dorywcza - Spedytor " )
setVehiclePlateText ( auto , "Spedytor" )
warpPedIntoVehicle ( player , auto , 0 )
outputChatBox ( "Praca dorywcza - Spedytor " , player , 0 , 200 , 0 )
end
addEventHandler ( "rozpocznijprace" , root , zresp )
addEventHandler ( "onMarkerHit" , rozpocznijspedytor ,function( player )
if isElementWithinMarker ( player , rozpocznijspedytor ) then
triggerClientEvent ( player , "pokazoknopracy" , root )
end
end )
local punkty = {
{ 321.15 ,- 1775.28 , 4.12 },
{ 862.37 ,- 1793.81 , 13.17 },
{ 1358.18 ,- 1753.69 , 12.67 },
{ 1848.02 ,- 1757.15 , 12.74 },
{ 2495.34 ,- 1753.75 , 12.79 },
{ 2757.16 ,- 1943.38 , 12.86 },
{ 2855.11 ,- 1341.69 , 10.37 },
}
function markery ( player )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "checkpoint" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end
addEventHandler ( "rozpocznijprace" , root , markery )
addEventHandler ( "onMarkerHit" , cel , getRootElement (),function( player )
setTimer (function()
setElementFrozen ( player )
destroyElement ( blip )
destroyElement ( cel )
givePlayerMoney ( player , money )
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "cylinder" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end , 5000 , 1 )
end )
function usun_pojazd ( player , seat )
if seat == 0 then
auto = getPedOccupiedVehicle ( player )
auto1 = getElementData ( auto , "pojazd_wsiadaj" )
if auto1 then
outputChatBox ( "Skonczyles prace " , player , 0 , 200 , 0 )
destroyElement ( auto )
destroyElement ( blip )
destroyElement ( cel )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
setTimer ( usun_pojazd , 4000 , 1 , "" )
local money = math . random ( 35 , 70 )
db: http://www.wrzucajtu.pl/w...29_11-44-25.png
nawet jezeli dam addEventHandler ( "onMarkerHit" , cel , getRootElement (),function( player ) bez getRootElement() to nic sie nie dzieje
Wysłany: 2015-11-29, 12:21
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
BlackTen , albo cel, albo root...
Wysłany: 2015-11-29, 12:37
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Pisalem.. usunelem root i nic ;
Wysłany: 2015-11-29, 12:42
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
addEventHandler ( "onMarkerHit" , getRootElement (),function( player )
if source ~= cel then return end
setTimer (function()
setElementFrozen ( player )
destroyElement ( blip )
destroyElement ( cel )
givePlayerMoney ( player , money )
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "cylinder" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end , 5000 , 1 )
end )
Wysłany: 2015-11-29, 12:58
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
mam takie cos
addEventHandler ( "onMarkerHit" , getRootElement (),function( player )
if source ~= cel then return end
setTimer (function()
setElementFrozen ( player )
destroyElement ( blip )
destroyElement ( cel )
givePlayerMoney ( player , money )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "cylinder" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end , 5000 , 1 )
end )
db: http://www.wrzucajtu.pl/w...29_12-57-54.png
Wysłany: 2015-11-29, 13:02
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
BlackTen ,
- to ma wi?cej argument?w ni? 1
givePlayerMoney - brak kwoty, zmienna money nie istnieje lub nie przechowuje warto?ci
Wysłany: 2015-11-29, 13:05
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
np jak dam setElementFrozen(player,true) i juz marker sie usunie to mam ciagle freeza
Wysłany: 2015-11-29, 13:07
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
BlackTen , to ustaw kolejny setTimer i tam daj odfreezowanie.
Wysłany: 2015-11-29, 13:08
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Mam takie cos, nie unfreezuje mnie ani nie respi nowych marker?w addEventHandler ( "onMarkerHit" , getRootElement (),function( player )
if source ~= cel then return end
local money = math . random ( 35 , 70 )
setTimer (function()
setElementFrozen ( player , true )
destroyElement ( blip )
destroyElement ( cel )
givePlayerMoney ( player , money )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "cylinder" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end , 5000 , 1 )
setElementFrozen ( player , false )
end ) DB BRAK
[ Dodano : 2015-11-29, 13:40 ]
addEventHandler ( "onMarkerHit" , getRootElement (),function( player )
if source ~= cel then return end
local money = math . random ( 35 , 70 )
setTimer (function()
setElementFrozen ( player , true )
destroyElement ( blip )
destroyElement ( cel )
givePlayerMoney ( player , money )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "cylinder" , 4.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( cel , 51 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end , 5000 , 1 )
setTimer (function()
setElementFrozen ( player , false )
end , 2000 , 0 )
end )
Freez juz dziala ale nie respi nowych marker?w
[ Dodano : 2015-11-29, 14:19 ]
To jak macie pomysly
Tagi: praca :: spedytor
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: