0 Members and 1 Guest are viewing this topic.
process OnCommand(ID:Byte;Text:string):boolean;var PCrd, XCrd, XVar, XOff, YCrd, YVar, YOff, XVel, YVel, HitM, BStl, Owns: Byte;begin if GetPiece(LowerCase(Text), ' ', 0) = '/create' then begin Pnum := strtoint(GetPiece(Text, ' ', 1)); XCrd := strtoint(GetPlayerStat(Pnum,'X')); XVar := strtoint(GetPiece(Text, ' ', 2); XOff := strtoint(GetPiece(Text, ' ', 3)); YCrd := strtoint(GetPlayerStat(Pnum,'Y')); YVar := strtoint(GetPiece(Text, ' ', 4); YOff := strtoint(GetPiece(Text, ' ', 5)); XVel := strtoint(GetPiece(Text, ' ', 6)); YVel := strtoint(GetPiece(Text, ' ', 7)); HitM := strtoint(GetPiece(Text, ' ', 8)); BStl := strtoint(GetPiece(Text, ' ', 9)); Owns := strtoint(GetPiece(Text, ' ', 10)); if GetPlayerStat(Pnum,'Active') then begin if GetPlayerStat(Pnum,'Team') < 5 then begin if (XVar = '-') then XCrd:=XCrd-XOff; if (XVar = '+') then XCrd:=XCrd+XOff; if (YVar = '-') then YCrd:=YCrd-YOff; if (YVar = '+') then YCrd:=YCrd+YOff; if (BStl > 0) and (BStl < 16) then begin if (GetPlayerStat(Owns,'Active') = true) then begin if (GetPlayerStat(Owns,'Team') < 5) then begin CreateBullet(XCrd XVar XOff,YCrd YVar,YOff,XVel,YVel,HitM,BStl,Owns) end; end; end; end; end; end;Result := false;end;
Code: [Select] XCrd := strtoint(GetPlayerStat(Pnum,'X')); YCrd := strtoint(GetPlayerStat(Pnum,'Y'));
XCrd := strtoint(GetPlayerStat(Pnum,'X')); YCrd := strtoint(GetPlayerStat(Pnum,'Y'));
process OnCommand(ID:Byte;Text:string):boolean;var Pnum, BStl, Owns: Byte; XCrd, XOff, YCrd, YOff, XVel, YVel, HitM: single; XVar, YVar: string;begin if GetPiece(LowerCase(Text), ' ', 0) = '/create' then begin Pnum := strtoint(GetPiece(Text, ' ', 1)); XCrd := strtofloat(GetPlayerStat(Pnum,'x')); XVar := strtofloat(GetPiece(Text, ' ', 2); XOff := strtofloat(GetPiece(Text, ' ', 3)); YCrd := strtofloat(GetPlayerStat(Pnum,'y')); YVar := strtofloat(GetPiece(Text, ' ', 4); YOff := strtofloat(GetPiece(Text, ' ', 5)); XVel := strtofloat(GetPiece(Text, ' ', 6)); YVel := strtofloat(GetPiece(Text, ' ', 7)); HitM := strtofloat(GetPiece(Text, ' ', 8)); BStl := strtoint(GetPiece(Text, ' ', 9)); Owns := strtoint(GetPiece(Text, ' ', 10)); if GetPlayerStat(Pnum,'Active') then begin if GetPlayerStat(Pnum,'Team') < 5 then begin if XVar = - then XCrd:=XCrd-XOff; if XVar = + then XCrd:=XCrd+XOff; if YVar = - then YCrd:=YCrd-YOff; if YVar = + then YCrd:=YCrd+YOff; if (BStl > 0) and (BStl < 16) then begin if GetPlayerStat(Owns,'Active') = true then begin if GetPlayerStat(Owns,'Team') < 5 then begin CreateBullet(XCrd XVar XOff,YCrd YVar YOff,XVel,YVel,HitM,BStl,Owns) end; end; end; end; end; end;Result := false;end;
function OnCommand(ID: Byte; Text: string): boolean;varx,y,xoffset,yoffset,xvel,yvel,hitm: single;player,style,owner: integer;begin if GetPiece(LowerCase(Text), ' ', 0) = '/create' then begin try player:=strtoint(GetPiece(Text, ' ', 1)); x:=GetPlayerStat(player,'x'); y:=GetPlayerStat(player,'y'); xoffset:=strtofloat(GetPiece(Text, ' ', 2)); yoffset:=strtofloat(GetPiece(Text, ' ', 3)); xvel:=strtofloat(GetPiece(Text, ' ', 4)); yvel:=strtofloat(GetPiece(Text, ' ', 5)); hitm:=strtofloat(GetPiece(Text, ' ', 6)); style:=strtoint(GetPiece(Text, ' ', 7)); owner:=strtoint(GetPiece(Text, ' ', 8)); except SayToPlayer(ID,'Invalid parameters.'); end; if (GetPlayerStat(player,'Active')=false) then exit; if (GetPlayerStat(player,'Team')=5) then exit; if (style<0) or (style>16) then exit; if GetPlayerStat(owner,'Active')=false then exit; if GetPlayerStat(owner,'Team')=5 then exit; CreateBullet(x+xoffset,y+yoffset,xvel,yvel,hitm,style,owner); end;Result := false;end;
try //Do Somethingexcept //If we encounter any runtime error, break out and do this.end;