• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Custom Command Vip on / off

kusanagy

Respected Member
Hi guys, here I bring you a custom vip command.
I hope it will serve someone who needs it.

good luck! : D

Custom table SQL - Insert in Auth

HTML:
/*
Navicat MySQL Data Transfer

Source Server         : DarkFallen
Source Server Version : 50626
Source Host           : localhost:3306
Source Database       : auth

Target Server Type    : MYSQL
Target Server Version : 50626
File Encoding         : 65001

Date: 2017-01-29 01:05:41
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for account_vip
-- ----------------------------
DROP TABLE IF EXISTS `account_vip`;
CREATE TABLE `account_vip` (
  `AccountId` int(11) NOT NULL DEFAULT '0',
  `Vip_Level` int(11) NOT NULL DEFAULT '0',
  `active` int(11) DEFAULT NULL,
  PRIMARY KEY (`AccountId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of account_vip
-- ----------------------------


Custom Script Lua

Code:
-- Designed by EmuServers Dev

local VIP = 1 
local active_1 = 1 
local active_0 = 0


-- Custom Spell List
local Spell1 = 15366
local Spell2 = 16609
local Spell3 = 48162
local Spell4 = 48074
local Spell5 = 48170
local Spell6 = 43223
local Spell7 = 36880
local Spell8 = 467
local Spell9 = 69994
local Spell10 = 33081
local Spell11 = 24705
local Spell12 = 26035
local Spell13 = 48469

-- Custom Text Modify this.

local NoVIP1	 = "|cffff0000[SystemVip]|r I am sorry"
local NoVIP2     = "You not are VIP |r"
--Custom Text VIP Command
local ActiveVip1 = "|cffff0000[SystemVip]|r"
local ActiveVip2 = "Please activate your vip on"
-- Custom Vip oN
local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
-- Custom Vip Off
local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
-- Custom Buff Active
local Buff = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"


local function CustomVipActive(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == ".vip on") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOnHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end
	
local function CustomVipOff(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == ".vip off") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOffHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end

local function Custom0OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#buff") then  -- 
        if (result) then
            OnMenu0Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom1OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#repairmyitems") then  -- 
        if (result) then
            OnMenu1Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom2OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#bank") then  -- 
        if (result) then
            OnMenu2Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom3OnChat(event, player, msg, _, lang)
	local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
	if (msg == "#televip") then  -- 
		if (result3) then
			OnMenu3Hello(event, player)		
		else
			player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
		end
	end
end

function OnMenuVipOnHello(envent, player)
AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
end

function OnMenuVipOffHello(envent, player)
AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
end

function OnMenu0Hello(event, player)
    player:CastSpell(player, Spell1, true)
    player:CastSpell(player, Spell2, true)
    player:CastSpell(player, Spell3, true)
    player:CastSpell(player, Spell4, true)
    player:CastSpell(player, Spell5, true)
    player:CastSpell(player, Spell6, true)
    player:CastSpell(player, Spell7, true)
    player:CastSpell(player, Spell8, true)
    player:CastSpell(player, Spell9, true)
    player:CastSpell(player, Spell10, true)
    player:CastSpell(player, Spell11, true)
    player:CastSpell(player, Spell12, true)
    player:CastSpell(player, Spell13, true)
    player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
    player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
end


local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
local Bank = "|cff00ff00Bank of |cffff0000"
local MsgTele = "|cff00FF1DTeleporting [zone vip]"
	
function OnMenu1Hello(event, player)
	player:DurabilityRepairAll()
	player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
	player:GossipComplete()
end
	
	
function OnMenu2Hello(event, player)
	player:SendShowBank(player)
	player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
	player:GossipComplete()
end
	
function OnMenu3Hello(event, player)
	player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
	player:Dismount()
	player:SendBroadcastMessage(""..MsgTele"..")
	player:SendNotification("|cff00FF1DWait a minute.....")
	player:GossipComplete()
end
	
local function VIPLogout (event, player) --This Remove Vip On.
	AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
end


RegisterPlayerEvent(4, VIPLogout)
RegisterPlayerEvent(18, Custom0OnChat)
RegisterPlayerEvent(18, Custom1OnChat)
RegisterPlayerEvent(18, Custom2OnChat)
RegisterPlayerEvent(18, Custom3OnChat)
RegisterPlayerEvent(18, CustomVipActive)
RegisterPlayerEvent(18, CustomVipOff)
print("+ Script VIP-System Active +")
 
Last edited:

Marko

Enthusiast
not working

Thanks, but i don't know how to use the .vip on or .vip off command.. added those to commands table in db and ofc executed ur sql and added this script to scripts folder.. but nothing happens, not a single command works at all, no .buff , no .televip no nothing :juggle:

have no lua errors and am using latest TC with eluna
 
Last edited:

slp13at420

Mad Scientist
added those to commands table in db

You dont need to add these commands to the RBAC DB.
the Reason it wont work is the script is anticipating a '.' at the start of the msg but the core parses that out as soon as it sees it and then processes the message as a command. but since there are no handlers for these commands it then gets passed to the lua engine from the core with the '.' removed and hooked to event 42(Command) . NOT event 18(CHAT).

Code:
[COLOR="#808080"]
-- Designed by EmuServers Dev

local VIP = 1 
local active_1 = 1 
local active_0 = 0


-- Custom Spell List
local Spell1 = 15366
local Spell2 = 16609
local Spell3 = 48162
local Spell4 = 48074
local Spell5 = 48170
local Spell6 = 43223
local Spell7 = 36880
local Spell8 = 467
local Spell9 = 69994
local Spell10 = 33081
local Spell11 = 24705
local Spell12 = 26035
local Spell13 = 48469

-- Custom Text Modify this.

local NoVIP1	 = "|cffff0000[SystemVip]|r I am sorry"
local NoVIP2     = "Tu no eres VIP |r"
--Custom Text VIP Command
local ActiveVip1 = "|cffff0000[SystemVip]|r"
local ActiveVip2 = "Please activate your vip on"
-- Custom Vip oN
local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
-- Custom Vip Off
local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
-- Custom Buff Active
local Buff = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"


local function CustomVipActive(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == "vip on") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOnHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end
	
local function CustomVipOff(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == "vip off") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOffHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end

local function Custom0OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "buff") then  -- 
        if (result) then
            OnMenu0Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom1OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "repairmyitems") then  -- 
        if (result) then
            OnMenu1Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom2OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "bank") then  -- 
        if (result) then
            OnMenu2Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom3OnChat(event, player, msg, _, lang)
	local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
	if (msg == "televip") then  -- 
		if (result3) then
			OnMenu3Hello(event, player)		
		else
			player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
		end
	end
end

function OnMenuVipOnHello(envent, player)
AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
end

function OnMenuVipOffHello(envent, player)
AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
end

function OnMenu0Hello(event, player)
    player:CastSpell(player, Spell1, true)
    player:CastSpell(player, Spell2, true)
    player:CastSpell(player, Spell3, true)
    player:CastSpell(player, Spell4, true)
    player:CastSpell(player, Spell5, true)
    player:CastSpell(player, Spell6, true)
    player:CastSpell(player, Spell7, true)
    player:CastSpell(player, Spell8, true)
    player:CastSpell(player, Spell9, true)
    player:CastSpell(player, Spell10, true)
    player:CastSpell(player, Spell11, true)
    player:CastSpell(player, Spell12, true)
    player:CastSpell(player, Spell13, true)
    player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
    player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
end


local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
local Bank = "|cff00ff00Bank of |cffff0000"
local MsgTele = "|cff00FF1DTeleporting [zone vip]"
	
function OnMenu1Hello(event, player)
	player:DurabilityRepairAll()
	player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
	player:GossipComplete()
end
	
	
function OnMenu2Hello(event, player)
	player:SendShowBank(player)
	player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
	player:GossipComplete()
end
	
function OnMenu3Hello(event, player)
	player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
	player:Dismount()
	player:SendBroadcastMessage(""..MsgTele"..")
	player:SendNotification("|cff00FF1DWait a minute.....")
	player:GossipComplete()
end
	
local function VIPLogout (event, player) --This Remove Vip On.
	AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
end


RegisterPlayerEvent(4, VIPLogout)
RegisterPlayerEvent(42, Custom0OnChat)
RegisterPlayerEvent(42, Custom1OnChat)
RegisterPlayerEvent(42, Custom2OnChat)
RegisterPlayerEvent(42, Custom3OnChat)
RegisterPlayerEvent(42, CustomVipActive)
RegisterPlayerEvent(42, CustomVipOff)

print("+ Script VIP-System Active +")
[/COLOR]

I didnt test anything though lol.

has a real ArcEmu feel to it ....
 

kusanagy

Respected Member
still nothing happens and still no errors :(

This script, was tested on Trinitycore Eluna Rev.61 and I work well.
Just add the account ID to "account_vip" AccountId and check the box "Vip_Level" = 1
Now inside the game use .vip on / vip off

- - - Updated - - -

You dont need to add these commands to the RBAC DB.
the Reason it wont work is the script is anticipating a '.' at the start of the msg but the core parses that out as soon as it sees it and then processes the message as a command. but since there are no handlers for these commands it then gets passed to the lua engine from the core with the '.' removed and hooked to event 42(Command) . NOT event 18(CHAT).

Code:
[COLOR="#808080"]
-- Designed by EmuServers Dev

local VIP = 1 
local active_1 = 1 
local active_0 = 0


-- Custom Spell List
local Spell1 = 15366
local Spell2 = 16609
local Spell3 = 48162
local Spell4 = 48074
local Spell5 = 48170
local Spell6 = 43223
local Spell7 = 36880
local Spell8 = 467
local Spell9 = 69994
local Spell10 = 33081
local Spell11 = 24705
local Spell12 = 26035
local Spell13 = 48469

-- Custom Text Modify this.

local NoVIP1	 = "|cffff0000[SystemVip]|r I am sorry"
local NoVIP2     = "Tu no eres VIP |r"
--Custom Text VIP Command
local ActiveVip1 = "|cffff0000[SystemVip]|r"
local ActiveVip2 = "Please activate your vip on"
-- Custom Vip oN
local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
-- Custom Vip Off
local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
-- Custom Buff Active
local Buff = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"


local function CustomVipActive(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == "vip on") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOnHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end
	
local function CustomVipOff(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == "vip off") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOffHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end

local function Custom0OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "buff") then  -- 
        if (result) then
            OnMenu0Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom1OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "repairmyitems") then  -- 
        if (result) then
            OnMenu1Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom2OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "bank") then  -- 
        if (result) then
            OnMenu2Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom3OnChat(event, player, msg, _, lang)
	local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
	if (msg == "televip") then  -- 
		if (result3) then
			OnMenu3Hello(event, player)		
		else
			player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
		end
	end
end

function OnMenuVipOnHello(envent, player)
AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
end

function OnMenuVipOffHello(envent, player)
AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
end

function OnMenu0Hello(event, player)
    player:CastSpell(player, Spell1, true)
    player:CastSpell(player, Spell2, true)
    player:CastSpell(player, Spell3, true)
    player:CastSpell(player, Spell4, true)
    player:CastSpell(player, Spell5, true)
    player:CastSpell(player, Spell6, true)
    player:CastSpell(player, Spell7, true)
    player:CastSpell(player, Spell8, true)
    player:CastSpell(player, Spell9, true)
    player:CastSpell(player, Spell10, true)
    player:CastSpell(player, Spell11, true)
    player:CastSpell(player, Spell12, true)
    player:CastSpell(player, Spell13, true)
    player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
    player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
end


local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
local Bank = "|cff00ff00Bank of |cffff0000"
local MsgTele = "|cff00FF1DTeleporting [zone vip]"
	
function OnMenu1Hello(event, player)
	player:DurabilityRepairAll()
	player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
	player:GossipComplete()
end
	
	
function OnMenu2Hello(event, player)
	player:SendShowBank(player)
	player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
	player:GossipComplete()
end
	
function OnMenu3Hello(event, player)
	player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
	player:Dismount()
	player:SendBroadcastMessage(""..MsgTele"..")
	player:SendNotification("|cff00FF1DWait a minute.....")
	player:GossipComplete()
end
	
local function VIPLogout (event, player) --This Remove Vip On.
	AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
end


RegisterPlayerEvent(4, VIPLogout)
RegisterPlayerEvent(42, Custom0OnChat)
RegisterPlayerEvent(42, Custom1OnChat)
RegisterPlayerEvent(42, Custom2OnChat)
RegisterPlayerEvent(42, Custom3OnChat)
RegisterPlayerEvent(42, CustomVipActive)
RegisterPlayerEvent(42, CustomVipOff)

print("+ Script VIP-System Active +")
[/COLOR]

I didnt test anything though lol.

has a real ArcEmu feel to it ....

check this.
http://eluna.emudevs.com/Global/RegisterPlayerEvent.html

PLAYER_EVENT_ON_CHAT = 18, // (event, player, msg, Type, lang) -

enum PlayerEvents
{
PLAYER_EVENT_ON_CHARACTER_CREATE = 1, // (event, player)
PLAYER_EVENT_ON_CHARACTER_DELETE = 2, // (event, guid)
PLAYER_EVENT_ON_LOGIN = 3, // (event, player)
PLAYER_EVENT_ON_LOGOUT = 4, // (event, player)
PLAYER_EVENT_ON_SPELL_CAST = 5, // (event, player, spell, skipCheck)
PLAYER_EVENT_ON_KILL_PLAYER = 6, // (event, killer, killed)
PLAYER_EVENT_ON_KILL_CREATURE = 7, // (event, killer, killed)
PLAYER_EVENT_ON_KILLED_BY_CREATURE = 8, // (event, killer, killed)
PLAYER_EVENT_ON_DUEL_REQUEST = 9, // (event, target, challenger)
PLAYER_EVENT_ON_DUEL_START = 10, // (event, player1, player2)
PLAYER_EVENT_ON_DUEL_END = 11, // (event, winner, loser, type)
PLAYER_EVENT_ON_GIVE_XP = 12, // (event, player, amount, victim) - Can return new XP amount
PLAYER_EVENT_ON_LEVEL_CHANGE = 13, // (event, player, oldLevel)
PLAYER_EVENT_ON_MONEY_CHANGE = 14, // (event, player, amount)
PLAYER_EVENT_ON_REPUTATION_CHANGE = 15, // (event, player, factionId, standing, incremental) - Can return new standing
PLAYER_EVENT_ON_TALENTS_CHANGE = 16, // (event, player, points)
PLAYER_EVENT_ON_TALENTS_RESET = 17, // (event, player, noCost)
PLAYER_EVENT_ON_CHAT = 18, // (event, player, msg, Type, lang) - Can return false or new msg
PLAYER_EVENT_ON_WHISPER = 19, // (event, player, msg, Type, lang, receiver) - Can return false or new msg
PLAYER_EVENT_ON_GROUP_CHAT = 20, // (event, player, msg, Type, lang, group) - Can return false or new msg
PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild) - Can return false or new msg
PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - Can return false or new msg
PLAYER_EVENT_ON_EMOTE = 23, // (event, player, emote) - Not triggered on any known emote
PLAYER_EVENT_ON_TEXT_EMOTE = 24, // (event, player, textEmote, emoteNum, guid)
PLAYER_EVENT_ON_SAVE = 25, // (event, player)
PLAYER_EVENT_ON_BIND_TO_INSTANCE = 26, // (event, player, difficulty, mapid, permanent)
PLAYER_EVENT_ON_UPDATE_ZONE = 27, // (event, player, newZone, newArea)
PLAYER_EVENT_ON_MAP_CHANGE = 28, // (event, player)

// Custom
PLAYER_EVENT_ON_EQUIP = 29, // (event, player, item, bag, slot)
PLAYER_EVENT_ON_FIRST_LOGIN = 30, // (event, player)
PLAYER_EVENT_ON_CAN_USE_ITEM = 31, // (event, player, itemEntry)
PLAYER_EVENT_ON_LOOT_ITEM = 32, // (event, player, item, count)
PLAYER_EVENT_ON_ENTER_COMBAT = 33, // (event, player, enemy)
PLAYER_EVENT_ON_LEAVE_COMBAT = 34, // (event, player)
PLAYER_EVENT_ON_REPOP = 35, // (event, player)
PLAYER_EVENT_ON_RESURRECT = 36, // (event, player)
PLAYER_EVENT_ON_LOOT_MONEY = 37, // (event, player, amount)
PLAYER_EVENT_ON_QUEST_ABANDON = 38, // (event, player, questId)
// UNUSED = 39, // (event, player)
// UNUSED = 40, // (event, player)
// UNUSED = 41, // (event, player)
PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command) - player is nil if command used from console. Can return false

PLAYER_EVENT_COUNT
};
 

kusanagy

Respected Member
Thanks, but i don't know how to use the .vip on or .vip off command.. added those to commands table in db and ofc executed ur sql and added this script to scripts folder.. but nothing happens, not a single command works at all, no .buff , no .televip no nothing :juggle:

have no lua errors and am using latest TC with eluna



Try with :

.vip on (try change the . for # )
.vip off (try change the . for # )
#bank
#buff
#televip
#repairmyitems
Code:
-- Designed by EmuServers Dev

local VIP = 1 
local active_1 = 1 
local active_0 = 0


-- Custom Spell List
local Spell1 = 15366
local Spell2 = 16609
local Spell3 = 48162
local Spell4 = 48074
local Spell5 = 48170
local Spell6 = 43223
local Spell7 = 36880
local Spell8 = 467
local Spell9 = 69994
local Spell10 = 33081
local Spell11 = 24705
local Spell12 = 26035
local Spell13 = 48469

-- Custom Text Modify this.

local NoVIP1	 = "|cffff0000[SystemVip]|r I am sorry"
local NoVIP2     = "You not are VIP |r"
--Custom Text VIP Command
local ActiveVip1 = "|cffff0000[SystemVip]|r"
local ActiveVip2 = "Please activate your vip on"
-- Custom Vip oN
local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
-- Custom Vip Off
local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
-- Custom Buff Active
local Buff = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"


local function CustomVipActive(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == ".vip on") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOnHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end
	
local function CustomVipOff(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
    if (msg == ".vip off") then  -- Use #premium for sending the gossip menu
		if (result) then
			OnMenuVipOffHello(event, player)
		else
			player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
		end
	end
end

local function Custom0OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#buff") then  -- 
        if (result) then
            OnMenu0Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom1OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#repairmyitems") then  -- 
        if (result) then
            OnMenu1Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom2OnChat(event, player, msg, _, lang)
    local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
    if (msg == "#bank") then  -- 
        if (result) then
            OnMenu2Hello(event, player)
        else
            player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
        end
    end
end

local function Custom3OnChat(event, player, msg, _, lang)
	local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
	if (msg == "#televip") then  -- 
		if (result3) then
			OnMenu3Hello(event, player)		
		else
			player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
		end
	end
end

function OnMenuVipOnHello(envent, player)
AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
end

function OnMenuVipOffHello(envent, player)
AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
end

function OnMenu0Hello(event, player)
    player:CastSpell(player, Spell1, true)
    player:CastSpell(player, Spell2, true)
    player:CastSpell(player, Spell3, true)
    player:CastSpell(player, Spell4, true)
    player:CastSpell(player, Spell5, true)
    player:CastSpell(player, Spell6, true)
    player:CastSpell(player, Spell7, true)
    player:CastSpell(player, Spell8, true)
    player:CastSpell(player, Spell9, true)
    player:CastSpell(player, Spell10, true)
    player:CastSpell(player, Spell11, true)
    player:CastSpell(player, Spell12, true)
    player:CastSpell(player, Spell13, true)
    player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
    player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
end


local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
local Bank = "|cff00ff00Bank of |cffff0000"
local MsgTele = "|cff00FF1DTeleporting [zone vip]"
	
function OnMenu1Hello(event, player)
	player:DurabilityRepairAll()
	player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
	player:GossipComplete()
end
	
	
function OnMenu2Hello(event, player)
	player:SendShowBank(player)
	player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
	player:GossipComplete()
end
	
function OnMenu3Hello(event, player)
	player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
	player:Dismount()
	player:SendBroadcastMessage(""..MsgTele"..")
	player:SendNotification("|cff00FF1DWait a minute.....")
	player:GossipComplete()
end
	
local function VIPLogout (event, player) --This Remove Vip On.
	AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
end


RegisterPlayerEvent(4, VIPLogout)
RegisterPlayerEvent(18, Custom0OnChat)
RegisterPlayerEvent(18, Custom1OnChat)
RegisterPlayerEvent(18, Custom2OnChat)
RegisterPlayerEvent(18, Custom3OnChat)
RegisterPlayerEvent(18, CustomVipActive)
RegisterPlayerEvent(18, CustomVipOff)
print("+ Script VIP-System Active +")
 
Last edited:

Marko

Enthusiast
still nope

i added my acc to vip table and put there rank 1, but still even with # in front of commands, nothing happens.. i tried manually putting 1 in the active row and even change it to be 1 by default instead of null, but again nothing..
idk if maybe some other lua script is affecting this , but i don't have any vip scripts

btw Grumbo'z VIP script works but i'm not using it atm

Using latest tc wotlk with eluna and db version is the latest 335.62
 
Last edited:
Top