Startracker983274
Известный
- 41
- 122
Описание: получает расу персонажа по ID скина.
Код:
Пример использования:
Код:
Lua:
function getCharRace(skinId)
if skinId ~= nil then
local racesTable = {
white = {1, 2, 3, 8, 23, 26, 27, 29, 31, 32, 33, 34, 36, 37, 42, 50, 52, 61, 62, 68, 70, 71, 72, 73, 75, 76, 77, 78, 81, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 111, 112, 113, 119, 124, 125, 126, 127, 135, 137, 138, 145, 147, 150, 151, 152, 153, 154, 155, 157, 158, 159, 160, 161, 162, 164, 165, 167, 171, 172, 177, 178, 179, 181, 188, 189, 191, 192, 194, 196, 197, 198, 199, 200, 201, 202, 204, 205, 206, 211, 212, 213, 214, 216, 217, 230, 231, 232, 233, 234, 235, 236, 239, 240, 241, 242, 246, 247, 248, 250, 251, 252, 254, 255, 257, 258, 259, 261, 263, 264, 266, 268, 272, 275, 277, 279, 280, 281, 282, 283, 285, 286, 287, 288, 289, 290, 291, 295, 299, 300, 301, 302, 303, 304, 305, 306, 308, 309, 310, 311},
black = {0, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, 51, 63, 65, 66, 67, 69, 74, 79, 80, 83, 86, 102, 103, 104, 105, 106, 107, 134, 136, 139, 142, 143, 144, 148, 149, 156, 163, 166, 168, 176, 180, 182, 183, 185, 190, 195, 215, 218, 219, 220, 221, 222, 238, 244, 245, 249, 253, 256, 260, 262, 265, 269, 270, 271, 274, 278, 284, 293, 296, 297, 307},
hispanic = {30, 35, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 64, 82, 108, 109, 110, 114, 115, 116, 140, 173, 174, 175, 184, 207, 223, 237, 267, 273, 292, 298},
asian = {49, 53, 54, 55, 56, 57, 58, 59, 60, 117, 118, 120, 121, 122, 123, 141, 146, 169, 170, 186, 187, 193, 203, 208, 209, 210, 224, 225, 226, 227, 228, 229, 243, 276, 294},
native = {84, 128, 129, 130, 131, 132, 133}
}
for k, v in pairs(racesTable) do
for m, n in pairs(v) do
if n == skinId then
return k
end
end
end
end
return "Unknown"
end
Пример использования:
Lua:
function main()
while true do
wait(0)
if isPlayerPlaying(PLAYER_HANDLE) then
for _, ped in ipairs(getAllChars()) do
wait(100)
if (doesCharExist(ped) and ped ~= PLAYER_PED and getCharRace(getCharModel(ped)) == "black") then
if isCharInAnyCar(ped) then
taskLeaveCar(ped, storeCarCharIsInNoSave(ped))
else
taskKillCharOnFoot(ped, PLAYER_PED)
end
end
end
end
end
end
Последнее редактирование: