-- name = color | НазваниеОрганизации = ЦветНикаОрганизации
-- Пример: ballas - это сокращённое название от "East Side Ballas"
-- Ну а цвет никнейма узнай командой /clr id
groove = 2566951719
ballas = 2580283596
vagos = 2580667164
aztecas = 2566979554
rifa = 2573625087
wolfs = 2158524536
army = 2157536819
tcp = 2157345219 -- CHECK: Этап 1 - Добавляешь новую организацию и её цвет.
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('clr', targetColor)
sampRegisterChatCommand('near', getAllChars)
sampRegisterChatCommand('nearfr', getFractions)
while true do
wait(0)
end
end
function targetColor(arg)
if (not arg or not arg:find('^.+$')) then sampAddChatMessage('введи ид, крипич', -1) return end
local color = sampGetPlayerColor(arg)
sampAddChatMessage(color,-1)
end
function getAllChars()
players = {}
for i = 0, sampGetMaxPlayerId(true) do
if sampIsPlayerConnected(i) and not sampIsPlayerNpc(i) then
local result_target_handle, target_handle = sampGetCharHandleBySampPlayerId(i)
if result then
local result_target_id, target_id = sampGetPlayerIdByCharHandle(target_handle)
table.insert(players, target_id)
end
end
end
getFractions()
end
function getFractions()
count_groove = 0
count_ballas = 0
count_vagos = 0
count_aztecas = 0
count_rifa = 0
count_wolfs = 0
count_army = 0
count_tcp = 0 -- CHECK: Этап 2 - Добавляешь count_названиеОрганизации = 0
for k, v in pairs(players) do
target_color = sampGetPlayerColor(v)
if target_color == 2566951719 then
count_groove = count_groove + 1
end
if target_color == 2580283596 then
count_ballas = count_ballas + 1
end
if target_color == 2580667164 then
count_vagos = count_vagos + 1
end
if target_color == 2158524536 then
count_aztecas = count_aztecas + 1
end
if target_color == 2566979554 then
count_rifa = count_rifa + 1
end
if target_color == 2573625087 then
count_wolfs = count_wolfs + 1
end
if target_color == 2157536819 then
count_army = count_army + 1
end
if target_color == 2157536819 then -- CHECK: Этап 3 - Добавляешь вот эту конструкцию. От if до end. И изменяешь count_name на count_названиеОрганизации
count_tcp = count_tcp + 1
end
end
sampAddChatMessage('{1e702c}Groove Street Families - {cbd4cd}'..count_groove, -1)
sampAddChatMessage('{82369e}East Side Ballas Gang - {cbd4cd}'..count_ballas, -1)
sampAddChatMessage('{cfc921}Los Santos Vagos - {cbd4cd}'..count_vagos, -1)
sampAddChatMessage('{736646}Night Wolfs - {cbd4cd}'..count_aztecas, -1)
sampAddChatMessage('{45d4de}Varios Los Aztecas - {cbd4cd}'..count_rifa, -1)
sampAddChatMessage('{2d5e8c}San Fierro Rifa - {cbd4cd}'..count_wolfs, -1)
sampAddChatMessage('{4a380c}Army - {cbd4cd}'..count_army, -1)
sampAddChatMessage('{4a380c}TCP - {cbd4cd}'..count_tcp, -1) -- CHECK: Этап 4 - Добавляешь название организации и count_названиеОрганизации
end