Wysłany: 2014-10-25, 00:27
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
Witam, mam pewien problem, zrobi?em sobie prac? gazety lecz nie dzia?a jak powinna ot?? buguje si? jak 2 gracze wykonuj? t? prac?....
function startGazeciarz ( plr )
if not ( getElementData ( plr , "gracz_xpraca" )) then
local rnd = math . random ( 1 , #Punkty)
marker = createMarker ( Punkty [ rnd ][ 1 ], Punkty [ rnd ][ 2 ], Punkty [ rnd ][ 3 ]- 0.96 , "cylinder" , 1 , 0 , 0 , 255 , 255 , plr )
blip = createBlip ( Punkty [ rnd ][ 1 ], Punkty [ rnd ][ 2 ], Punkty [ rnd ][ 3 ]- 0.96 , 41 , 2 , 255 , 0 , 0 , 255 , 0 , 3000 , plr )
if numer == 0 then
outputChatBox ( "** Zakazuje si? jechania do punkt?w pojazdem, tylko rowerami! **" , plr )
outputChatBox ( "* Rozpocz??e? prac?, dostarcz gazet? do miejsca na mapie!" , plr )
setElementData ( plr , "gracz_praca" , true )
end
addEventHandler ( "onMarkerHit" , marker , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if numer == 10 then
numer = 0
destroyElement ( blip )
destroyElement ( marker )
givePlayerMoney ( el , koszt )
setElementData ( el , "gracz_praca" , false )
outputChatBox ( "* Zako?czy?e? prac?, podsumuj?c otrzymujesz: " .. koszt .. " EUR i " .. koszt2 .. " GP" , el )
else
destroyElement ( blip )
destroyElement ( marker )
numer = numer + 1
startGazeciarz ( el )
end
end )
else
outputChatBox ( "* Ju? posiadasz aktywn? prac?!" , plr )
end
end
addEventHandler ( "onMarkerHit" , startMarker , startGazeciarz )
Wysłany: 2014-10-25, 09:44
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Dodaj odpowiedni warunek przy ka?dej funkcji
if element1 ~= element2 then return end
Wysłany: 2014-10-25, 12:56
maxerxxl
Wiek: 30 Na forum: 5067 dni Posty: 285
Nick w MP: MaXI
Piwa : 38
powinno to wygl?da? tak?
if el ~= source then return end
Wysłany: 2014-10-25, 13:18
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Metoda pr?b i b??d?w, pr?buj.
Tagi: praca :: gazety
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: