Jump to content

Question

Posted

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

1 answer to this question

Recommended Posts

Posted

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;

}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...