Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/21/20 in all areas

  1. 1 point
    setd "#Attendance_" + gettime(DT_YYYYMMDD),true; bad script design let's say the player has attended this script for 300 days, then it will have 299 unnecessary variables pile up in `acc_reg_num_db` table this kind of variable only use once, so set only 1 variable enough, with the value on date format no.2 from my understanding, your script even use loop ... why not just use gettimetick(2) when login, `@timelogin` = gettimetick(2), when npc check, (gettimetick(2) - `@timelogin`) .... no,3 and why not just write everything with source code =/ no need loop, every variable and function you want is readily served in source code nvm, let me show you if its done entirely with source code https://gist.github.com/AnnieRuru/82335a62e8a6133511cda473ade8d322 oh and, my discord is AnnieRuru#1609
  2. 1 point
    I just noticed my newly downloaded test server from a few days ago is stable branch LOL ... should've been main branch because it just a test server, thanks for reminder anyway yeah the previous post still stand correct, only the DD are not necessary and you are good to go
  3. 1 point
    they changed it on https://github.com/HerculesWS/Hercules/commit/0b86f2b46bcace0967a04fbc3d85a4c9e3df3c32 (finally!) now its account based, thank you for the plugin!
  4. 1 point
    prontera,155,185,5 script kjhfkhsjd 1_F_MARIA,{ // #Attendance_require = 0; // end; mes callsub(YYYYMMDD); #Attendance_require = callsub(YYYYMMDD); close; YYYYMMDD: return gettime(GETTIME_YEAR) * 10000 + gettime(GETTIME_MONTH) * 100 + gettime(GETTIME_DAYOFMONTH); } #include "common/hercules.h" #include "map/pc.h" #include "map/clif.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "attendance_requirement", SERVER_TYPE_MAP, "", HPM_VERSION, }; // copy from src\map\date.c int date_get_date(void) { time_t t; struct tm * lt; t = time(NULL); lt = localtime(&t); return (lt->tm_year + 1900) * 10000 + (lt->tm_mon + 1) * 100 + (lt->tm_mday); } static void clif_parse_attendance_reward_request_pre(int *fd, struct map_session_data **sd) { if ((*sd)->state.trading || pc_isdead(*sd) || pc_isvending(*sd)) return; if (pc_readaccountreg(*sd, script->add_variable("#Attendance_require")) != date_get_date()) { clif->messagecolor_self((*sd)->fd, COLOR_RED, "You don't meet the requirement."); hookStop(); } return; } HPExport void plugin_init (void) { addHookPre(clif, pAttendanceRewardRequest, clif_parse_attendance_reward_request_pre); } this has been tested working btw remember the attendance system are bind to each character in the account https://github.com/HerculesWS/Hercules/blob/da14478a8c0c616a6aa5481694c550143bc9b9f3/sql-files/main.sql#L245-L246 <-- under `char` table so I guess what you doing there is the reward can claim for each character in the account once the quest has completed
  5. 1 point
    error show what this is not function and not variable date_get(DT_YYYYMMDD)) Also error said what parameters to clif->msgtable_color is wrong
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.