error 006: must be assigned to an array
#1

Hello. I want to get ip of a player but when i try to set it in the enum i get errors:
Код:
C:\Users\Andrey\Desktop\samp03x_svr_R1-2_win32\gamemodes\cnr.pwn(177) : error 006: must be assigned to an array
Code:
Код:
	format(query, sizeof(query), "SELECT * FROM users WHERE `user`='%s'", User(playerid));
	mysql_query(query);
	mysql_store_result();
	new ip[16];
	mysql_fetch_field("ip",ip);
	P[playerid][IP] = ip;
	mysql_free_result();
Reply
#2

Ip is a string not a number.

pawn Код:
P[playerid][IP] = ip;//not allowed
pawn Код:
strcat(P[playerid][IP], ip, 16);//allowed
EDIT: Even better still...
pawn Код:
mysql_fetch_field("ip", P[playerid][IP]);
Reply
#3

What about this one ?
Код:
if(P[playerid][IP] == UserIP(playerid))print("Yes");
---------------------------
error 033: array must be indexed (variable "UserIP")
Reply
#4

pawn Код:
if( !strcmp(P[playerid][IP], UserIP(playerid) ))
strcmp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)