Author Topic: function OnRequestGame(IP: string; State: integer): integer;  (Read 783 times)

0 Members and 1 Guest are viewing this topic.

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
function OnRequestGame(IP: string; State: integer): integer;
« on: December 02, 2013, 11:57:10 am »
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:
Code: [Select]
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;
« Last Edit: December 03, 2013, 10:56:33 am by dominikkk26 »