12-13-2008, 06:54 PM
Is it possible to check if a player has played on a server by IP?
If it is, here's how I tried to do it:
[pawn]new ip[16];
GetPlayerIp(playerid, ip, 16);
if(playerHasPlayed[ip])
{
format(str, 128, "Welcome back %s", Name(playerid));
SendClientMessage(playerid, COLOR_YELLOW, str);
}
playerHasPlayed[ip] = 1;[/pawn]
But I get errors:
So as the subject says...: Is it possible to have strings (in this case, IPs) inside a array variable
If it is, here's how I tried to do it:
[pawn]new ip[16];
GetPlayerIp(playerid, ip, 16);
if(playerHasPlayed[ip])
{
format(str, 128, "Welcome back %s", Name(playerid));
SendClientMessage(playerid, COLOR_YELLOW, str);
}
playerHasPlayed[ip] = 1;[/pawn]
But I get errors:
Code:
C:\Documents and Settings\Lars Aaby\Skrivebord\SA-MP Server Scripting\gamemodes\TDM.pwn(216) : error 033: array must be indexed (variable "ip")
C:\Documents and Settings\Lars Aaby\Skrivebord\SA-MP Server Scripting\gamemodes\TDM.pwn(221) : error 033: array must be indexed (variable "ip")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
So as the subject says...: Is it possible to have strings (in this case, IPs) inside a array variable