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

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
aclaro que no fue el que postie ese es el sitema el otro es comando custom vip si utiliza una tabla account vip
en la cual se puede elegir el id de la cuenta y otorgarle rango de vip acorde a lo que esta en el lua
no ocupo tabla account vip ya te mencione que ocupo otro sistema vip es diferente
 

maxyazrael

Active member
maxyazrael Rep
0
0
0
Rep
0
maxyazrael Vouches
0
0
0
Vouches
0
Posts
26
Likes
20
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 55 XP
si por c++ lo que complica el uso de de este mismo a cuentas normales y solo lo pueden usar a los que le de rango por que asi lo creo am... creeria que si cambia esa condicion de uso de solo cuentas con rango a cuentas normales podria hacer lo que ud quiere
Post automatically merged:

alv... verda que este foro es solo ingles mmm bueno espero no me saquen xd
 

Alistar

Divine
Divine
Alistar Rep
1
0
0
Rep
1
Alistar Vouches
0
0
0
Vouches
0
Posts
55
Likes
79
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 320 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
View attachment 3455



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)

If I understood you correctly you're trying to use IsPremium instead of GetGMRank.


You'll have to modify your source if you want to be able to use that function that retrieves the IsPremium rank.


Diff:
diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp
index d783ef9..2f1221b 100644
--- a/LuaFunctions.cpp
+++ b/LuaFunctions.cpp
@@ -761,6 +761,7 @@ ElunaRegister<Player> PlayerMethods[] =
     { "ResetHonor", &LuaPlayer::ResetHonor },
     { "ClearHonorInfo", &LuaPlayer::ClearHonorInfo },
 #endif
+    { "GetPremiumRank", &LuaPlayer::GetPremiumRank },
 
     { NULL, NULL }
 };
diff --git a/PlayerMethods.h b/PlayerMethods.h
index 89e2ed4..269a33a 100644
--- a/PlayerMethods.h
+++ b/PlayerMethods.h
@@ -4209,6 +4209,15 @@ namespace LuaPlayer
     }
 #endif
 
+    /**
+     * Retrieves the IsPremium rank
+     */
+    int GetPremiumRank(lua_State* L, Player* player)
+    {
+        Eluna::Push(L, player->GetSession()->IsPremium());
+        return 1;
+    }
+
     /*int BindToInstance(lua_State* L, Player* player)
     {
     player->BindToInstance();

Then after you've re-compiled your code. Edit the lua file and change the:

Code:
local rank = player:GetGMRank()

To:

Code:
local rank = player:GetPremiumRank()

If you don't have access to the source code you can run a query in the lua script that retrieves the premium rank from the database.
 
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
gracias
 
Last edited:

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
If I understood you correctly you're trying to use IsPremium instead of GetGMRank.


You'll have to modify your source if you want to be able to use that function that retrieves the IsPremium rank.


Diff:
diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp
index d783ef9..2f1221b 100644
--- a/LuaFunctions.cpp
+++ b/LuaFunctions.cpp
@@ -761,6 +761,7 @@ ElunaRegister<Player> PlayerMethods[] =
     { "ResetHonor", &LuaPlayer::ResetHonor },
     { "ClearHonorInfo", &LuaPlayer::ClearHonorInfo },
 #endif
+    { "GetPremiumRank", &LuaPlayer::GetPremiumRank },
 
     { NULL, NULL }
 };
diff --git a/PlayerMethods.h b/PlayerMethods.h
index 89e2ed4..269a33a 100644
--- a/PlayerMethods.h
+++ b/PlayerMethods.h
@@ -4209,6 +4209,15 @@ namespace LuaPlayer
     }
 #endif
 
+    /**
+     * Retrieves the IsPremium rank
+     */
+    int GetPremiumRank(lua_State* L, Player* player)
+    {
+        Eluna::Push(L, player->GetSession()->IsPremium());
+        return 1;
+    }
+
     /*int BindToInstance(lua_State* L, Player* player)
     {
     player->BindToInstance();

Then after you've re-compiled your code. Edit the lua file and change the:

Code:
local rank = player:GetGMRank()

To:

Code:
local rank = player:GetPremiumRank()

If you don't have access to the source code you can run a query in the lua script that retrieves the premium rank from the database.

I have an error when compiling it source my source rev 61
I edited the source as you sent but it throws an error when compiling

?hash=4e318498f14843655cc98c2fb97c2440.png
 

Alistar

Divine
Divine
Alistar Rep
1
0
0
Rep
1
Alistar Vouches
0
0
0
Vouches
0
Posts
55
Likes
79
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 320 XP
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

Alistar

Divine
Divine
Alistar Rep
1
0
0
Rep
1
Alistar Vouches
0
0
0
Vouches
0
Posts
55
Likes
79
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 320 XP
that's LuaFunctions.cpp



that's PlayerMethods.h


In PlayerMethods.h.

Change:

C++:
int GetPremiumRank(lua_State* L, Player* player)

To:
C++:
int GetPremiumRank(Eluna* /*E*/, lua_State* L, Player* player)
 
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
In PlayerMethods.h.

Change:

C++:
int GetPremiumRank(lua_State* L, Player* player)

To:
C++:
int GetPremiumRank(Eluna* /*E*/, lua_State* L, Player* player)
Thank you very much, a query worked for me, this modification does not affect the ranks of Staff between the commands and other things
 

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
In PlayerMethods.h.

Change:

C++:
int GetPremiumRank(lua_State* L, Player* player)

To:
C++:
int GetPremiumRank(Eluna* /*E*/, lua_State* L, Player* player)
One more question I have 3 different VIPs is I show you a photo, it only gives me if I put 1 or 2 or 3 I have to choose which VIP will work for me with the lua, what I want is to work with the 3 VIPs that are VIP 1, VIP 2 and VIP 3

?hash=85c7303e894689fe2ac81b12027630c2.png
 

3,390

1,271

9,555

428

Top