All pastes #779642 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-18 12:18 UTC
rendered paste body
if regExpMatch('^/save (\w+)$', Text) then begin
    // Save current position
    place := getPiece(Text, ' ', 1);
  
    for i := 0 to getArrayLength(coords) do begin
      if (coords[i].lable = place) and (coords[i].map = currentMap) then begin
        writeConsole(ID, 'Already a jump mark with this name for this map', $FFFF0000);
        exit;
      end;
    end;
    
    temp.lable := place;
    temp.map   := currentMap;
    temp.x     := getPlayerStat(ID, 'X');
    temp.y     := getPlayerStat(ID, 'Y');
    coords[getArrayLength(coords)+1] := temp;
    
    writeConsole(ID, 'Saved mark at XY: ' + floatToStr(temp.x) + ' ' + floatToStr(temp.y) + '!', $FFFF0000);
  end;