Store an IP. Error: Must be assigned to an array - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Store an IP. Error: Must be assigned to an array (
/showthread.php?tid=215002)
Store an IP. Error: Must be assigned to an array -
Biesmen - 22.01.2011
Hello,
I have a small problem with storing an IP. I am having the error "Mustb e assigned to an array". I tried multiple things to fix this, but it didn't work out.
This is the code I am using at the moment:
pawn Код:
new ReconnectIP[MAX_PLAYERS];
GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
format(IP2, sizeof(IP2), "%s", PlayerIP);
ReconnectIP[playerid] = IP2;
The error is at this line, ofcourse:
Код:
ReconnectIP[playerid] = IP2;
Thank you for reading and I hope you can help me.
Re: Store an IP. Error: Must be assigned to an array -
KuHS - 22.01.2011
You cannot store string into a int. Do:
Код:
new ReconnectIP[MAX_PLAYERS][16];
Re: Store an IP. Error: Must be assigned to an array -
Outcast - 22.01.2011
edit: I was wrong, nvm
Re: Store an IP. Error: Must be assigned to an array -
Saurik - 22.01.2011
Код:
new PlayerIP[50];
GetPlayerIp(playerid, PlayerIP, 50);
format(string, sizeof(string), "IP: %i ", PlayerIP);