Help regarding sampGetPlayerColor

Userinspace

Новичок
Автор темы
12
3
Версия MoonLoader
Другое
Hey there!
So this mod will grab the aimed player's id and will run a certain command. But I want it to send the command only if my Player Color/ Id Color/ Nickname color is "-14269954" or "-7500289". I tried sampGetPlayerColor but it crashes my game every time, I guess I'm doing something wrong. Please help me out.

Summary: I want the command/mod to run only if my player/ nickname color is "-14269954" or "-7500289".

Код:
function main()
    while not isSampAvailable() do wait(50) end
    sampAddChatMessage("{33CCFF}Henlo {FFFFFF}By {FF4545} Unknown{FFFFFF}loaded {00FF00}successfully", -1)
    while true do
        if not (sampIsChatInputActive() or sampIsDialogActive() or isSampfuncsConsoleActive()) then
            local result, aimPlayer = getCharPlayerIsTargeting(playerHandle)
            local result2, aimPlayerID = sampGetPlayerIdByCharHandle(aimPlayer)
 if result and result2 and isKeyJustPressed(vkeys. VK_U) then
                    sampSendChat("/b mod test works: " .. aimPlayerID .. "")
            end
        end
        wait(0)
    end
end