Wysłany: 2015-08-03, 14:30
HypE
Wiek: 27 Na forum: 3958 dni Posty: 21
Nick w MP: HypE
Witam.
Jak zrobi? ?eby gracz kt?ry nie posiada 50 $ nie m?g? naprawi? pojazdu ?
z g?ry dzi?kuje za pomoc.
naprawa = createMarker(1635.32824707, -1133.6793212, 23.90625, 'cylinder', 2.0, 255, 0, 0, 150)
function napraw (thePlayer)
if isPedInVehicle ( thePlayer ) then
local car = getPedOccupiedVehicle ( thePlayer )
fixVehicle(car)
takePlayerMoney(thePlayer, 50)
outputChatBox("Naprawiles auto! wydales 50 GP", thePlayer, 0, 170, 255, true)
else
outputChatBox ("nie jestes w aucie!", thePlayer, 0, 170, 255, true)
end
end
addEventHandler("onMarkerHit", naprawa, napraw)
Wysłany: 2015-08-03, 14:44
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
naprawa = createMarker ( 1635.32824707 , - 1133.6793212 , 23.90625 , 'cylinder' , 2.0 , 255 , 0 , 0 , 150 )
function napraw ( thePlayer )
if isPedInVehicle ( thePlayer ) then
local car = getPedOccupiedVehicle ( thePlayer )
if getPlayerMoney ( thePlayer ) >= 50 then
fixVehicle ( car )
takePlayerMoney ( thePlayer , 50 )
outputChatBox ( "Naprawiles auto! wydales 50 GP" , thePlayer , 0 , 170 , 255 , true )
else
outputChatBox ( "nie jestes w aucie!" , thePlayer , 0 , 170 , 255 , true )
end
end
end
addEventHandler ( "onMarkerHit" , naprawa , napraw )
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-08-03, 14:54
HypE
Wiek: 27 Na forum: 3958 dni Posty: 21
Nick w MP: HypE
Jak zrobi? kod w takim ?tym tle ? xD
i mam pytanie czy da rade jako? zrobi? ?e zabiera nam kwot? od uszkodze? pojazdu ?
chodzi mi o to gdy pojazd ma np 400hp to zabiera 100$ a jak ma 200hp to zabiera 150 $
Wysłany: 2015-08-03, 15:03
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
getElementHealth chyba, nie jestem pewien.
A z??te t?o kodu to :
.[.lua.]. oczywiscie bez kropek
.[./lua.].
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-08-03, 15:35
HypE
Wiek: 27 Na forum: 3958 dni Posty: 21
Nick w MP: HypE
a w jakim miejscu wstawi? ten warunek ?e je?li pojazd ma tyle... hp to zabiera tyle $$ ?
Wysłany: 2015-08-03, 16:01
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
naprawa = createMarker ( 1635.32824707 , - 1133.6793212 , 23.90625 , 'cylinder' , 2.0 , 255 , 0 , 0 , 150 )
function napraw ( thePlayer )
if isPedInVehicle ( thePlayer ) then
car = getPedOccupiedVehicle ( thePlayer )
health = getElementHealth ( car )
if health > 800 and health < 1000 then
if getPlayerMoney ( thePlayer ) >= 200 then
fixVehicle ( car )
takePlayerMoney ( thePlayer , 200 )
outputChatBox ( "Naprawiles auto! wydales 200 GP" , thePlayer , 0 , 170 , 255 , true )
end
elseif health > 400 and health < 800 then
if getPlayerMoney ( thePlayer ) >= 500 then
fixVehicle ( car )
takePlayerMoney ( thePlayer , 500 )
outputChatBox ( "Naprawiles auto! wydales 500 GP" , thePlayer , 0 , 170 , 255 , true )
end
elseif health > 100 and health < 400 then
if getPlayerMoney ( thePlayer ) >= 800 then
fixVehicle ( car )
takePlayerMoney ( thePlayer , 800 )
outputChatBox ( "Naprawiles auto! wydales 800 GP" , thePlayer , 0 , 170 , 255 , true )
end
end
end
end
end
addEventHandler ( "onMarkerHit" , naprawa , napraw )
troche ma?o wydajne ale c??
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-08-03, 21:16
Tostuch
Wiek: 27 Na forum: 4931 dni Posty: 483
Nick w MP: Tost
Piwa : 137
Chcia?bym zaznaczy? ?e pojazd maj?c 250% hp zaczyna si? pali?. Ze swojej strony polecam Ci jakie? obliczanie danej kwoty jak?? formu??.
Tagi: naprawa :: auta
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: