NarcoRP
El Diablo Nunca DuermeDivine
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

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

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)