Divine lua vip commands problem

NarcoRP

El Diablo Nunca Duerme
Divine
NarcoRP Rep
1
0
0
Rep
3
NarcoRP Vouches
0
0
0
Vouches
0
Posts
132
Likes
109
2 YEARS
2 YEARS OF SERVICE
LEVEL 8 81 XP
lua problem vip lua commands the command works rank 1 which is a moderator I added the source vip system out of the staff ranks I don't know how to explain it I have this lua command as I told you it works as a moderator level 1 I want my vip system
?hash=8c34e206c8c46cb42d6e048cb0e25836.png



and this is the lua that I want to work since I see changes from IsPremium it is not normal ranges of staff SEC_MODERATOR or I am wrong I don't know the truth can you help me

C++:
--[[
-- Script Name : VIP  Commands
-- Made By : PrivateDonut
-- Version : 1.0
-- Description : This script allows you to add VIP commands to your server.
]] --

local vipCooldown = 10 -- Enfriamiento en segundos para comandos VIP

-- Manage VIP Commands
-- true = Turned on, false = turned off
local vip = true
local vipBuffs = true
local vipWhisperOn = true
local vipWhisperOff = true
local vipMall = true
local vipChangeFaction = false
local vipChangeRace = false
local vipChangeName = false

-- Gestionar privilegios de comandos VIP
-- No necesita editar esto si solo tiene un rango VIP
-- Puede configurar el acceso a cada comando según sus necesidades, usa account_access en la tabla de autenticación.
local vipPrivilege = 1
local vipBuffPrivilege = 1
local vipWhisperOnPrivilege = 1
local vipWhisperOffPrivilege = 1
local vipMallPrivilege = 1
local vipChangeFactionPrivilege = 1
local vipChangeRacePrivilege = 1
local vipChangeNamePrivilege = 1

-- Manage Mall Cords
local vipMallX = 5845.691406 -- X Cord
local vipMallY = 648.121155 -- Y Cord
local vipMallZ = 647.512634 -- Z Cord
local vipMallO = 0.131922 -- O Cord
local vipMallMap = 571 -- Map ID

-- VIP Buffs
-- You can add as many buffs here as you'd like, just seperate them with a comma. The last entry doesn't need a comma.
local vipBuff = {
    35912,
    65075
}

-- Do not edit below this line unless you know what you're doing
local cooldowns = {}
local buff = {}
function commandCooldown(player, command, cooldownTime)
    -- Check if the player is on cooldown
    if (cooldowns[player:GetGUIDLow() .. command] ~= nil) then
        local currentTime = os.time()
        if (currentTime < cooldowns[player:GetGUIDLow() .. command]) then
            player:SendBroadcastMessage("Tu debes esperar " .. cooldowns[player:GetGUIDLow() .. command] - currentTime .." segundos antes de volver a usar este comando.")
            return false
        end
    end
    cooldowns[player:GetGUIDLow() .. command] = os.time() + cooldownTime
    return true
end

