Jump to content
  • 0
karazu

[HELP] Command Control

Question

I have this script

-	script	fontcontrol	-1,{OnInit:	bindatcmd "font", strnpcinfo(0)+"::OnCommand"; // overwrite the @afk command	end;OnCommand:	if ( !countitem(20357) ) {		message strcharinfo(0), "You must have an Font Ticket to use this command";		end;	}	atcommand "@font"; // then execute back the original command	end;} 

My Plan is, they should have this specific Item first before they can use this command Example Font Ticket.

The problem is everytime I type @font 1 from 1 - 9 the command will not recognise the number instead this message will be shown.
 

post-2388-0-81753700-1395861663_thumb.png

please help.




 

 

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

That is creating an Infinite Loop X_X.

II cant understand what do you want to do...

Its If a player wants to use @font command and he doesn't have a ticket then he cant use the command..

Share this post


Link to post
Share on other sites
  • 0

On your trunk/conf/groups.conf configuration you need to be sure that the user have not the command on his group level.

Then it would work good.

 

-    script    fontcontrol    -1,{OnInit:    bindatcmd "font", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;OnCommand:    if ( !countitem(20357) ) {        message strcharinfo(0), "You must have an Font Ticket to use this command";        end;    }    atcommand "@font "; // leave a space between    end;}
Edited by javierlog08

Share this post


Link to post
Share on other sites
  • 0

I suggest you to use those:

 

.@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.
 
 
 
take this as example
Edited by evilpuncker

Share this post


Link to post
Share on other sites
  • 0
-    script    adssfcvb    -1,{OnCommand:    if ( !countitem(501) ) { // change 501 to your item id.	    dispbottom "You must have an Font Ticket to use this command";	    end;    }    delitem 501,1; // change 501 to your item id.    atcommand "@font " + .@atcmd_parameters$;    end;    OnInit:    bindatcmd "font", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;}
Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

 

-    script    adssfcvb    -1,{OnCommand:    if ( !countitem(501) ) {	    dispbottom "You must have an Font Ticket to use this command";	    end;    }    delitem 501,1;    atcommand "@font " + .@atcmd_parameters$;    end;    OnInit:    bindatcmd "font", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;}

Sorry but  i don't want the item to be consumed, I want it  to stay in the inventory..

 

the purpose of this is just to check if the player only has the item. 

 

 

EDIT:

 

Thank you.I removed the delete item.

 

This is what I am looking for.

Edited by karazu

Share this post


Link to post
Share on other sites
  • 0
-    script    adssfcvb    -1,{OnCommand:    if ( !countitem(501) ) { // change 501 to your item id.	    dispbottom "You must have an Font Ticket to use this command";	    end;    }    atcommand "@font " + .@atcmd_parameters$;    end;    OnInit:    bindatcmd "font", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;}

Then remove the delitem part.

Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

Up for this one.

I have one Problem..


The @aura of Dastjir pojee can type upto 3 set of Aura ex: @aura 999 888 777.
 

The problem is  in this script

-    script    adssfcvb    -1,{OnCommand:    if ( !countitem(501) ) { // change 501 to your item id.	    dispbottom "You must have an Font Ticket to use this command";	    end;    }    atcommand "@font " + .@atcmd_parameters$;    end;    OnInit:    bindatcmd "font", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;} 

It will only read the first number, and will not recognize the next numbers..


For example @aura  999 888 777

The 888 and 777 is ignored already
 

Edited by karazu

Share this post


Link to post
Share on other sites
  • 0

Font Accepts only 1 number(the command @font)

---------------------------------------@font <0-9>Sets client font (0 is the default).---------------------------------------

Share this post


Link to post
Share on other sites
  • 0

 

Font Accepts only 1 number(the command @font)

---------------------------------------@font <0-9>Sets client font (0 is the default).---------------------------------------

@how about if I will use it in @aura?

Share this post


Link to post
Share on other sites
  • 0
-    script    adssfcvb    -1,{OnCommand:    if ( !countitem(501) ) { // change 501 to your item id.        dispbottom "You must have an Aura Ticket to use this command";        end;    }    atcommand "@aura "+atoi(.@atcmd_parameters$[0])+" "+atoi(.@atcmd_parameters$[1])+" "+atoi(.@atcmd_parameters$[2]);    end;    OnInit:    bindatcmd "aura", strnpcinfo(3)+"::OnCommand"; // HERE PLEASE STRNPCINFO(3)    end;} 
Edited by Dastgir Pojee

Share this post


Link to post
Share on other sites
  • 0

Change :

atcommand "@font " + .@atcmd_parameters$;

to :

atcommand "@font " + implode( .@atcmd_parameters$, " " );

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...

×
×
  • Create New...

Important Information

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