0 Members and 2 Guests are viewing this topic.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.
WriteINI ( 'file directory' , 'section' , 'key' , 'value' );
if Text = '/buy bes' then beginif Cash < 65 then beginWriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);end; if Cash <= 65 then beginCash :=Cash-65;end;WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);GiveBonus(ID, 2);end;
if Text = '/buy bes' then beginif Cash < 65 then beginWriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);end; if Cash > 65 then beginCash :=Cash-65;WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);GiveBonus(ID, 2);end;end;
if i use >= that returns a compile error
//function OnCommand(ID: Byte; Text: string): boolean;//begin//if GetPiece(Text,' ',0) = '/raisecash' then begin//Cash := Cash + GetPiece(Text,' ',0);//WriteConsole(0,'Admin has just deposited '+Inttostr(Getpiece(Text,' ',1))' //Cash!',$EE81FAA1);//end;
//function OnCommand(ID: Byte; Text: string): boolean;//begin//if GetPiece(text,' ',0) = '/raisecash' then begin//Cash := Cash + Strtoint(GetPiece(Text,' ',0));//WriteConsole(0,'Admin has just deposited '+Inttostr(Getpiece(Text,' ',1))//Cash!',$EE81FAA1);//end;
function OnCommand(ID: Byte; Text: string): boolean;beginif GetPiece(text,' ',0) = '/raisecash' then beginCash := Cash + Strtoint(GetPiece(Text,' ',1));WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);end;end;
ok whats the best way to get to the most recent log i have like 100000 logs to go through (enesce server host)
function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Containsstring(Text,'/bug') then begin WriteConsole(0,'bug filing acknowledged',$EE81FAA1); WriteFile('scripts/BugReport/Bugs/test.txt','Hello World!'); end;end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;var Temp: string;begin Result := false; if LowerCase(Copy(Text, 1, 5)) = '/bug ' then begin // Using Containstring here is a bad idea.. Temp := Copy(Text, 6, length(Text)); // Then I copy anything after the first space into a var if Temp <> '' then begin // Check if it containts sth. WriteLnFile('scripts/' + ScriptName + '/Bugs/Test.txt', Temp); WriteConsole(ID, 'Your bug has been reported - thanks for help!', $00FF00); // Message that it was successful end else WriteConsole(ID, 'NOOB!', $FF0000); // error messagez end;end;
if LowerCase(Copy(Text, 1, 9)) = '/suggest ' then begin // Using Containstring here is a bad idea.. Temp := Copy(Text, 6, length(Text)); // Then I copy anything after the first space into a var if Temp <> '' then begin // Check if it containts sth. WriteLnFile('scripts/' + ScriptName + '/Suggestions/'+IDtoname(ID)+'.txt', Temp); WriteConsole(ID, 'Your suggestion has been filed - thanks for your help!', $00FF00); // Message that it was successful end else WriteConsole(ID, 'NOOB!', $FF0000); // error messagez end;
if LowerCase(Copy(Text, 1, 10)) = '/feedback ' then begin // Using Containstring here is a bad idea.. Temp := Copy(Text, 6, length(Text)); // Then I copy anything after the first space into a var if Temp <> '' then begin // Check if it containts sth. WriteLnFile('scripts/' + ScriptName + '/Feedback/'+IDtoname(ID)+'.txt', Temp); WriteConsole(ID, 'Your Feedback has been filed - thanks!', $00FF00); // Message that it was successful end else WriteConsole(ID, 'NOOB!', $FF0000); // error messagez end;
Copy(Source: string; StartPos, Count: byte): string;
var test: string;begin test := '12345678'; WriteLn(Copy(Test, 1, 8)); // Will output "12345678" WriteLn(Copy(Test, 5, 2)); // Will output "567"end;