Hey guys I'm getting errors with this code. Can anyone help me?
I'll post the Error then current line
Error 1: C:\Users\Server\Desktop\Server\src\handlers\Talk.cpp|154|error: invalid use of 'this' in non-member function|
Line: this->player->character->Warp(Map, x, y, WARP_ANIMATION_ADMIN);
Error 2: C:\Users\Server\Desktop\Server\src\handlers\Talk.cpp|154|error: expected primary-expression before ',' token|
Line:this->player->character->Warp(Map, x, y, WARP_ANIMATION_ADMIN);
Error 3: C:\Users\Server\Desktop\Server\src\handlers\Talk.cpp|154|error: 'x' was not declared in this scope|
Line: this->player->character->Warp(Map, x, y, WARP_ANIMATION_ADMIN);
Error 4: C:\Users\Server\Desktop\Server\src\handlers\Talk.cpp|154|error: 'y' was not declared in this scope|
Line: this->player->character->Warp(Map, x, y, WARP_ANIMATION_ADMIN);
Now here is the whole code, well the section of it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
else if (character->player && message[0] == '#')
{
std::string command;
std::vector<std::string> arguments = util::explode(' ', message);
command = arguments.front().substr(1);
arguments.erase(arguments.begin());
if (command.length() == 4 && command.compare(0,4,"warp") == 0)
{
if (arguments[0] == "where you want it to warp you to")
{
this->player->character->Warp(Map, x, y, WARP_ANIMATION_ADMIN);
}
}
character->world->PlayerCommand(command, arguments, character);
}
| |