Wysłany: 2017-07-01, 14:58
admiral123
Wiek: 29 Na forum: 3276 dni Posty: 16
Piwa : 1
Jak zrobi? w tym kodzie tak, ?eby pokazywa?o maksymalnie 1 wiadomo?? i a nie 10 jak kto? przekroczy pr?dko??? Bo dodaje im x10 kasy
kod
--[[ Pobieranie predkosci ]]--
-- #prorok
function isPedAiming ( thePedToCheck )
if getElementData ( localPlayer , "player:duty" ) and getElementData ( localPlayer , "player:duty" ) == "SAPD" or getElementData ( localPlayer , "player:duty" ) == "SMSA" then
else cancelEvent () end
if isElement ( thePedToCheck ) then
if getElementType ( thePedToCheck ) == "player" or getElementType ( thePedToCheck ) == "ped" then
if getPedTask ( thePedToCheck , "secondary" , 0 ) == "TASK_SIMPLE_USE_GUN" then
return true
end
end
end
return false
end
function blokujStrzal ()
if getPedWeapon ( localPlayer ) == 22 then
toggleControl ( "fire" , false )
else
toggleControl ( "fire" , true )
end
end
addEventHandler ( "onClientRender" , root , blokujStrzal )
function pobierzPredkosc ( cel )
if getElementData ( localPlayer , "player:duty" ) and getElementData ( localPlayer , "player:duty" ) == "SAPD" or getElementData ( localPlayer , "player:duty" ) == "SMSA" then
else return end
if ( cel ) then
if isPedAiming ( source ) then
local weapon = getPedWeapon ( source )
if weapon == 22 then
local predkosc = math . floor ( getDistanceBetweenPoints3D ( 0 , 0 , 0 , getElementVelocity ( cel )) * 100 * 1.61 )
if predkosc >= 100 then
local hajs2 = getElementData ( localPlayer , "player:money" )
local wykroczenie = math . random ( 100 , 200 )
setElementData ( localPlayer , "player:money" , hajs2 + wykroczenie / 2 )
outputChatBox ( "#FF00FF[#5f5f5fInformacja#FF00FF]#ffffffZarejerstrowa?e? przekroczenie pr?dko?ci! Otrzymujesz " .. wykroczenie .. " PLN!" , 255 , 155 , 12 , true )
-- triggerServerEvent ( "popelnioneWykroczenie1" , localPlayer )
end
if predkosc <= 0 then
return false
elseif not getElementData ( localPlayer , "player:duty" ) and not getElementData ( localPlayer , "player:duty" ) == "SAPD" or not getElementData ( localPlayer , "player:duty" ) == "SMSA" then
return false
else
setTimer (function() pokazInfo ( predkosc .. " km/h" ) end , 100 , 1 )
end
end
end
end
end
addEventHandler ( "onClientPlayerTarget" , root , pobierzPredkosc )
Za pomoc repka!
Wysłany: 2017-07-01, 15:20
koxpl2x22
MAPPER-ALLEREK
Wiek: 23 Na forum: 4556 dni Posty: 375
Nick w MP: ALLEREK
Piwa : 1726
Daj timer co jaki czas mozna sprawdzac predkosc
Wysłany: 2017-07-01, 15:21
admiral123
Wiek: 29 Na forum: 3276 dni Posty: 16
Piwa : 1
koxpl2x22 , Jaki to timer?
[ Dodano : 2017-07-01, 15:21 ]
koxpl2x22 , Podasz wz?r jaki? czy co??
Wysłany: 2017-07-01, 20:08
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Ja bym zrobi? no tabel?, wk?ada?bym tam wszystkie zmierzone warto?ci i po na przyk?ad 3 sekundach, czy sko?czeniu celowania wy?wietla?oby maksymaln? warto?? z tej tabeli.
Wysłany: 2017-07-02, 11:24
admiral123
Wiek: 29 Na forum: 3276 dni Posty: 16
Piwa : 1
Jacob , No dobrze by by?o. Tylko jak?
Wysłany: 2017-07-02, 16:16
Cholewka
Zakorzeniony w LUA
Wiek: 22 Na forum: 3583 dni Posty: 190
Piwa : 707
"admiral123" napisał/a :koxpl2x22 , Jaki to timer?
[ Dodano : 2017-07-01, 15:21 ]
koxpl2x22 , Podasz wz?r jaki? czy co??
Więcej informacji znajdziesz w Wikipedii MTA: setTimer
setTimer ( function()
outputChatBox ( "5 second delay text!" )
end , 5000 , 1 )
Tagi: predkosc :: suszarce
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: