This is made by SefK & Stefkhe from Odin
It let you make GM privileges so normal players can't use GM commands:
Change this in your Players.cpp file:
Make a new field in the Users table:Code:void Players::chatHandler(Player* player, unsigned char* packet){
char chat[91];
int chatsize = getShort(packet);
int isgm;
isgm = MySQL::getInt("users", player->getPlayerid(), "GM");
getString(packet+2, chatsize, chat);
if(chat[0] == '!'){
char* next_token;
char command[90] = "";
if(chatsize>2)
strcpy_s(command, 90, strtok_s(chat+1, " ", &next_token));
if (isgm == 1) {
if(strcmp(command, "map") == 0){
if(strlen(next_token) > 0){
int mapid = strval(strtok_s(NULL, " ",&next_token));
if(Maps::info.find(mapid) != Maps::info.end())
Maps::changeMap(player ,mapid, 0);
}
}
else if(strcmp(command, "summon") == 0){
int mobid = strval(strtok_s(NULL, " ",&next_token));
if(Mobs::mobinfo.find(mobid) == Mobs::mobinfo.end())
return;
int count = 1;
if(strlen(next_token) > 0)
count = strval(next_token);
for(int i=0; i<count && i<100; i++){
Mobs::spawnMob(player, mobid);
}
}
else if(strcmp(command, "notice") == 0){
PlayersPacket::showMassage(next_token, 0);
}
else if(strcmp(command, "shop") == 0){
Shops::showShop(player, 9999999);
}
else if(strcmp(command, "shop2") == 0){
Shops::showShop(player, 9999998);
}
else if(strcmp(command, "pos") == 0){
char text[50];
sprintf_s(text, 50, "X: %d Y: %d", player->getPos().x, player->getPos().y);
PlayersPacket::showMassage(text, 0);
}
else if(strcmp(command, "item") == 0){
int itemid = strval(strtok_s(NULL, " ",&next_token));
if(Drops::items.find(itemid) == Drops::items.end() && Drops::equips.find(itemid) == Drops::equips.end())
return;
int count = 1;
if(strlen(next_token) > 0)
count = strval(next_token);
Inventory::addNewItem(player, itemid, count);
}
else if(strcmp(command, "level") == 0){
Levels::setLevel(player, strval(strtok_s(NULL, " ",&next_token)));
}
else if(strcmp(command, "job") == 0){
Levels::setJob(player, strval(strtok_s(NULL, " ",&next_token)));
}
else if(strcmp(command, "ap") == 0){
player->setAp(player->getAp()+strval(strtok_s(NULL, " ",&next_token)));
}
else if(strcmp(command, "sp") == 0){
player->setSp(player->getSp()+strval(strtok_s(NULL, " ",&next_token)));
}
else if(strcmp(command, "killnpc") == 0){
player->setNPC(NULL);
}
}
else{
char text[28];
sprintf_s(text, 28,"You are not allowed to use this command!");
PlayersPacket::showMassage(text, 5);
}
return;
}
PlayersPacket::showChat(player, Maps::info[player->getMap()].Players, chat);
name: "GM", type: "int", Length: "1", Decimals: "0", and Allow Null: unchecked
1 = GM, nothing or 0 = user
Enjoy :p
}

