Problem with my C++ script menu

Shout-Out

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    #include <string>
    #include <iostream>
    
    using namespace std;
    static string infoHelp, join, start, end;
    static float sx,sy,sz,so;
    static uint32 smapid,sinstanceid;
    static bool evon;
    
    bool EventSystem(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
    {
    	
        if(Message == join)
        {
            if(evon)
            {
                if(pPlayer->CombatStatus.IsInCombat())
                    pPlayer->BroadcastMessage("You cannot teleport in combat.");
                else
                    pPlayer->SafeTeleport(smapid, sinstanceid, sx, sy, sz, so);
            }
    		return false;
        }
        if(Message == start && pPlayer->GetSession()->CanUseCommand('a'))
        {
            if(evon)
                pPlayer->BroadcastMessage("There is already an event summoning wait for it to finish.");
            else
            {
                evon = true;
                char Msg[255];
                sprintf(Msg, "|cff0066cc[Event System]|r |cff00ff00%s has started an event! Type #join to join!|r", pPlayer->GetName());
                sWorld.SendWorldText(Msg);
                sx = pPlayer->GetPositionX();
                sy = pPlayer->GetPositionY();
                sz = pPlayer->GetPositionZ();
                so = pPlayer->GetOrientation();
                smapid = pPlayer->GetMapId();
                sinstanceid = pPlayer->GetInstanceID();
            }
    		return false;
        }
    	
        if(Message == end && pPlayer->GetSession()->CanUseCommand('a'))
        {
            if(evon)
            {
                evon = false;
                char Msg[255];
                sprintf(Msg, "|cff0066cc[Event System]|r |cff00ff00%s has ended summons to the event.", pPlayer->GetName());
                sWorld.SendWorldText(Msg);
            }
            else
                pPlayer->BroadcastMessage("There is no event summoning going on right now.");
            return false;
        }
    	
        return true;
    }
    
    void SetupEventCmd(ScriptMgr * mgr)
    {
    	join = "#join";
    	start = "#eventstart";
    	end = "#eventend";
    	evon = false;
    	
    	mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (bool *) EventSystem);
    }
    Fixed. I had false and true reversed.

    Problem with my C++ script
  2. #17
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you changed the call from void to bool. Typecasted the function to be bool in the SetupEventCmd call. Then changed the function to return true or false!
    I don't care if you changed parts of it, but don't say you wrote it because you DIDN'T. You got his script and changed it(Used it as a base).
    Very different? Uhhhh you decalred all variables the same, included the same includes and headers. Even parts of the script match EXACTLY his. So no, you didn't write it from scratch, KKTHXBAI?

    EDIT: I'm not going to bother, but you have the bool return statements wrongly used.
    Last edited by Clain; 04-06-2009 at 11:19 PM.

  3. #18
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOLLOLOLOLOLLOL




  4. #19
    CoolManBob's Avatar Active Member
    Reputation
    92
    Join Date
    Jul 2006
    Posts
    208
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't mind if you used my script as a base, tbh im glad that you did, it mean I did something right I left it opensource for that exact reason, so others can come, take what I have given them and make it their own, each is unique, and I'm happy to see others are using what I have left behind, cause hell god knows I havn't bothered to fix/update my script, because I have left it up to you, the community to do with it what you will, whether it be to fix it, or improve it, or hell even copy and paste it and claim it as your own (not saying you did this) They say Imitation is the greatest form of flattery, even if you didnt mean it as that

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Problem with online players script and vote system
    By Obly in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 09-29-2010, 03:16 AM
  2. [ArcEmu] Problem with C++ House Script!
    By BloodgultchWoW in forum WoW EMU Questions & Requests
    Replies: 9
    Last Post: 03-11-2010, 10:43 PM
  3. [Help Plzzzz] LUA Problem with KJ Script
    By Arthas117 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-16-2008, 05:25 PM
  4. Problem with lua boss script
    By nickeg in forum WoW EMU Questions & Requests
    Replies: 13
    Last Post: 08-16-2008, 09:22 AM
  5. Problems with my C++ script
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-07-2008, 08:04 AM
All times are GMT -5. The time now is 11:18 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search