Wysłany: 2016-03-19, 18:41
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Witam pom??cie bo na pojezdzie nie pokazuje napisu Paliwo 0%
I sprawdzcie czy kod dobry
local smieci = getElementData ( pojazd , "pojazd_smieci" ) + math . random ( 10 , 23 )
finishJob ()
showNextPoint ()
playSoundFrontEnd ( 12 )
setElementData ( pojazd , "pojazd_smieci" , smieci )
setElementData ( pojazd , "pojazd_opis" , "Ropa: " .. smieci .. "%" )
end
addEventHandler ( "onClientMarkerHit" , jobOdbieranie , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
if not getPedOccupiedVehicle ( el ) then return end
local pojazd = getPedOccupiedVehicle ( el )
if getElementData ( pojazd , "pojazd_smieci" ) and tonumber ( 60 ) <= getElementData ( pojazd , "pojazd_smieci" ) then
smieci = getElementData ( pojazd , "pojazd_smieci" ) * 0.5
setElementData ( pojazd , "pojazd_smieci" , 0 )
triggerServerEvent ( "giveMoney" , el , smieci , 1 )
setElementData ( pojazd , "pojazd_opis" , "Paliwo: 0%" )
else
outputChatBox ( "* Nie posiadasz min. 80% ropy" )
end
end )
Wysłany: 2016-03-19, 21:02
mlodasnygo
Wiek: 16 Na forum: 3972 dni Posty: 205
Piwa : 518
A masz kod na pokazywanie tego opisu?
Je?li nie masz, to tutaj Ci daje z mojego skryptu, strona clienta
addEventHandler ( "onClientRender" , root , function()
local rootx , rooty , rootz = getCameraMatrix ()
for i , vehicle in ipairs ( getElementsByType ( "vehicle" )) do
local x , y , z = getElementPosition ( vehicle )
local sx , sy = getScreenFromWorldPosition ( x , y , z )
if sx and sy then
local opis = getElementData ( vehicle , "pojazd_opis" ) -- Element data na opis , ustaw swoj ?, chyba ze masz system pojazd ? w by pan prezes
if opis then
local distance = getDistanceBetweenPoints3D ( rootx , rooty , rootz , x , y , z )
if distance <= 40 then -- odleg ? o ?? widoczno ? ci opisu
dxDrawText ( opis , sx -( string . len ( opis )/ 2 ), sy , sx + 100 , sy , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default-bold" , "center" , "center" , false , true , false , false )
end
end
end
end
e
Pozdrawiam,
licz? na i Piwko
Podpis
600 dni -
10 marca 2017
500 piw -
10 marca 2017
Wysłany: 2016-03-19, 23:11
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Dzi?ki masz piwko ode mnie
Podpis
Uczeń LUA . Mapper MTA.
Tagi: praca :: nie :: działa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: