Author Topic: No access to Delphi?  (Read 882 times)

0 Members and 1 Guest are viewing this topic.

Offline yexxle

  • Major(1)
  • Posts: 22
No access to Delphi?
« on: June 15, 2007, 08:01:22 am »
I don't know if maybe I'm not doing things properly, but it seems that access to Delphi is restricted? We can do IFs and whatnot, but not access anything useful, such as Delphi file access functions? I realize the Soldat API comes with ReadFile and WriteFile, but that doesn't help me deal with records, which is a much easier way to accomplish what I'm trying to do, vs having to try to parse the string returned from ReadFile.

The following doesn't work. My fault, or is the problem indeed restricted access? If so, what DO we have access to, or what is restricted? Whitelist or blacklist available?

Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
var
curdir : string;

begin
if Text = '/test' then begin
curdir := GetCurrentDir;
WriteConsole(ID, 'Current Dir: ' + curdir, RGB(255, 0, 0));
end;

Result := false;
end;

Result:

Code: [Select]
[*] Compiling Script AdminCore.pas...
 [*] [Error] (57:14): Unknown identifier 'GetCurrentDir'

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: No access to Delphi?
« Reply #1 on: June 15, 2007, 08:53:32 am »
The scripting engine is Pascal, and it uses a limited set of functions. Has nothing to do with Delphi.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: No access to Delphi?
« Reply #2 on: June 15, 2007, 08:54:07 am »
Scripting is Pascal, not Delphi

Offline yexxle

  • Major(1)
  • Posts: 22
Re: No access to Delphi?
« Reply #3 on: June 15, 2007, 08:56:30 am »
Oh, well then someone may want to update the following sticky thread, which has a link to Delphi Basics:

Read First - The Basics

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: No access to Delphi?
« Reply #4 on: June 15, 2007, 02:19:12 pm »
Oh, well then someone may want to update the following sticky thread, which has a link to Delphi Basics:

Read First - The Basics

It's linked, because it's similar enough and a good resource, despite not being completely valid.