Wysłany: 2022-02-09, 11:07
!ryzee
rebornMTA
Wiek: 19 Na forum: 2254 dni Posty: 111
Nick w MP: drakovskyy
Piwa : 55
Siemanko! Przychodz? z drobnym zapytaniem, jak zrobi? tutaj ?eby da?o si? poprzez komend? te? dodawa? stereo?
Kod:
local tunes = {
[ 'mk4' ] = { "mk4" , nil , "MK4" },
[ 'licznikrgb' ] = { "licznik" , "vehicle:licznik:rgb" , "Licznik RGB" },
[ 'neonrgb' ] = { "neon" , "vehicle:neon" , "Neony RGB" },
[ 'deluxo' ] = { "deluxomode" , "vehicle:deluxo" , "Deluxomode" },
[ 'hover' ] = { "hovermode" , "vehicle:hover" , "Hovermode" },
}
addCommandHandler ( "zamontuj" , function( plr , cmd , tune )
if getAdmin ( plr , 5 ) and getAdmin ( plr , 6 ) then
if not tune or tune == " " or tune == "" then exports . nrpg_interface : showPlayerNotification ( plr , "U?ycie: /zamontuj <mk4/licznikrgb/deluxo/hover/neonrgb>" , "error" ) return end
local veh = getPedOccupiedVehicle ( plr )
local tune_ = tunes [ tune ]
if tune_ then
if tune_ [ 2 ] then
if tune_ [ 1 ] == "neon" then
setElementData ( veh , tune_ [ 2 ], 2 )
else
setElementData ( veh , tune_ [ 2 ], 1 )
end
end
addTune ( plr , veh , tune_ [ 3 ], tune_ [ 1 ])
end
end
end )
addCommandHandler ( "zdemontuj" , function( plr , cmd , tune )
if getAdmin ( plr , 5 ) and getAdmin ( plr , 6 ) then
if not tune or tune == " " or tune == "" then exports . nrpg_interface : showPlayerNotification ( plr , "U?ycie: /zdemontuj <mk4/licznikrgb/deluxo/hover/neonrgb>" , "error" ) return end
local veh = getPedOccupiedVehicle ( plr )
local tune_ = tunes [ tune ]
if tune_ then
if tune_ [ 2 ] then
setElementData ( veh , tune_ [ 2 ], false )
end
deleteTune ( plr , veh , tune_ [ 3 ], tune_ [ 1 ])
end
end
end )
function addTune ( plr , veh , tune , tuneData )
if veh then
local id = getElementData ( veh , "vehicle:id" )
if id then
exports . nrpg_interface : showPlayerNotification ( plr , "Pomy?lnie zamontowano #FFF600" .. tune .. "#FFFFFF do pojazdu ID: #FFF600" .. id , "success" )
if tuneData == "neon" then
exports [ 'pystories-db' ]: dbSet ( "UPDATE `pystories_vehicles` SET `" .. tuneData .. "` = '2' WHERE `pystories_vehicles`.`id` = ?" , id )
else
exports [ 'pystories-db' ]: dbSet ( "UPDATE `pystories_vehicles` SET `" .. tuneData .. "` = '1' WHERE `pystories_vehicles`.`id` = ?" , id )
end
end
end
end
function deleteTune ( plr , veh , tune , tuneData )
if veh then
local id = getElementData ( veh , "vehicle:id" )
if id then
exports . nrpg_interface : showPlayerNotification ( plr , "Pomy?lnie zdemontowano #FFF600" .. tune .. "#FFFFFF w poje?dzie ID: #FFF600" .. id , "success" )
exports [ 'pystories-db' ]: dbSet ( "UPDATE `pystories_vehicles` SET `" .. tuneData .. "` = '0' WHERE `pystories_vehicles`.`id` = ?" , id )
end
end
end
Wysłany: 2022-02-10, 22:06
Szypki_exe
Wiek: 21 Na forum: 3239 dni Posty: 172
Piwa : 1426
Wysłany: 2022-02-11, 18:41
!ryzee
rebornMTA
Wiek: 19 Na forum: 2254 dni Posty: 111
Nick w MP: drakovskyy
Piwa : 55
"Szypki_exe" napisał/a :
zielony w tym kodzie jestem, co? wi?cej mordko?
Wysłany: 2022-02-12, 19:34
Szypki_exe
Wiek: 21 Na forum: 3239 dni Posty: 172
Piwa : 1426
"StrancuuuPL" napisał/a : "Szypki_exe" napisał/a :
zielony w tym kodzie jestem, co? wi?cej mordko?
Wystarczy ?e klikniesz na to co wys?a?em "addVehicleUpgrade" praktycznie gotowy kod tam masz
Wysłany: 2024-07-21, 00:41
NiroN_PL
Wiek: 26 Na forum: 1038 dni Posty: 6
Nick w MP: infinite.
Piwa : 139
Jak dodać coś takiego, że jak już mamy stereo to jest komunikat: Posiadasz już stereo w tym pojeździe"?
Wysłany: 2024-07-21, 18:27
MlodyRafonix
Wiek: 26 Na forum: 1899 dni Posty: 103
Piwa : 954
"NiroN_PL" napisał/a :Jak dodać coś takiego, że jak już mamy stereo to jest komunikat: Posiadasz już stereo w tym pojeździe"?
if warunek then -- jesli warunek jest spelniony to wiadomosc na czat , koniec kodu
outputChatBox ( "komunikat //posiadasz już blablabla" )
return
end
warunkiem moze byc np. funkcja getVehicleUpgradeOnSlot, element data lub jeszcze cos innego
Tagi: stereo
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: