improved routine to put cars directly on player's inventory when playing driftgame

This commit is contained in:
Alexsandro Percy 2024-05-31 21:41:00 -03:00
parent 8308df4383
commit d86941174d

View File

@ -763,13 +763,20 @@ minetest.register_chatcommand("noobfy_the_vehicles", {
if automobiles_lib.is_drift_game == true then if automobiles_lib.is_drift_game == true then
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory() local inv = player:get_inventory()
inv:add_item("main", "automobiles_beetle:beetle") local car = "automobiles_beetle:beetle"
inv:add_item("main", "automobiles_buggy:buggy") if not inv:contains_item("main", car) then inv:add_item("main", car) end
inv:add_item("main", "automobiles_catrelle:catrelle_4f") car = "automobiles_buggy:buggy"
inv:add_item("main", "automobiles_coupe:coupe") if not inv:contains_item("main", car) then inv:add_item("main", car) end
inv:add_item("main", "automobiles_delorean:delorean") car = "automobiles_catrelle:catrelle_4f"
inv:add_item("main", "automobiles_delorean:time_machine") if not inv:contains_item("main", car) then inv:add_item("main", car) end
inv:add_item("main", "automobiles_trans_am:trans_am") car = "automobiles_coupe:coupe"
if not inv:contains_item("main", car) then inv:add_item("main", car) end
car = "automobiles_delorean:delorean"
if not inv:contains_item("main", car) then inv:add_item("main", car) end
car = "automobiles_delorean:time_machine"
if not inv:contains_item("main", car) then inv:add_item("main", car) end
car = "automobiles_trans_am:trans_am"
if not inv:contains_item("main", car) then inv:add_item("main", car) end
end) end)
end end