Jump to content
  • 0

@command


BTNX

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   3
  • Joined:  04/02/12
  • Last Seen:  

I'm not sure if this is the right section for this because I'm not sure if this is a source question or what.

I need to add an @command "@support" and all it does is open a script... Similar to whisper system

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Read: Bindatcmd

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   3
  • Joined:  04/02/12
  • Last Seen:  

Ow... Thanks again...

Btw, how would you use parameters?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


OnInit:

        bindatcmd("<any command you want to use>",strnpcinfo(3)+ "::OnExe");

        end;

OnExe:

// Execute code when the binded command was triggered by the user

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   3
  • Joined:  04/02/12
  • Last Seen:  

Thanks for the reply... Is it possible to use parameters with this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Please read the Wiki page I linked...

.@atcmd_numparameters: The number of parameters defined.

.@atcmd_parameters$[]: Array containing the given parameters, starting from an index of 0.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

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

You can get command parameters with .@atcmd_parameters$[index].

So, @test a b would result in this:

.@atcmd_command$        = @test
.@atcmd_parameters$[0]  = a
.@atcmd_parameters$[1]  = b
.@atcmd_numparameters   = 2
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   3
  • Joined:  04/02/12
  • Last Seen:  

@Euphy...

I'm aware of the link... I actually knew about that page, I just didn't understand it before. Thanks for the replies everyone...

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...