From Soldat Community Wiki
Jump to: navigation, search

Scripting Manual Style

procedure ForwardClient(SrcIP: string; SrcPort: integer; TargetIP: string; TargetPort: integer; Message: string);

Parameter Info:
 SrcIP (String): Player IP
 SrcPort (Integer): Player port
 TargetIP (String): Server IP to redirect to
 TargetPort (Integer): Server port to redirect to
 Message (String): Message to be displayed in the client popup

 Disconnects a player, fills in the IP and port slots, and asks if they want to join the server.

Note: You can get the SrcPort of a connected player using GetPlayerStat(ID, 'port').

Note: TargetIP must be an IP address, hostnames don't work.


function OnRequestGame(IP: string; State: integer): integer;
  // ask the person who join to join, with a message for him
  ForwardClient(IP, 23073, '', 23074, 'Join this server instead!');
  Result := State;