Greek 0 Posted June 21, 2013 Help to fix this script m adding the 5 Seconds Delay to @warp and @go when hit but the script got error,Thanks in advance Quote Share this post Link to post Share on other sites
0 Zopokx 7 Posted June 21, 2013 I don't know what you have written, but you should use: iTimer->gettick(); Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 21, 2013 Oh i see,Thanks Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 22, 2013 @Zopokx here's my script.src/map/atcommand.c clif_displaymessage(fd, msg_txt(248)); return -1; }+ if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {+ clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");+ return -1;+ } if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { clif_displaymessage(fd, msg_txt(1)); // Map not found. return -1; return 0; } + if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {+ clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");+ return -1;+ }+ memset(map_name, '0', sizeof(map_name)); memset(atcmd_output, '0', sizeof(atcmd_output)); src/map/pc.c pet_target_check(sd,src,1); sd->canlog_tick = gettick();+ if( src->type == BL_PC )+ ((TBL_PC*)src)->canlog_tick = gettick(); } int pc_dead(struct map_session_data *sd,struct block_list *src) Please help me to fix the script Quote Share this post Link to post Share on other sites
0 Xgear 44 Posted June 22, 2013 As Zopokx explained, replace gettick() with iTimer->gettick(); That will compile without any errors. Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 25, 2013 i got error when i compile it Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted June 25, 2013 Please, copy and paste here the compiler error reports so that we can figure out what's wrong. Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 26, 2013 (edited) Here's the script if( !pc_get_group_level(sd) && DIFF_TICK(iTimer->gettick();,sd->canlog_tick) < 5000 ) { clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently"); return false; } if (pc->setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { clif->message(fd, msg_txt(1)); // Map not found. return false; And then i got this error when i compile Edited June 26, 2013 by Greek Quote Share this post Link to post Share on other sites
0 Xgear 44 Posted June 26, 2013 Change pc_get_group_level to pc->get_group_level Also change iTimer->gettick(); to iTimer->gettick() (It was my bad, the ";" wasnt required here.) Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 26, 2013 Thanks sir, already compile it but i still have one more error. Quote Share this post Link to post Share on other sites
0 Greek 0 Posted June 26, 2013 Thanks Xgear and jaBote it's working now! Quote Share this post Link to post Share on other sites
0 Xgear 44 Posted June 26, 2013 change clif_displaymessage to clif->message and you should be done (Y) Quote Share this post Link to post Share on other sites
0 Zeiyan 4 Posted November 7, 2013 hello im new here in herc.ws. /heh im used to rathena i just want to ask how can i make this src edit to make @go/@warp remove the delay if monsters hit you. Quote Share this post Link to post Share on other sites
0 mybitch 9 Posted January 12, 2014 How to do this again? Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted January 12, 2014 Using Mumbles Utility @go command will do. Quote Share this post Link to post Share on other sites
0 mybitch 9 Posted January 12, 2014 Using Mumbles Utility @go command will do. The delay is only for usage. The delay here is meant when being attacked. E.G. when you've been hit with a monster. You can't use @go for 5 seconds. Quote Share this post Link to post Share on other sites
0 rafaelpsyco 0 Posted January 31, 2014 Has anyone managed to fix this problem? I'm using this patch, but he is out of date Index: conf/battle.conf===================================================================--- conf/battle.conf (revision 12062)+++ conf/battle.conf (working copy)@@ -58,4 +58,4 @@ import: conf/battle/misc.conf //Your custom config goes here.-import: conf/import/battle_conf.txt+import: conf/battle/custom.confIndex: conf/battle/custom.conf===================================================================--- conf/battle/custom.conf (revision 0)+++ conf/battle/custom.conf (working copy)@@ -0,0 +1,7 @@+//--------------------------------------------------------------+// Hercules Battle Configuration File+//--------------------------------------------------------------++// Warp and Go delay in miliseconds ( 5000 = 5 Seconds )+// Official is 0+gowarp_delay: 5000 No newline at end of fileIndex: src/map/atcommand.c===================================================================--- src/map/atcommand.c (revision 12062)+++ src/map/atcommand.c (working copy)@@ -426,6 +431,10 @@ clif->message(fd, msg_txt(248)); return false; }+ if( !pc->get_group_level(sd) && DIFF_TICK(iTimer->gettick(),sd->canlog_tick) < battle_config.gowarp_delay ) {+ clif->message(fd,"@warp cannot be issued since you were into battle recently");+ return false;+ } if (pc->setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { clif->message(fd, msg_txt(1)); // Map not found. return false;@@ -1755,6 +1780,11 @@ memset(map_name, '0', sizeof(map_name)); memset(atcmd_output, '0', sizeof(atcmd_output)); + if( !pc->get_group_level(sd) && DIFF_TICK(iTimer->gettick(),sd->canlog_tick) < battle_config.gowarp_delay ) {+ clif->message(fd,"@go cannot be issued since you were into battle recently");+ return -1;+ }+ // get the number town = atoi(message); Index: src/map/battle.c===================================================================--- src/map/battle.c (revision 12062)+++ src/map/battle.c (working copy)@@ -6486,6 +6527,7 @@ { "gm_ignore_warpable_area", &battle_config.gm_ignore_warpable_area, 0, 2, 100, }, { "packet_obfuscation", &battle_config.packet_obfuscation, 1, 0, 3, }, { "client_accept_chatdori", &battle_config.client_accept_chatdori, 0, 0, INT_MAX, },+ { "gowarp_delay", &battle_config.gowarp_delay, 0, 0, INT_MAX, }, }; #ifndef STATS_OPT_OUT /**Index: src/map/battle.h===================================================================--- src/map/battle.h (revision 12062)+++ src/map/battle.h (working copy)@@ -453,7 +453,7 @@ int gm_ignore_warpable_area; int client_accept_chatdori; // [Ai4rei/Mirei]- + int gowarp_delay; } battle_config; Index: src/map/pc.c===================================================================--- src/map/pc.c (revision 12062)+++ src/map/pc.c (working copy)@@ -6630,6 +6648,8 @@ elemental_set_target(sd,src); sd->canlog_tick = iTimer->gettick();+ if( src->type == BL_PC )+ ((TBL_PC*)src)->canlog_tick = iTimer->gettick(); } /*========================================== Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted February 1, 2014 ^ Search for - replace with + - iTimer->gettick()+ timer->gettick() if error occurred please post it here. Quote Share this post Link to post Share on other sites
0 rafaelpsyco 0 Posted February 1, 2014 (edited) No errors at compile time, but no check my char can use warp normally Let me try to explain what I'm wondering. When you take damage from any player or mob you can not log out right? (Prevent logout). I need the same thing, except for the commands "go" and "warp" Example: Edited February 1, 2014 by rafaelpsyco Quote Share this post Link to post Share on other sites
Help to fix this script
m adding the 5 Seconds Delay to @warp and @go when hit but the script got error,
Thanks in advance
Share this post
Link to post
Share on other sites