Las Venturas Playground
Strings in arrays? - Printable Version

+- Las Venturas Playground (https://forum.sa-mp.nl)
+-- Forum: Miscellaneous (https://forum.sa-mp.nl/forum-4.html)
+--- Forum: Gaming (https://forum.sa-mp.nl/forum-27.html)
+--- Thread: Strings in arrays? (/thread-14243.html)



Strings in arrays? - LarzI - 12-13-2008

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


Re: Strings in arrays? - FarePak - 12-15-2008

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.