Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 2 of 2

Thread: C++

  1. #1
    Senior Sergeant
    MikExV™'s Avatar
    Join Date
    Feb 2010
    Location
    Ohio
    Posts
    117
    Post Thanks / Like
    Rep Power
    15
    Reputation
    35

    C++


    Register to remove this ad
    When I compile I get this error
    Code:
    1>------ Build started: Project: ExtraScripts, Configuration: Release Win32 ------
    1>Compiling...
    1>Bag Stone.cpp
    1>..\..\..\..\..\Bag Stone.cpp(1) : warning C4627: '#include "StdAfx.h"': skipped when looking for precompiled header use
    1>        Add directive to 'Setup.h' or rebuild precompiled header
    1>..\..\..\..\..\Bag Stone.cpp(10) : error C2470: 'Stone' : looks like a function definition, but there is no parameter list; skipping apparent body
    1>..\..\..\..\..\Bag Stone.cpp(22) : error C2653: 'Stone' : is not a class or namespace name
    1>..\..\..\..\..\Bag Stone.cpp(22) : error C2146: syntax error : missing ';' before identifier 'GossipHello'
    1>..\..\..\..\..\Bag Stone.cpp(22) : error C2182: 'Bag' : illegal use of type 'void'
    1>..\..\..\..\..\Bag Stone.cpp(23) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>..\..\..\..\..\Bag Stone.cpp(27) : warning C4508: 'GossipHello' : function should return a value; 'void' return type assumed
    1>..\..\..\..\..\Bag Stone.cpp(40) : error C2653: 'Stone' : is not a class or namespace name
    1>..\..\..\..\..\Bag Stone.cpp(40) : error C2146: syntax error : missing ';' before identifier 'GossipSelectOption'
    1>..\..\..\..\..\Bag Stone.cpp(40) : error C2182: 'Bag' : illegal use of type 'void'
    1>..\..\..\..\..\Bag Stone.cpp(40) : error C2086: 'int Bag' : redefinition
    1>        ..\..\..\..\..\Bag Stone.cpp(22) : see declaration of 'Bag'
    1>..\..\..\..\..\Bag Stone.cpp(41) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>..\..\..\..\..\Bag Stone.cpp(66) : error C2143: syntax error : missing ';' before '}'
    1>..\..\..\..\..\Bag Stone.cpp(71) : error C2039: 'Gossip_Compelete' : is not a member of 'Player'
    1>        c:\wowserver\compile\trunk\src\arcemu-world\Player.h(906) : see declaration of 'Player'
    1>..\..\..\..\..\Bag Stone.cpp(77) : error C2065: 'i' : undeclared identifier
    1>..\..\..\..\..\Bag Stone.cpp(83) : warning C4508: 'GossipSelectOption' : function should return a value; 'void' return type assumed
    1>..\..\..\..\..\Bag Stone.cpp(84) : error C2059: syntax error : '}'
    1>..\..\..\..\..\Bag Stone.cpp(84) : error C2143: syntax error : missing ';' before '}'
    1>..\..\..\..\..\Bag Stone.cpp(84) : error C2059: syntax error : '}'
    1>..\..\..\..\..\Bag Stone.cpp(86) : error C2653: 'Teleporter' : is not a class or namespace name
    1>..\..\..\..\..\Bag Stone.cpp(87) : error C2143: syntax error : missing ';' before '{'
    1>..\..\..\..\..\Bag Stone.cpp(87) : error C2447: '{' : missing function header (old-style formal list?)
    1>..\..\..\..\..\Bag Stone.cpp(93) : error C2061: syntax error : identifier 'Teleporter'
    1>Build log was saved at "file://c:\WoWServer\HighRate Core\trunk\src\scripts\projects\2003_int_release\BuildLog.htm"
    1>ExtraScripts - 20 error(s), 3 warning(s)
    ========== Build: 0 succeeded, 1 failed, 5 up-to-date, 0 skipped ==========
    The Script Im trying to compile is
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)
    #endif
    
    #define STONEID 6948
    
    class SCRIPT_DECL Bag Stone : public GossipScript
    {
        public:
            void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
            void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
            void GossipEnd(Object * pObject, Player* Plr);
            void Destroy()
            {
                delete this;
            }
    };
    
    void Bag Stone::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
              {
              if(Plr->CombatStatus.IsInCombat()) 
                {          
              Plr->BroadcastMessage("You are in combat!");   
              return;
              }
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
    {
    Menu->AddItem(7,"To The Mall", 1);
    Menu->AddItem(3,"Use Hearthstone", 2);
    Menu->AddItem(3,"Custom Instances", 3);
    Menu->AddItem(4,"Teach me all Flight Paths!", 5);
    if(AutoSend)
    Menu->SendTo(Plr);
    }}
    
    void Bag Stone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
            GossipMenu * Menu;
            switch(IntId)
    {
            case 0:
            GossipHello(pObject, Plr, true);
            break;
    
            case 2:
                {
                    Plr->CastSpell(Plr, 8690, 0);
                    Plr->Gossip_Complete();
                }
                break;
    
            case 1:
                {
                    Plr->EventTeleport(0, -9276.238281, -2288.817627, 67.916161);
                    Plr->Gossip_Complete();
                }
                break;
    
            case 3:
                {
                    Menu->AddItem(2,"This Function Is Currently Disabled, We appoligize for any inconvenience", 4)
                }
                break;
    
            case 4:
                {
                    Plr->Gossip_Compelete();
                }
                break;
    
            case 5:
                {
                  Plr->SetTaximask(i, 0xFFFFFFFF);
                  Plr->Gossip_Complete();
                }
                break;
    
    }
                 }
           }
           
          void Teleporter::GossipEnd(Object * pObject, Player* Plr)
          {
              GossipScript::GossipEnd(pObject, Plr);
          }
           
          void Teleporter(ScriptMgr * mgr)
          {
              GossipScript * gs = (GossipScript*) new Teleporter();
              mgr->register_gossip_script(112230, gs);
          }
    I made the script when i got bored, im new to C++ Thats why im asking for h3lp I have tried every thing I could think of!


    › See More: C++

    Just got my pc back

  2. #2
    Grunt
    Sdyess94's Avatar
    Join Date
    Jan 2009
    Posts
    36
    Post Thanks / Like
    Rep Power
    16
    Reputation
    60

    Register to remove this ad
    Firstly, function names can't have spaces. So things like
    Code:
     void Bag Stone
    should be something like
    Code:
     void Bag_Stone
    The rest I'd have to look over tomorrow when I get home.




  3. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

 

 

Visitors found this page by searching for:

custom hearthstone teleporter

Hearthstone Teleporter c

#define stoneid 6948

item custom stone.cpp trinity

Hearthstone c trinity

trinity gossipmenu to hearthstone

c stones in bag

error c2039: additem : is not a member of player4

c scripted hearthstone for trinitycore

is not a class or namespace name arcemu

c teleporter stone

heartstone teleporter trinty

Stone.cpp in c

hearthstone teleporter trinity

what is the bag1.h precompiled header in c

8690 hearthstone teleporter

aremu hearthstone teleporter

mangos hearthstone teleporter#sclient=psy

arcemu cpp(83): error C2039: : is not a member of Player

trinity custom hearthstone c

c mangos hearthstone teleporter

c return void illegal use of type void

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 08:35 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org