Store an IP. Error: Must be assigned to an array
#1

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.
Reply
#2

You cannot store string into a int. Do:
Код:
new ReconnectIP[MAX_PLAYERS][16];
Reply
#3

edit: I was wrong, nvm
Reply
#4

Код:
new PlayerIP[50];
	GetPlayerIp(playerid, PlayerIP, 50);
	format(string, sizeof(string), "IP: %i ",  PlayerIP);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)