Jump to content

Despero

Inactive Member
  • Posts

    153
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    0%

Everything posted by Despero

  1. Can you tell me one thing please? How can gcc know these functions if it's not declared in char.h & char.cpp ? #first error unban & ban are not declared in char.h & char.cpp Kind Regards Ken ~ TA I have edit the topic
  2. M2 Download Center Download Here ( Internal ) Hello first this in Account table DROP TABLE IF EXISTS `ban_list`; CREATE TABLE `ban_list` ( `account` varchar(12) DEFAULT NULL, `reason` varchar(64) DEFAULT NULL, `source` varchar(12) DEFAULT NULL, `date` datetime DEFAULT NULL, `action` enum('ban','unban') DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; and lets go open game/cmd.cpp and search for this: ACMD(do_block_chat); Add this under that: ACMD(do_player_ban); ACMD(do_player_unban); Search for this still in the game/cmd.cpp: { "block_chat_list",do_block_chat_list, 0, POS_DEAD, GM_PLAYER }, Make a new line and add this under that: { "player_unban", do_player_unban, 0, POS_DEAD, GM_IMPLEMENTOR }, { "player_ban", do_player_ban, 0, POS_DEAD, GM_HIGH_WIZARD }, Search for this event in game/cmd_gm.cpp: ACMD(do_block_chat) Add this under that: ACMD (do_player_ban) { if (ch && (ch->GetGMLevel() < GM_HIGH_WIZARD)) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("그런 명령어는 없습니다")); return; } char arg1[256]; argument = one_argument(argument, arg1, sizeof(arg1)); if (!*arg1) { if (ch) ch->ChatPacket(CHAT_TYPE_INFO, "Usage: player_ban <name> <reason>"); return; } const char* name = arg1; char arg2[256]; argument = one_argument(argument, arg2, sizeof(arg2)); if (!*arg2) { if (ch) ch->ChatPacket(CHAT_TYPE_INFO, "Usage: player_ban <name> <reason>"); return; } char* reason; if(!*arg2) reason = (char*) ""; else reason = arg2; sys_log(0, "BAN %s", name); LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name); if (!tch) { ch->ChatPacket(CHAT_TYPE_INFO, "can not find the target!"); return; } if (ch) ch->ChatPacket(CHAT_TYPE_INFO, "ban requested."); if (tch && ch != tch) { if(tch->GetGMLevel() == GM_IMPLEMENTOR) { ch->ChatPacket(CHAT_TYPE_INFO, "Can not ban/unban Administrator!"); } else { tch->ban(reason, ch->GetPlayerID()); } } } ACMD (do_player_unban) { if (ch && (ch->GetGMLevel() < GM_HIGH_WIZARD)) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("그런 명령어는 없습니다")); return; } char arg1[256]; argument = one_argument(argument, arg1, sizeof(arg1)); if (!*arg1) { if (ch) ch->ChatPacket(CHAT_TYPE_INFO, "Usage: player_unban <name>"); return; } char* name = arg1; sys_log(0, "UNBAN %s", name); ch->ChatPacket(CHAT_TYPE_INFO, "player_unban requested."); ch->unban(name); } Search for this event in game/char.cpp int CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const { return CTableBySkill::instance().GetSkillPowerByLevelFromType(GetJob(), GetSkillGroup(), MINMAX(0, level, SKILL_MAX_LEVEL), bMob); } and add this void CHARACTER::ban(char* reason2, unsigned int myid2) { DWORD myself = GetAID(); char * query = (char*) malloc(sizeof(*query)); snprintf(query, 1024, "UPDATE account.account SET status='BLOCK' WHERE id='%u'", myself); SQLMsg * msg = DBManager::instance().DirectQuery(query); if(!msg) { sys_err("cmd_ban: MySQL Query failed!"); } free(query); char * query2 = (char*) malloc(sizeof(*query2)); snprintf(query2, 1024, "INSERT INTO account.ban_list (account, reason, source, date, action) VALUES('%u', '%s', '%u', NOW(), 'ban')", myself, reason2, myid2); //const char * query2 = "INSERT INTO account.ban_list (account, reason, source) VALUES('%d', '%d', '%s')", GetAID(), myid2, reason2; SQLMsg * msg2 = DBManager::instance().DirectQuery(query2); if(!msg2) { sys_err("cmd_ban: MySQL Query2 failed!"); } free(query2); M2_DELETE(query); M2_DELETE(query2); M2_DELETE(msg); M2_DELETE(msg2); char * resulttxt = (char*) malloc(sizeof(*query2)); snprintf(resulttxt, 1024, "%s %s", LC_TEXT("You were banned! Reason:"), reason2); ChatPacket(CHAT_TYPE_INFO, resulttxt); GetDesc()->DelayedDisconnect(3); M2_DELETE(resulttxt); } void CHARACTER::unban(char* name) { char * query = (char*) malloc(sizeof(*query)); snprintf(query, 1024, "UPDATE account.account INNER JOIN player.player ON player.account_id=account.id SET status='OK' WHERE player.name='%s'", name); //snprintf(query, 1024, "UPDATE account.account SET status='OK' WHERE id='%u'", GetAID()); SQLMsg * msg = DBManager::instance().DirectQuery(query); if(!msg) { sys_err("cmd_unban: MySQL Query failed!"); } free(query); char * query2 = (char*) malloc(sizeof(*query)); snprintf(query2, 1024, "INSERT INTO account.ban_list (account, reason, source, date, action) VALUES(0, '%s', '%u', NOW(), 'unban')", name, GetPlayerID()); //snprintf(query, 1024, "UPDATE account.account SET status='OK' WHERE id='%u'", GetAID()); SQLMsg * msg2 = DBManager::instance().DirectQuery(query2); if(!msg2) { sys_err("cmd_unban: MySQL Query failed!"); } free(query2); M2_DELETE(query2); M2_DELETE(msg2); M2_DELETE(query); M2_DELETE(msg); } and now open game/char.h search this void StartAffectEvent(); and add this void ban(char* reason2, unsigned int myid2); void unban(char* name); Kind Regards, Despero
  3. PUBLIC PLEASE the Extern Folder
  4. Hello Metin2DEV. this is a how to for pets like npc_pet folder from GameForge in your client. +added check for (d:/ymir work/)npc_pet folder to see the new pets open GameLib/RaceManager.cpp Search this void __GetRaceResourcePathes(unsigned race, std::vector <std::string>& vec_stPathes) and add this: else if (race>=34001 && race<=34031) { vec_stPathes.push_back ("d:/ymir work/npc_pet/"); } Screen: and you can add all your pets in npc_pet folder and test it . 34001 = Phönix Pet ( First Pet from GameForge) 34031 = Latest Pet from new 2015 Update ( make 34040 for more Updates ) Sorry for my BAD english
  5. When i use 5 Inventory can i remove the Pots in Belt with other Pots [Hidden Content]
  6. For LEVEL: InstanceBaseEffect.cpp Search sprintf(szText, "Lv %d", level); Replace sprintf(szText, "[Lv %d]", level);
  7. Hello M2Dev, i need this quest functions for mainline_released source item2.equip item2.get_attr item2.get_wearflag item2.is_wearflag item2.set_attr npc2.get_level npc2.get_pc_pid npc2.get_pc_vid npc2.select pc2.give_or_drop_item_and_select pc2.send_effect pc2.set_level A how to with this Quest functions was very nice Here is the topic from the QUest functions [Hidden Content]
  8. I cant find the -library builder ? I have bad magic number in traceback.py
  9. Thanks ! I have last problem: [Hidden Content]
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.