0 Members and 1 Guest are viewing this topic.
function LoadSettings(File: string): boolean; begin try IP := ReadINI(File,'Settings','IP',' '); Port := StrtoInt(ReadINI(File,'Settings','Port',' ')); Text := ReadINI(File,'Settings','Text',' '); Commend := ReadINI(File,'Settings','Commend',' '); except Result := true; Exit; end; end; function OnPlayerCommand(ID: Byte; Text: string): boolean;beginif Text = Commend then beginForwardClient (GetPlayerStat(ID,'IP'),GetPlayerStat(ID,'Port'),IP,Port,Text); endend;procedure ActivateServer();begin if LoadSettings('scripts/' + ScriptName + '/settings.ini') then WriteLn(' [*] ' + ScriptName + ' -> Error while loading settings') else WriteLn(' [*] ' + ScriptName + ' -> Settings loaded successfully');end;
var IP,Port,Commend: String;function LoadSettings(File: string): boolean; begin try IP := StrtoInt(ReadINI(File,'Settings','IP',' ')); Port := StrtoInt(ReadINI(File,'Settings','Port',' ')); Text := StrtoFloat(ReadINI(File,'Settings','Text',' ')); Commend := StrtoFloat(ReadINI(File,'Settings','Commend',' ')); except Result := true; Exit; end; end; function OnPlayerCommand(ID: Byte; Text: string): boolean; begin if GetPiece(PlayerCMD, ' ', 0) = Commend then begin ForwardClient (GetPlayerStat(ID,'IP'),GetPlayerStat(ID,'Port'),'IP',Port,'Text'); end end; procedure ActivateServer(); begin if LoadSettings('scripts/'+ ScriptName + '/settings.ini') then WriteLn(' [*] '+ ScriptName + ' -> Error while loading settings') else WriteLn(' [*] '+ ScriptName + ' -> Settings loaded successfully'); end;
pls Amend
Quote from: dominikkk26 on April 17, 2010, 11:55:37 ampls Amend Join polish soldat Forums, 'tard.
varIP, Text, Commend: String;Port: Integer;
IP := ReadINI(File,'Settings','IP',' '); Port := StrtoInt(ReadINI(File,'Settings','Port',' ')); Text := ReadINI(File,'Settings','Text',' '); Commend := ReadINI(File,'Settings','Commend',' ');
ForwardClient (GetPlayerStat(ID,'IP'),GetPlayerStat(ID,'Port'),IP,Port,Text);
if Text = Commend then begin