Jump to content
  • 0

bindatcmd() help


lnteractive

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

//test script
- script atcmd_block -1,{
OnInit:
bindatcmd("refresh","atcmd_block::OnAtcommand");
end;

OnAtcommand:
if(strcharinfo(3) != "prontera") {
bindatcmd("refresh","atcmd_block::OnAtcommand");
message ""+strcharinfo(0)+"","hi";
end;
} else {
unbindatcmd("refresh");
end;
}

}

What is it supposed to do:

Upon script load, bind the CMD, when players use @refresh on any maps other than prontera, refresh works normally. When player use refresh in prontera, messages the player, hi.

The only way I could make it work is to initiate bindatcmd again after every unbind, how do I do this?

//test script
- script atcmd_block -1,{
OnAgitStart:
bindatcmd("refresh","atcmd_block::OnAtcommand");
end;

OnAtcommand:

message ""+strcharinfo(0)+"","hi";
end;

OnAgitEnd:
unbindatcmd("refresh");

}

This works for WoE, however for academic purposes, let's go back to the first post =P.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I believe bindatcmd is works for ALL players

what you are doing now is like,

you only want to make change to that particular player, but you set a global variable <.<

I believe this is how this command should works

we shouldn't overwrite the original atcommands

and you should try multi-client to check 1 side can use, another side can't use because it set globally

if I understand correctly that u need that command limited to prontera only

I believe you need to edit atcmd(refresh) in atcommand.c directly

which ... isn't very hard to do if you can read source

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

@Interactive

why are you unbind the command if they are using the '@refresh' but their character are not in prontera ?

it will remove the usage for the '@refresh' command that you set in the script....unless you have someway to re-trigger the bindcmd ...

anyway....AnnieRuru way would be better. edit in the src files.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Uhh, why not just use:

OnInit:
bindatcmd("refresh","atcmd_block::OnAtcommand");
end;

OnAtCommand:
if(strcharinfo(3) != "prontera"){mes "hi"; close;}
atcommand @refresh;
end;

Because i was under the impression that, if the script uses the atcommand, it won't trigger the event.

Edited by GmOcean
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/19/12
  • Last Seen:  

I believe bindatcmd is works for ALL players

what you are doing now is like,

you only want to make change to that particular player, but you set a global variable <.<

I believe this is how this command should works

we shouldn't overwrite the original atcommands

and you should try multi-client to check 1 side can use, another side can't use because it set globally

if I understand correctly that u need that command limited to prontera only

I believe you need to edit atcmd(refresh) in atcommand.c directly

which ... isn't very hard to do if you can read source

I want the script to work for all players, disable a specific command during a specific timeline. However thanks for pointing the src edit, I did it and figured it out, works like a charm now. Thank you for your support.

Same goes to Emistry and Ocean.

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