Jump to content
  • 0

bindatcmd


Nokia

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

Hey, can someone help me to realize the following...?

I want to create 3 commands with bindatcmd

 

command 1: @eventon (for gms only)

set a variable to 1

 

command 2: @eventoff (for gms only)

set variable to 0

 

command 3: @joinevent (for players)

warp the player to the gm

 

 

for example:

GM types @event

announce GM bla has hosted an event, type @joinevent to join him

(set variable on)

so if a player types @joinevent he will be warped to the gm

if @eventoff was used, he cant warp anymore

 

i think the hardest part is to warp the player to the gm, i actually have no idea how to do this..

Link to comment
Share on other sites

1 answer 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:  

Something like this...

-	script	#sample	-1,{

OnInit:

bindatcmd("eventon",strnpcinfo(0)+"::OnEventOn",99,99);

bindatcmd("eventoff",strnpcinfo(0)+"::OnEventOff",99,99);

bindatcmd("joinevent",strnpcinfo(0)+"::OnJoinEvent");

end;

OnEventOn:

if (.var)

message strcharinfo(0),"The event is already on.";

else {

set .var,getcharid(3);

announce "GM "+strcharinfo(0)+" is hosting an event! Type @joinevent to join.",bc_all;

}

end;

OnEventOff:

if (!.var)

message strcharinfo(0),"The event is already off.";

else {

set .var,0;

announce "The event has ended.",bc_all;

}

end;

OnJoinEvent:

if (.var) {

message strcharinfo(0),"Joining event...";

set .@cid,getcharid(0);

if (!attachrid(.var))

message strcharinfo(0),"@joinevent failed.";

else {

getmapxy(.@map$,.@x,.@y,0);

warpchar .@map$,.@x,.@y,.@cid;

}

} else

message strcharinfo(0),"No event is ongoing.";

end;

OnPCLogoutEvent:

if (.var && getcharid(3) == .var)

donpcevent strnpcinfo(0)+"::OnEventOff";

end;

}

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