ппоршень
-
Автор темы
- #1
накатал музик кит ченджер но музыка ставится рандомным людям, скорее всего потому что я получаю не свой CCSPlayerResource. как чинить это?
lua:
local kit_list = {
"No music kit",
"CS:GO",
"musickit_valve_csgo_02",
"Crimson Assault",
"Sharpened",
"Insurgency",
"AD8",
"High Noon",
"Death's Head Demolition",
"Desert Fire",
"LNOE",
"Metal",
"All I Want for Christmas",
"IsoRhythm",
"For No Mankind",
"Hotline Miami",
"Total Domination",
"The Talos Principle",
"Battlepack",
"MOLOTOV",
"Uber Blasto Phone",
"Hazardous Environments",
"Headshot",
"The 8-Bit Kit",
"I Am",
"Diamonds",
"Invasion!",
"Lion's Mouth",
"Sponge Fingerz",
"Disgusting",
"Java Havana Funkaloo",
"Moments CSGO",
"Aggressive",
"The Good Youth",
"FREE",
"Life's Not Out To Get You",
"Backbone",
"GLA",
"III-Arena",
"EZ4ENCE",
"The Master Chief Collection",
"Scar",
"Anti Citizen",
"Bachram",
"Gunman Taco Truck",
"Eye of the Dragon",
"M.U.D.D. FORCE",
"Neo Noir",
"Bodacious",
"Drifter",
"All for Dust",
"Hades Music Kit",
"The Lowlife Pack",
"CHAIN$AW.LXADXUT.",
"Mocha Petal",
"~Yellow Magic~",
"Vici",
"Astro Bellum",
"Work Hard, Play Hard",
"KOLIBRI",
"u mad!",
"Flashbang Dance",
"Heading for the Source",
"Void",
"Shooters",
"dashstar*",
"Gothic Luxury",
"Lock Me Up",
"花脸 Hua Lian (Painted Face)",
"ULTIMATE"
}
local function indexOf(array, value)
for i, v in ipairs(array) do
if v == value then
return i
end
end
return nil
end
local listbox = ui.new_combobox("skins", 'Model options', 'Music kit', kit_list)
local function set_music_kit(idx)
local local_index = entity.get_local_player()
if local_index == nil then
return
end
entity.set_prop(entity.get_player_resource(), 'm_nMusicID', idx, 1)
end
ui.set_callback(listbox, function()
set_music_kit(indexOf(kit_list, ui.get(listbox)) - 1)
end)
client.set_event_callback('round_start', function()
set_music_kit(indexOf(kit_list, ui.get(listbox)) - 1)
end)
client.set_event_callback('shutdown', function()
set_music_kit(0)
end)