function OnChatMessage(event, player, command, type, language)
    local rank = player:GetGMRank()

    if command == "vip" then
        if rank >= vipPrivilege then
            if vip == true then
                if commandCooldown(player, command, vipCooldown) then
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r ~~ VIP Lista de comandos ~~")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip - muestra esta lista")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip mall - Teletransportarse al centro comercial VIP!")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip buff - Mejorate")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip susurro activado - activa el susurro")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip susurro apagado - apagar susurro")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changefaction - Cambia tu facción")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changerace - Change your race")
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changename - Change your name")
                else
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|rThe VIP el comando está deshabilitado.")
                end
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r No tienes permiso para usar este comando.")
        end
    end

    if command == "vip mall" then
        if rank >= vipMallPrivilege then
            if vipMall == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- Check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r No puedes usar este comando mientras estás en combate.!")
                        return false
                    end
                    -- Check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r No puedes usar este comando mientras estás muerto!")
                        return false
                    end
                    -- Check if player is in a vehicle
                    if player:IsOnVehicle() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r No puede usar este comando mientras está en un vehículo!")
                        return false
                    end
                    player:Teleport(vipMallMap, vipMallX, vipMallY, vipMallZ, vipMallO)
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r Ahora estás siendo teletransportado al centro comercial VIP.!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r El comando VIP Mall está deshabilitado.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r No tienes permiso para usar este comando.")
        end
    end

    if command == "vip buff" then
        if rank >= vipBuffPrivilege then
            if vipBuffs == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- Check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- Check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    -- Check if player is in a vehicle
                    if player:IsOnVehicle() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in a vehicle!")
                        return false
                    end
                    for i = 1, #vipBuff do
                        player:AddAura(vipBuff[i], player)
                    end
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have been buffed!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP Buff command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

    if command == "vip whisper on" then
        if rank >= vipWhisperOnPrivilege then
            if vipWhisperOn == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- Check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- Check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    player:SetAcceptWhispers()
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have turned whispers back on")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper on command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

    if command == "vip whisper off" then
        if rank >= vipWhisperOnPrivilege then
            if vipWhisperOff == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- Check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- Check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    player:SetAcceptWhispers(false)
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have turned whisper off!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper off command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

    if command == "vip changefaction" then
        if rank >= vipChangeFactionPrivilege then
            if vipChangeFaction == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- Check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- Check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    -- Check if player is in a vehicle
                    if player:IsOnVehicle() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in a vehicle!")
                        return false
                    end
                    player:SetAtLoginFlag(64)
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your faction on your next login!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP change faction command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

    if command == "vip changerace" then
        if rank >= vipChangeRacePrivilege then
            if vipChangeRace == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    player:SetAtLoginFlag(128)
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your race on your next login!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper on command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

    if command == "vip changename" then
        if rank >= vipChangeNamePrivilege then
            if vipChangeName == true then
                if commandCooldown(player, command, vipCooldown) then
                    -- check if player is in combat
                    if player:IsInCombat() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
                        return false
                    end
                    -- check if player is dead
                    if player:IsDead() then
                        player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
                        return false
                    end
                    player:SetAtLoginFlag(1)
                    player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your name on your next login!")
                end
            else
                player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP change name command is disabled.")
            end
        else
            player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
        end
    end

end

local function DeleteChat(event, player, command)
    if (command:find("vip")) then
        return false
    end
end

RegisterPlayerEvent(42, OnChatMessage)
RegisterPlayerEvent(42, DeleteChat)
 

Attachments

  • Captura.PNG
    Captura.PNG
    31.3 KB · Views: 0
  • vip_commands.lua
    13.2 KB · Views: 1

Tommy

Staff
Staff
Tommy Rep
1
0
0
Rep
1
Tommy Vouches
0
0
0
Vouches
0
Posts
185
Likes
101
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 310 XP
What I'd do, instead of all the unnecessary code changes to C++ is create a new column in your accounts table (or make a new table specifically for VIPs) and pull that data with an SQL Query in Lua. That way, it'll all be in Lua and the only modification or addition would be the vip column/table. All of this extra effort is nonsense imo.
 
Liked By 1 member :

NarcoRP

El Diablo Nunca Duerme
Divine
NarcoRP Rep
1
0
0
Rep
3
NarcoRP Vouches
0
0
0
Vouches
0
Posts
132
Likes
109
2 YEARS
2 YEARS OF SERVICE
LEVEL 8 81 XP
What I'd do, instead of all the unnecessary code changes to C++ is create a new column in your accounts table (or make a new table specifically for VIPs) and pull that data with an SQL Query in Lua. That way, it'll all be in Lua and the only modification or addition would be the vip column/table. All of this extra effort is nonsense imo.
If you have a different table that is premium vip, there is an account id and the vip that is from 1 to 3
 

3,390

1,271

9,555

428

Top