Jump to content
  • 0
Sign in to follow this  
Valiente

Enable command upon reaching a certain 'Base Level'?

Question

5 answers to this question

Recommended Posts

  • 0

use this 

---------------------------------------*bindatcmd "command","<NPC object name>::<event label>"{,<group level>,<group level char>,<log>};This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding. If group level is provided, only users of that group level or above will be able to access the command, if not provided, everyone will be able to access the command."group level char" is the minimum group level required for the label to be used on others like a char command would, e.g. "#command "target" params", when not provided, "group level char" defaults to 99."log" whether to log the usages of this command with the atcommand log (1 = log, 0 = no log), default is to not log.The following variables are set upon execution:	.@atcmd_command$       =  The name of the @command used.	.@atcmd_parameters$[]  =  Array containing the given parameters,                               starting from an index of 0.	.@atcmd_numparameters  =  The number of parameters defined.Example:When a user types the command "@test", an angel effect will be shown.-	script	atcmd_example	-1,{OnInit:	bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";	end;OnAtcommand:	specialeffect2 338;	end;}---------------------------------------

 

there would be limitless possibilities using that command w/o having to edit the source. 

for instance in your case

 

-	script	certainlevel	-1,{OnInit:	bindatcmd "certainlevel",strnpcinfo(3)+"::OnBaseLevel";	end;OnBaseLevel:        if(BaseLevel < 10){ end; };	dispbottom "You can use the command";	end;}

 

if player is lower than level 10, nothing will happen.

Edited by Virtue

Share this post


Link to post
Share on other sites
  • 0

if the player is trying to use the command without reaching the level requirement.. how to add this message?
"you must be level 10 above to use this command"

Share this post


Link to post
Share on other sites
  • 0

if the player is trying to use the command without reaching the level requirement.. how to add this message?

"you must be level 10 above to use this command"

 

- script certainlevel -1,{OnInit:        bindatcmd "certainlevel",strnpcinfo(3)+"::OnBaseLevel";        end;OnBaseLevel:	    if(BaseLevel < 10){                  dispbottom "You must be level 10 above to use this command";                 end;        };        dispbottom "You can use the command";        end;} 

 

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

 

if the player is trying to use the command without reaching the level requirement.. how to add this message?

"you must be level 10 above to use this command"

 

- script certainlevel -1,{OnInit:        bindatcmd "certainlevel",strnpcinfo(3)+"::OnBaseLevel";        end;OnBaseLevel:	    if(BaseLevel < 10){                  dispbottom "You must be level 10 above to use this command";                 end;        };        dispbottom "You can use the command";        end;} 

 

 

:meow:

thank you sir.. you're so malufet ^^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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