Wysłany: 2017-01-23, 23:05
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Chcia?bym, aby funkcja pobiera?a upgrad'y pojazdu i je?eli pojazd ma spoiler o id 1016 wtedy napisze np. "mam id 1016", a je?eli inny spoiler wtedy napisze "nie mam 1016"
Piwo za pomoc
Wysłany: 2017-01-23, 23:37
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
amited , function getVehicleTuning ( veh )
local i
local vehPanel = ''
for i = 0 , 15 do
local vb = ''
if i > 0 then
vb = vehPanel .. ';'
end
vehPanel = vb .. getVehicleUpgradeOnSlot ( veh , i )
end
return vehPanel
end ta funkcja sprawdzasz slot upgradu
Wysłany: 2017-01-24, 16:34
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Oke thx, teraz mam drugi problem:
addEventHandler ( "onClientMarkerHit" , resourceRoot , function( el , md )
if not md or el ~= localPlayer then return end
if getElementModel ( el ) == 50 then
local wybrany = guiGridListGetSelectedItem ( GUIEditor . gridlist [ 1 ])
if wybrany then
local id = guiGridListGetItemText ( GUIEditor . gridlist [ 1 ], wybrany , 1 )
local cena = guiGridListGetItemText ( GUIEditor . gridlist [ 1 ], wybrany , 3 )
local cena = tonumber ( cena )
local cenaa = cena * 0.7 -- ta linijka
dxDrawText ( "Cena demonta?u elementu: " .. id .. " wynosi: " .. cenaa , 344 , 552 , 794 , 569 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
else return end
end
end )
Error: attempt to perform arithmetic on local cena (a nil value)
Wysłany: 2017-01-24, 16:49
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
amited , addEventHandler ( "onClientMarkerHit" , resourceRoot , function( el , md )
if not md or el ~= localPlayer then return end
if getElementModel ( el ) == 50 then
local wybrany = guiGridListGetSelectedItem ( GUIEditor . gridlist [ 1 ])
if wybrany then
local id = guiGridListGetItemText ( GUIEditor . gridlist [ 1 ], wybrany , 1 )
local cena = guiGridListGetItemText ( GUIEditor . gridlist [ 1 ], wybrany , 3 )
local cena = tonumber ( cena )
if cena then else outputChatBox ( "nie ma ceny" ) cena = 0 end
if id then else outputChatBox ( "nie ma id" ) id = nil end
local cenaa = cena * 0.7 -- ta linijka
addEventHandler ( "onClientRender" , root ,function()
dxDrawText ( "Cena demonta?u elementu: " .. id .. " wynosi: " .. cenaa , 344 , 552 , 794 , 569 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default" , "left" , "top" , false , false , false , false , false )
end )
end
end
end ) Po pierwsze musisz sprawdza? czy jest cena id itd Po drugie dxDrawText dzia?a tylko na event onClientRender i musi by?
Wysłany: 2017-01-24, 17:10
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Kurde po 2 min ogarn??em ?e to na clientRender musi by? xd. Close
Podpis
"amited" napisał/a :
Tagi: pobieranie :: upgradeu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: