Jump to content
WoWBB.org

Vip Access Token on CLICK TO ACTIVATE


cyberpro98

Recommended Posts

Hi guys, i am trying to make an script like when i press on the VIP ACCESS TOKEN to activate it and it should kick me from the game. 

But unfortunately it doesn´t work at all i can click on it 10000times but it doesn´t  work... It destroysitself as it says when i click on it lol .. 

 

Here is the script for 335 Trinity

Any help would be good! 

 

#include "ScriptPCH.h"
#include <cstring>
#include "Chat.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Common.h"
#include "Language.h"
#include "CellImpl.h"
#include "GridNotifiers.h"

class vip_access : public ItemScript
{
public:
    vip_access() : ItemScript("vip_access")
    {
    }


static bool vip_access_OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
{
    if (!pPlayer)
        return false;

    if (!pItem)
        return false;

    if (pPlayer->GetSession()->GetSecurity() == SEC_VIP)
    {
        pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true);
        LoginDatabase.PExecute("INSERT INTO account_access VALUES('%u', '1', '1')", pPlayer->GetSession()->GetAccountId());
        pPlayer->SaveToDB();
        pPlayer->GetSession()->KickPlayer();
        return true;
    }
    else
    {
        pPlayer->GetSession()->SendNotification("|cffff0000You already have a VIP Access!");
        return false;
    }
}
};

void AddSC_vipaccess()
{
    new vip_access();
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...