[HELP] Command Control

karazu

New member
Messages
1,115
Points
0
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.
 

Untitled.png

please help.




 
 
That is creating an Infinite Loop X_X.
II cant understand what do you want to do...

 
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.

 

Code:
-    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;}
 
Last edited by a moderator:
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
 
Last edited by a moderator:
Code:
-    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;}
 
Last edited by a moderator:
-  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.

 
Last edited by a moderator:
-  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.

 
Last edited by a moderator:
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
 

 
Last edited by a moderator:
Font Accepts only 1 number(the command @font)

Code:
---------------------------------------@font <0-9>Sets client font (0 is the default).---------------------------------------
 
Code:
-    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;}
 
Last edited by a moderator:
Change :

atcommand "@font " + .@atcmd_parameters$;
to :

Code:
atcommand "@font " + implode( .@atcmd_parameters$, " " );
 
Back
Top