Run the script / PVP START
Stop Script / PVP STOP
Here's the script:
PHP Code:
/ / Script for the appearance of sharpening.
/ / Run SendPMessage ("PVP", "START")
/ / Stop SendPMessage ("PVP", "STOP")
var start, stop, name, Charname: string;
PID, le, startl, stopl, namel, CharSID: integer;
flag: boolean;
Procedure MsgInfo (msg: string);
begin
gSys.EnSendC (FormatPck ('% hcdacha', [$ 0A02, 02,0 ,'[!]'+ FStr (16), Length (msg) + 2, $ 203A, msg + # 0]));
gsys.sleep (15);
end;
procedure OnCreate;
begin
le: = 23;
start: = 'START';
startl: = length (start);
stop: = 'STOP';
stopl: = length (stop);
name: = 'PVP';
namel: = length (name);
flag: = false;
end;
BEGIN
if length (_gBuff) <4 then exit;
PID: = GInt (_gBuff, 3,2);
if not (_gFromServ) then
case PID of
$ 0302: begin
if strcmp (copy (_gBuff, 5, namel), name) then
begin
if strcmp (copy (_gBuff, le, startl), start) then flag: = true;
if strcmp (copy (_gBuff, le, stopl), stop) then flag: = false;
gBlockPacket;
end;
end;
$ 1A0D: begin
CharSID: = GInt (_gBuff, 7,2);
gSys.SendS (FormatPck ('% hhh', [$ 1E03, CharSID, 0]));
end;
end;
if _gFromServ then
case PID of
$ 660D: begin
MsgInfo ('/ PVP START to run the script');
MsgInfo ('/ PVP STOP to stop the script');
MsgInfo ('----------');
end;
$ 1F03: begin
if flag and (GInt (_gBuff, 5,2) = CharSID) then
begin
Charname: = (copy (_gBuff, 46,17));
gSys.EnSendC (FormatPck ('% hcdacha', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 19, $ 203A, Charname + # 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 10, $ 203A, 'jacket +', (GInt (_gBuff, 19,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 9, $ 203A, 'pants +', (GInt (_gBuff, 22,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 12, $ 203A, 'gloves +', (GInt (_gBuff, 25,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 11, $ 203A, 'boots +', (GInt (_gBuff, 28,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 9, $ 203A, 'header +', (GInt (_gBuff, 31,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 7, $ 203A, 'shield +', (GInt (_gBuff, 34,1) + 48), 0]));
gSys.EnSendC (FormatPck ('% hcdachacc', [$ 0A02, 02,0 ,'[!]'+ FStr (16), 10, $ 203A, 'weapon +', (GInt (_gBuff, 37,1) + 48), 0]));
MsgInfo ('----------');
end;
end;
end;
END.






