| Code: |
function GFCloseGump(mobile, pid, ret_val:=0)
var packet := CreatePacket(0xBF, 13);
packet.SetInt16(1, 13);
packet.SetInt16(3, 4);
packet.SetInt32(5, pid);
packet.SetInt32(9, ret_val);
return packet.SendPacket(mobile);
endfunction
|
| Code: |
use os;
use uo;
include ":gumps:gumps";
include ":gumps:gumps_ex";
include ":gumps:yesno";
program command_closegump( who, param )
if (param)
var closegump := who.GetProp("#CloseGumpPID");
if (closegump)
GFCloseGump(who, closegump);
who.EraseProp("#CloseGumpPID");
return 1;
endif
endif
who.SetProp("#CloseGumpPID", GetPid());
YesNo(who, "This gump will close if you write .closegump 1");
who.EraseProp("#CloseGumpPID");
return 1;
endprogram
|