Wysłany: 2015-12-06, 15:48
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Pomocy robie prace kosiarek i mam blad bo kazdemu respi sie marker jak ktos prace rozpocznie !
local rozpocznijkosiarki = createMarker ( 239.86 , 1033.41 , 24.28 , "cylinder" , 2.0 , 0 , 255 , 0 , 255 )
punkty = {
{ 262.12969970703 , 1050.2818603516 , 21.993144989014 },
{ 264.08456420898 , 1073.9671630859 , 17.064970016479 },
{ 278.78396606445 , 1072.0758056641 , 17.635766983032 },
{ 277.53994750977 , 1048.6411132813 , 22.602624893188 },
{ 262.08264160156 , 1040.5043945313 , 24.127019882202 },
{ 244.19674682617 , 1061.0831298828 , 18.712356567383 },
{ 247.59407043457 , 1085.6677246094 , 14.979658126831 },
{ 271.54467773438 , 1091.4221191406 , 13.475341796875 },
{ 261.13067626953 , 1077.4204101563 , 16.51665687561 },
}
function celresp ( 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 , 41 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
function wjechal ( player )
local money = math . random ( 5 , 15 )
destroyElement ( cel )
destroyElement ( blip )
givePlayerMoney ( player , money )
celresp ()
end
addEventHandler ( "onMarkerHit" , cel , wjechal )
end
addEventHandler ( "onMarkerHit" , rozpocznijkosiarki ,function( player )
local kosiarka = createVehicle ( 572 , 240.46 , 1038.46 , 23.85 , 346.9 , 356.7 , 356.0 )
setElementData ( kosiarka , "pojazd_wyjdz" , true )
setElementData ( kosiarka , "pojazd_paliwo" , math . random ( 20 , 50 ))
setElementData ( kosiarka , "pojazd_opis" , "Praca Dorywcza\nKoszenie Trawnikow" )
warpPedIntoVehicle ( player , kosiarka )
celresp ()
end )
function usun_pojazd ( player , seat )
if seat == 0 then
kosiarka = getPedOccupiedVehicle ( player )
kosiarka1 = getElementData ( kosiarka , "pojazd_wyjdz" )
if kosiarka1 then
outputChatBox ( "Skonczyles prace " , player , 0 , 200 , 0 )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
setTimer ( usun_pojazd , 1200 , 1 , "" )
function koniec ( player , seat )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
end
addEventHandler ( "onPlayerQuit" , getRootElement (), koniec )
Wysłany: 2015-12-06, 15:56
serek123
Lua, MySql, Sql
Wiek: 27 Na forum: 4334 dni Posty: 217
Nick w MP: Serek.
Piwa : 374
zamiast player spr?buj da? source
Wysłany: 2015-12-06, 16:25
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Wysłany: 2015-12-06, 16:38
Gpla
Loading...
Wiek: 26 Na forum: 3853 dni Posty: 84
Nick w MP: Loading...
Piwa : 174
zmie? player na localplayer
Wysłany: 2015-12-06, 16:47
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Wysłany: 2015-12-06, 17:17
Jeey
Lua, Grafik
Wiek: 27 Na forum: 4339 dni Posty: 98
Nick w MP: Jeey
Piwa : 383
po jakiej to stronie da?e??
[ Dodano : 2015-12-06, 17:18 ]
i dodaj if el ~= localPlayer then return end
Wysłany: 2015-12-06, 17:28
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
server
[ Dodano : 2015-12-06, 17:39 ]
nie dziala
Wysłany: 2015-12-06, 19:27
DamianGames
Wiek: 23 Na forum: 3946 dni Posty: 75
Piwa : 521
local rozpocznijkosiarki = createMarker ( 239.86 , 1033.41 , 24.28 , "cylinder" , 2.0 , 0 , 255 , 0 , 255 )
punkty = {
{ 262.12969970703 , 1050.2818603516 , 21.993144989014 },
{ 264.08456420898 , 1073.9671630859 , 17.064970016479 },
{ 278.78396606445 , 1072.0758056641 , 17.635766983032 },
{ 277.53994750977 , 1048.6411132813 , 22.602624893188 },
{ 262.08264160156 , 1040.5043945313 , 24.127019882202 },
{ 244.19674682617 , 1061.0831298828 , 18.712356567383 },
{ 247.59407043457 , 1085.6677246094 , 14.979658126831 },
{ 271.54467773438 , 1091.4221191406 , 13.475341796875 },
{ 261.13067626953 , 1077.4204101563 , 16.51665687561 },
}
function celresp ( player )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "checkpoint" , 4.0 , 123 , 225 , 56 , 150 , thePlayer )
blip = createBlipAttachedTo ( cel , 41 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , thePlayer )
function wjechal ( thePlayer )
local money = math . random ( 5 , 15 )
destroyElement ( cel )
destroyElement ( blip )
givePlayerMoney ( thePlayer , money )
celresp ()
end
addEventHandler ( "onMarkerHit" , cel , wjechal )
end
addEventHandler ( "onMarkerHit" , rozpocznijkosiarki ,function( player )
local kosiarka = createVehicle ( 572 , 240.46 , 1038.46 , 23.85 , 346.9 , 356.7 , 356.0 )
setElementData ( kosiarka , "pojazd_wyjdz" , true )
setElementData ( kosiarka , "pojazd_paliwo" , math . random ( 20 , 50 ))
setElementData ( kosiarka , "pojazd_opis" , "Praca DorywczanKoszenie Trawnikow" )
warpPedIntoVehicle ( player , kosiarka )
celresp ()
end )
function usun_pojazd ( thePlayer , seat )
if seat == 0 then
kosiarka = getPedOccupiedVehicle ( thePlayer )
kosiarka1 = getElementData ( kosiarka , "pojazd_wyjdz" )
if kosiarka1 then
outputChatBox ( "Skonczyles prace " , thePlayer , 0 , 200 , 0 )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
setTimer ( usun_pojazd , 1200 , 1 )
function koniec ( thePlayer , seat )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
end
addEventHandler ( "onPlayerQuit" , getRootElement (), koniec )
Zobacz teraz ;D
Wysłany: 2015-12-06, 19:39
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
local rozpocznijkosiarki = createMarker ( 239.86 , 1033.41 , 24.28 , "cylinder" , 2.0 , 0 , 255 , 0 , 255 )
punkty = {
{ 262.12969970703 , 1050.2818603516 , 21.993144989014 },
{ 264.08456420898 , 1073.9671630859 , 17.064970016479 },
{ 278.78396606445 , 1072.0758056641 , 17.635766983032 },
{ 277.53994750977 , 1048.6411132813 , 22.602624893188 },
{ 262.08264160156 , 1040.5043945313 , 24.127019882202 },
{ 244.19674682617 , 1061.0831298828 , 18.712356567383 },
{ 247.59407043457 , 1085.6677246094 , 14.979658126831 },
{ 271.54467773438 , 1091.4221191406 , 13.475341796875 },
{ 261.13067626953 , 1077.4204101563 , 16.51665687561 },
}
function celresp ( thePlayer )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "checkpoint" , 1 , 123 , 225 , 56 , 150 , thePlayer )
blip = createBlipAttachedTo ( cel , 41 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , thePlayer )
function wjechal ( thePlayer )
local money = math . random ( 5 , 8 )
destroyElement ( cel )
destroyElement ( blip )
givePlayerMoney ( thePlayer , money )
celresp ( thePlayer )
end
addEventHandler ( "onMarkerHit" , cel , wjechal )
end
addEventHandler ( "onMarkerHit" , rozpocznijkosiarki ,function( thePlayer )
local kosiarka = createVehicle ( 572 , 240.46 , 1038.46 , 23.85 , 346.9 , 356.7 , 356.0 )
setElementData ( kosiarka , "pojazd_wyjdz" , true )
setElementData ( kosiarka , "pojazd_paliwo" , math . random ( 20 , 50 ))
setElementData ( kosiarka , "pojazd_opis" , "Praca Dorywcza\nKoszenie Trawnikow" )
warpPedIntoVehicle ( thePlayer , kosiarka )
celresp ( thePlayer )
end )
function usun_pojazd ( thePlayer , seat )
if seat == 0 then
kosiarka = getPedOccupiedVehicle ( thePlayer )
kosiarka1 = getElementData ( kosiarka , "pojazd_wyjdz" )
if kosiarka1 then
outputChatBox ( "Skonczyles prace " , thePlayer , 0 , 200 , 0 )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
setTimer ( usun_pojazd , 1200 , 1 )
function koniec ( thePlayer , seat )
destroyElement ( kosiarka )
destroyElement ( blip )
destroyElement ( cel )
end
addEventHandler ( "onPlayerQuit" , getRootElement (), koniec )
Nie dziala
Wysłany: 2015-12-06, 19:39
Jeey
Lua, Grafik
Wiek: 27 Na forum: 4339 dni Posty: 98
Nick w MP: Jeey
Piwa : 383
je?eli chcesz ?eby ty to widzial a inni gracze nie to daj po stronie client
Wysłany: 2015-12-06, 19:43
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
ale to da rade na serverze zrobic !
Wysłany: 2015-12-06, 19:45
DamianGames
Wiek: 23 Na forum: 3946 dni Posty: 75
Piwa : 521
"BlackTen" napisał/a :ale to da rade na serverze zrobic !
To prawda ale tw?j skrypt korzysta z funkcji kt?re s? po stronie Clienta wi?c one nie b?d? dzia?a? na s-side u?yj skryptu kt?ry ci poda?em na c-side i powied? czy dzia?a ;D
Lub na swoim na pocz?tku dodaj
;D
Wysłany: 2015-12-06, 20:07
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
Je?eli co? robisz na server side widoczne dla jednego gracza, to u?yj tego co wy?ej poda?em.
Wiele os?b twierdzi, ?e lepiej jest pisa? na c-side, no niby tak, ale zdarza si?, ?e kto? potrafi uruchomi? sw?j kod na client-side i wtedy mo?e sobie wywolac trigger z server-side ( je?eli taki stworzylismy ) do dawania kasy, namno?y sobie hajsu i elo.
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2015-12-06, 20:30
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Wszystko ok ale nie usuwa markera jak wyjde z pojazdu:
c-side
local rozpocznijkosiarki = createMarker ( 239.86 , 1033.41 , 24.28 , "cylinder" , 2.0 , 0 , 255 , 0 , 255 )
punkty = {
{ 262.12969970703 , 1050.2818603516 , 21.993144989014 },
{ 264.08456420898 , 1073.9671630859 , 17.064970016479 },
{ 278.78396606445 , 1072.0758056641 , 17.635766983032 },
{ 277.53994750977 , 1048.6411132813 , 22.602624893188 },
{ 262.08264160156 , 1040.5043945313 , 24.127019882202 },
{ 244.19674682617 , 1061.0831298828 , 18.712356567383 },
{ 247.59407043457 , 1085.6677246094 , 14.979658126831 },
{ 271.54467773438 , 1091.4221191406 , 13.475341796875 },
{ 261.13067626953 , 1077.4204101563 , 16.51665687561 },
}
function celresp ( player )
local pkt = punkty [ math . random ( 1 , #punkty)]
cel = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "checkpoint" , 4.0 , 123 , 225 , 56 , 150 , thePlayer )
blip = createBlipAttachedTo ( cel , 41 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , thePlayer )
function wjechal ( thePlayer )
local money = math . random ( 5 , 15 )
destroyElement ( cel )
destroyElement ( blip )
triggerServerEvent ( "givePlayerMoney" , thePlayer , 3 , 0 )
celresp ()
end
function usun_pojazd ()
destroyElement ( cel )
destroyElement ( blip )
end
addEventHandler ( "usunkosiarki" , root , usun_pojazd )
addEvent ( "usunkosiarki" , true )
addEventHandler ( "onClientMarkerHit" , cel , wjechal )
end
addEventHandler ( "onClientMarkerHit" , rozpocznijkosiarki ,function( player )
triggerServerEvent ( "autorespkosiarki" , getRootElement (), localPlayer )
celresp ()
end )
s-side
addEvent ( "autorespkosiarki" , true )
addEventHandler ( "autorespkosiarki" , root ,function( player )
local kosiarka = createVehicle ( 572 , 240.46 , 1038.46 , 23.85 , 346.9 , 356.7 , 356.0 )
setElementData ( kosiarka , "pojazd_wyjdz" , true )
setElementData ( kosiarka , "pojazd_paliwo" , math . random ( 20 , 50 ))
setElementData ( kosiarka , "pojazd_opis" , "Praca Dorywcza\nKoszenie Trawnikow" )
warpPedIntoVehicle ( player , kosiarka )
function skonczyl ( thePlayer , seat )
if seat == 0 then
kosiarka = getPedOccupiedVehicle ( thePlayer )
kosiarka1 = getElementData ( kosiarka , "pojazd_wyjdz" )
if kosiarka1 then
outputChatBox ( "Skonczyles prace " , thePlayer , 0 , 200 , 0 )
destroyElement ( kosiarka )
triggerClientEvent ( thePlayer , "usunkosiarki" , root )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , root , skonczyl )
setTimer ( skonczyl , 50 , 1 )
end )
Wysłany: 2015-12-06, 20:43
DamianGames
Wiek: 23 Na forum: 3946 dni Posty: 75
Piwa : 521
s-side
addEvent ( "autorespkosiarki" , true )
addEventHandler ( "autorespkosiarki" , root ,function( player )
local kosiarka = createVehicle ( 572 , 240.46 , 1038.46 , 23.85 , 346.9 , 356.7 , 356.0 )
setElementData ( kosiarka , "pojazd_wyjdz" , true )
setElementData ( kosiarka , "pojazd_paliwo" , math . random ( 20 , 50 ))
setElementData ( kosiarka , "pojazd_opis" , "Praca Dorywcza\nKoszenie Trawnikow" )
warpPedIntoVehicle ( player , kosiarka )
function skonczyl ( thePlayer , seat )
if seat == 0 then
kosiarka = getPedOccupiedVehicle ( thePlayer )
kosiarka1 = getElementData ( kosiarka , "pojazd_wyjdz" )
if kosiarka1 then
outputChatBox ( "Skonczyles prace " , thePlayer , 0 , 200 , 0 )
destroyElement ( kosiarka )
destroyElement ( cel )
destroyElement ( blip )
triggerClientEvent ( thePlayer , "usunkosiarki" , root )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , root , skonczyl )
setTimer ( skonczyl , 50 , 1 )
end )
Zobacz ;D
Tagi: kosiarki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: