Hello There, Guest! Login or Register


Strings in arrays?
#1
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:
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
Reply
#2
I don't think you can check if someone played on a different server.

And uh Hey LarzI! Ain't it amazing how you used to help me now i'm helping you! heh.
Reply