Help with this script please

a script that will put a 5mins cooldown delay on commands such as @warp
hmm i don't think this could be added as a script and if it could i do not know how. But cydh made and src edit for it. But i'm not 100% sure if it work's on Hercules SVN. Make a back up and try it out.

http://rathena.org/board/topic/83569-delay-to-use-command/
is that specific chosen commands or all commands? will try it now
Pretty sure it's all commands, not positive as to i've not used it on my SVN but do let me know ;O

 
a script that will put a 5mins cooldown delay on commands such as @warp
Code:
-	script	atcmd_warpdelay	-1,{OnInit:	bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand",0,99;	end;OnAtcommand:	set .@min,5;	//delay in mins	set .@delay,.@min * 60;	if (warpdelay > gettimetick(2)) {		set .@delaytime,warpdelay - gettimetick(2);		message strcharinfo(0),"You must wait "+.@delaytime+" seconds to use this command again.";		end;	}	setarray .@param$,.@atcmd_parameters$[0],.@atcmd_parameters$[1],.@atcmd_parameters$[2];	set .@map$,implode(.@param$," ");	atcommand "@warp "+.@map$+"";	set warpdelay,gettimetick(2) + .@delay;	end;}
 
Last edited by a moderator:
help fix this script

- script warpdelay -1,{
if(getgroupid()<2) end;
OnInit:
bindatcmd "@warp",strnpcinfo(0)+"::OnCommand";
end;
OnCommand:
if(gettimetick(2) < cooldowntime ){
dispbottom "Please wait 5 minutes to use @warp again!";
end;
}
atcommand "@warp";
set cooldowntime,gettimetick(2)+300;
end;
}

everytime i use @warp prontera

i receive the message "Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>)

then i cant use the command for 5mins,

so the delay is working but the command @warp is not working properly anymore

 
Code:
-	script	Sample	-1,{    OnInit:        bindatcmd "warp",strnpcinfo(3)+"::OnWarp";        end;    OnWarp:        if ( gettimetick(2) < delay ) {            dispbottom "Time left before you can use @warp : " +(delay - gettimetick(2))+ " seconds.";            end;        }        if ( .@atcmd_numparameters > 3 || !.@atcmd_numparameters ) {            dispbottom "Usage : @warp <map name>,<x>,<y>";            end;        }        atcommand "@warp " +implode(.@atcmd_parameters$, " ");        delay = gettimetick(2) + 100; // add 100 seconds delay        end;}
 
Last edited by a moderator:
@kyeme

@var -->this type of variable will  lost  when Character re-login
Ohh thank you
default_biggrin.png


 
^

*bindatcmd "command","<NPC object name>::<event label>"{,<group level>,<group level char>,<log>};
You can also disregard the 0,99 part since the @warp command is used by all users ( normal players or not )  in most private servers.

 
^

*bindatcmd "command","<NPC object name>::<event label>"{,<group level>,<group level char>,<log>};
You can also disregard the 0,99 part since the @warp command is used by all users ( normal players or not )  in most private servers.
i see thanks

 
- script Sample -1,{    OnInit:        bindatcmd "warp",strnpcinfo(3)+"::OnWarp";        end;    OnWarp:        if ( gettimetick(2) < delay ) {            dispbottom "Time left before you can use @warp : " +(delay - gettimetick(2))+ " seconds.";            end;        }        if ( .@atcmd_numparameters > 3 || !.@atcmd_numparameters ) {            dispbottom "Usage : @warp <map name>,<x>,<y>";            end;        }        atcommand "@warp " +implode(.@atcmd_parameters$, " ");        delay = gettimetick(2) + 100; // add 100 seconds delay        end;}
i try this and my client crash.

 
@kyeme

@var -->this type of variable will  lost  when Character re-login
Ohh thank you
default_biggrin.png
how to set it for group level 2 and below only
Here:

bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand",2,99;

99 is for Group lvl 99.. you can control the player for example: #warp kerbii prontera
i change it and only my gm 99 is not able to warp but the regular account can warp muultiple times

 
Back
Top