function OnRequestGame(IP: string; State: integer): integer;
How to check the ID of the player that is trying to join?
Insight on how to check some parameters of the player that is trying to join?
Example:
function OnRequestGame(IP: string; State: integer): integer;
var
res: TStringArray;
i: integer;
b: byte;
begin
if (method = 2) then begin
for b := 1 to 32 do begin
if ((GetPlayerStat(b, 'active') = true) then begin
if (IP = 'true') then begin
res := Explode(ReadFile('scripts/'+ ScriptName + '/ip.txt'),chr(13)+chr(10)); // Czytaj plik IP
for i := 0 to GetArrayLength(res) do begin //Ustaw tablice
if NumPlayers >= MaxPlayers - GetArrayLength(res) then begin
if (GetPlayerStat(b, 'IP') = res[i]) then State := 1 else State := 5;
end;
end;
end;