- Joined
- Jul 16, 2006
- Messages
- 50
- Reaction score
- 5
Found error this part
-----------------------
BAN COMMAND:
else if(_stricmp(command, "ban") == 0){ //check if it is the ban command
char* who = strtok_s(NULL, " ",&next_token); //take the next part just after the space after the ban word, wich is the player name
Player* who2 = getPlayerByName(who); //take the player by player name
int acc_id;
if (who2 != NULL) //if who2 is different of NULL, the player is online
{
who2->setAccessLevel(0); //sets it accesslevel ingame to 0
acc_id = who2->getOwner(); //takes the account id of that char
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
}
else
{
char * sAcc_id = new char[]; //variable to store the account id from the characters table
MySQL::getString("characters", "name", who, "owner", sAcc_id); //takes the account id
acc_id = strval(sAcc_id); //take account id as integer
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
delete[] sAcc_id; //delete sAcc_id from the memory(if you dont do, nobody will do for you in this case)
}
return true; //dont let !ban <player name> appears at the screen
}
-----------------------
I have done everything except the ban part, when I remove the Ban command codes, the errors gone 0 errors, 4 warnings, but when the ban codes are in the Players.cpp found 6 errors, 4 warnings,
the errors
----------------------------
2>Players.cpp
2>c:\dragonflyff_source\gameserver\players.cpp(387) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(387) : error C3861: 'setInt': identifier not found
2>c:\dragonflyff_source\gameserver\players.cpp(392) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(392) : error C2661: 'getString' : no overloaded function takes 5 arguments
2>c:\dragonflyff_source\gameserver\players.cpp(394) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(394) : error C3861: 'setInt': identifier not found
can't find way to fix it.
-----------------------
BAN COMMAND:
else if(_stricmp(command, "ban") == 0){ //check if it is the ban command
char* who = strtok_s(NULL, " ",&next_token); //take the next part just after the space after the ban word, wich is the player name
Player* who2 = getPlayerByName(who); //take the player by player name
int acc_id;
if (who2 != NULL) //if who2 is different of NULL, the player is online
{
who2->setAccessLevel(0); //sets it accesslevel ingame to 0
acc_id = who2->getOwner(); //takes the account id of that char
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
}
else
{
char * sAcc_id = new char[]; //variable to store the account id from the characters table
MySQL::getString("characters", "name", who, "owner", sAcc_id); //takes the account id
acc_id = strval(sAcc_id); //take account id as integer
MySQL::setInt("accounts", "accesslvl", acc_id, 0); //update the accounts table changing its accesslevel to 0
delete[] sAcc_id; //delete sAcc_id from the memory(if you dont do, nobody will do for you in this case)
}
return true; //dont let !ban <player name> appears at the screen
}
-----------------------
I have done everything except the ban part, when I remove the Ban command codes, the errors gone 0 errors, 4 warnings, but when the ban codes are in the Players.cpp found 6 errors, 4 warnings,
the errors
----------------------------
2>Players.cpp
2>c:\dragonflyff_source\gameserver\players.cpp(387) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(387) : error C3861: 'setInt': identifier not found
2>c:\dragonflyff_source\gameserver\players.cpp(392) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(392) : error C2661: 'getString' : no overloaded function takes 5 arguments
2>c:\dragonflyff_source\gameserver\players.cpp(394) : error C2653: 'MySQL' : is not a class or namespace name
2>c:\dragonflyff_source\gameserver\players.cpp(394) : error C3861: 'setInt': identifier not found
can't find way to fix it.

