EOSERV Forum > EOSERV > Weird error when adding a code.
Topic is locked.
Page: << 1 >>
Weird error when adding a code.
Author Message
Post #40504 Weird error when adding a code.

Ok so I'm in Welcome.cpp and I added the log in code

        if(this->player->character->name == "snoopieboy");// Use low capitals
            {
                this->server->world->ServerMsg("Snoopie the topless owners online, enjoy everyone >:D"); //Messages that appears once.
                UTIL_PTR_VECTOR_FOREACH(this->server->world->characters, Character, character)
                {
                    character->map->Effect(MAP_EFFECT_QUAKE, 8); // 1 is the str of the quake. It sends to every player online.
                }
            }


And I hit f9 (Build & Run) and Compile, and I keep getting this error:

Welcome.cpp:11: error: expected unqualified-id before '{' token
Process terminated with status 1 (0 minutes, 0 seconds)


Anyone know anything about that error/how to fix it? Thanks:)

15 years, 10 weeks ago
Post #40521 Re: Weird error when adding a code.

There  isn't anything wrong with that piece of code,make sure your adding it in the rite spot:

            reply.AddByte(255);
            UTIL_PTR_VECTOR_FOREACH(updateitems, Map_Item, item)
            {
                reply.AddShort(item->uid);
                reply.AddShort(item->id);
                reply.AddChar(item->x);
                reply.AddChar(item->y);
                reply.AddThree(item->amount);
            }
            CLIENT_SEND(reply);
        }

 (code goes here)

break; 

15 years, 10 weeks ago
Post #40529 Re: Weird error when adding a code.

That's the exact same place I put the code in, but I get this error:


Welcome.cpp:11: error: expected unqualified-id before '{' token

15 years, 10 weeks ago
Post #40568 Re: Weird error when adding a code.

There is a semi colon ; after your first 'if' statement. Get rid of that. 

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
15 years, 9 weeks ago
Post #40574 Re: Weird error when adding a code.
ethanmoffat posted: (21st Jun 2010 06:23 am)

There is a semi colon ; after your first 'if' statement. Get rid of that. 


Ok, ty, that got rid of that error but now theres a different error that I've had before, I've solved it before but forgot what was solution, know anything?

Welcome.cpp:7: error: expected constructor, destructor, or type conversion before '(' token
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 

15 years, 9 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > Weird error when adding a code.