Wysłany: 2016-07-16, 19:22
ReZuS
Wiek: 25 Na forum: 3702 dni Posty: 26
Piwa : 1041
Witam . Mam problem a mianowicie jak tworz? obiekt i u?ywaj?c attachElements mam pewnien problem . Tylko osoba, wykonuj?ca t? prace widzi obiekt . Prosz? o pomoc , poniewa? chc? aby wszyscy gracze go widzieli .
obj = createObject(3632, 0, 0, 0)
obj = createObject ( 3632 , 0 , 0 , 0 )
attachElements ( obj , veh , 0 , - 1.6 , 0.0 )
Wysłany: 2016-07-16, 19:23
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
zr?b to po stronie servera.
Wysłany: 2016-07-16, 19:28
ReZuS
Wiek: 25 Na forum: 3702 dni Posty: 26
Piwa : 1041
addEventHandler ( "onClientMarkerHit" , missionZaladunek , function( el , md )
if not md or el ~= localPlayer then return end
local veh = getPedOccupiedVehicle ( el )
if not veh then return end
if getVehicleController ( veh ) ~= localPlayer then return end
if getElementModel ( veh ) ~= 600 then return end
if isElement ( missionMarker ) or isElement ( missionBlip ) then
outputChatBox ( "* Nie mo?esz za?adowa? beczki, posiadasz pe?n? pake" , 255 , 0 , 0 )
return
end
setElementFrozen ( veh , true )
outputChatBox ( "* ?adujesz beczke." )
setTimer (function()
playSoundFrontEnd ( 9 )
obj = createObject ( 3632 , 0 , 0 , 0 )
attachElements ( obj , veh , 0 , - 1.6 , 0.2 )
setObjectScale ( obj , 1.3 )
showMarker ()
setElementFrozen ( veh , false )
outputChatBox ( "* Za?adowa?e?(a?) beczke,punkt dostawy oznaczono blipem (c) na radarze." )
end , 5000 , 1 )
end )
ALe mam ten kod po stronie clienta i jak a odno?nie ?adowania to nic po stronie serwera nie ma ;V
[ Dodano : 2016-07-16, 19:29 ]
local jobOnline = true -- czy praca w ?? czona
local jobMarker = createMarker (- 144.79 , 1078.61 , 20.49 - 1.20 , "cylinder" , 1.3 , 255 , 255 , 255 , 55 ) -- marker
local jobBlip = createBlipAttachedTo ( jobMarker , 46 ) -- blip
local jobVehicle ={ 600 , - 138.67 , 1083.52 , 19.35 , 359.2 , 360.0 , 347.8 } -- gdzie ma by ? spawnowany pojazd
addCommandHandler ( "rozpocznij" , function( plr , cmd )
if not isElementWithinMarker ( plr , jobMarker ) then return end
if jobOnline == false then
outputChatBox ( "* Praca jest wy??czona." , plr , 255 , 0 , 0 )
return
end
if getElementData ( plr , "player:job" ) then
outputChatBox ( "* Ju? posiadasz aktywn? prac?." , plr , 255 , 0 , 0 )
return
end
veh = createVehicle ( jobVehicle [ 1 ], jobVehicle [ 2 ], jobVehicle [ 3 ], jobVehicle [ 4 ], jobVehicle [ 5 ], jobVehicle [ 6 ], jobVehicle [ 7 ])
setElementData ( veh , "pojazd_opis" , "Praca dorywcza\nTransport Beczek z paliwem" )
setElementData ( veh , "pojazd_przebieg" , math . random ( 10 , 100000 ))
setElementData ( veh , "pojazd_paliwo" , 100 )
warpPedIntoVehicle ( plr , veh )
triggerClientEvent ( plr , "startJob" , resourceRoot , veh )
end )
addEventHandler ( "onMarkerHit" , jobMarker , function( el , md )
if getElementType ( el ) == "player" then
if isPedInVehicle ( el ) then return end
outputChatBox ( "* Aby rozpocz?? prac? wpisz /rozpocznij" , el )
end
end )
function wysiadka ()
destroyElement ( veh )
end
addEventHandler ( "onVehicleExit" , getRootElement (), wysiadka )
addEventHandler ( "onClientPlayerQuit" , root , function()
destroyElement ( veh )
end )
Strona Servera
Wysłany: 2016-07-16, 19:50
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Tagi: widoczność :: obiektu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: