0 Members and 1 Guest are viewing this topic.
function iniLoad(FileName: string): TINIFile;procedure iniSave(FileName: string; var iniFile: TINIFile);function iniGetValue(var iniFile: TINIFile; section, key, errorResult: string): string;procedure iniSetValue(var iniFile: TINIFile; section, key, value: string);procedure iniDeleteSection(var iniFile: TINIFile; section: string);procedure iniDeleteKey(var iniFile: TINIFile; section, key: string);procedure iniWrite(FileName, section, key, value: string);
type TSection = record Name: string; Keys: array of string;end;type TINIFile = record Sections: array of TSection;end;
var ini: TINIFile;ini := iniLoad('soldat.ini');WriteLn(iniGetValue(ini, 'network', 'Greeting_Message', ''));iniSetValue(ini, 'network', 'Greeting_Message', 'Hello!');iniSetValue(ini, 'custom', 'var', 'x'); // this will add the section [custom] with "var=x"iniSetValue(ini, 'network', 'lala', '1'); // this will add "lala=1" in [NETWORK]iniSave('soldat.ini', ini); // must call to save changes
//---Â Â You may use or modify this script to satisfy whatever//---Â Â needs or feels your ass.//---Â Â This commented lines must remain untouched.//---Â Â If you somehow are able to make money with this code//---Â Â or part of it, you will be cought by PerroMAFIA and//---Â Â your ass will be raped.
Sticky: Release Post TemplateSticky: Release Post TemplateSticky: Release Post TemplateSticky: Release Post TemplateSticky: Release Post Template
umm I dont understand what this does.
function OnCommand(ID: Byte; Text: string): boolean;beginvar ini: TINIFile; if (GetPiece(Text, ' ',1) = '/editwep') then begin iniSetValue(ini, GetPiece (Text,' ',3), GetPiece (Text,' ',4), GetPiece (Text,' ',5)); iniSave(GetPiece (Text,' ',2), ini); // must call to save changes end; if (GetPiece(Text, ' ', 1) = '/dis') then begin SetWeaponActive(0, GetPiece(Text,' ', 2), false); end; if (GetPiece(Text, ' ', 1) = '/en') then begin SetWeaponActive(0, GetPiece(Text,' ', 2), true); end; if (GetPiece(Text, ' ', 1) = '/disID') then begin SetWeaponActive(GetPiece(Text,' ',2),GetPiece(Text,' ',3), false); end; if (GetPiece(Text, ' ', 1) = '/enID') then begin SetWeaponActive(GetPiece(Text,' ',2),GetPiece(Text,' ',3), true); end; Result := false; // Return true if you want to ignore the command typed.end;
function OnCommand(ID: Byte; Text: string): boolean;var ini: TINIFile;begin if (GetPiece(Text, ' ',1) = '/editwep') then begin ini := iniLoad('YOURINI.INI'); iniSetValue(ini, GetPiece (Text,' ',3), GetPiece (Text,' ',4), GetPiece (Text,' ',5)); iniSave(GetPiece (Text,' ',2), ini); // must call to save changes end;
procedure iniWrite(FileName, section, key, value: string);beginend;function Oncommand..etcbeginif Text = '/save' then Iniwrite('myfile.ini', 'profits', 'cash', inttostr(Tcash))end;
unknown identifier "xsplit"
xsplit:= (whatever it was)
inifunctions -> [Error] (16:11): Unknown identifier 'xsplit'