error 033: array must be indexed
#1

I wrote this code:

Код:
new
		IPz[ 20 ],
		zIP[ 20 ]
	;
    mysql_fetch_field_row( fetch,"nolog" );      playerDB[ playerid ][ nolog ] = strval(fetch);
    mysql_get_field( "IP", IPz );
    new IPAS = GetPlayerIp(playerid,zIP,20);
	if( playerDB[ playerid ][ nolog ] == 1 )
	{
  		if( IPAS == IPz )
		{
 			SendClientMessage(playerid,COLOR,"Fucking veikia");
 			return 1;
		}
	}
but i have this error:

Код:
: error 033: array must be indexed (variable "IPz")
on this line:
Quote:

if( IPAS == IPz )

Reply
#2

Код:
if(!strcmp(IPAS, IPz, true))
!LukniS!
Reply
#3

Strcmp
You cannot compare string like you do in integers.
Reply
#4

You are comparing two strings with each other,so use strcmp https://sampwiki.blast.hk/wiki/Strcmp
Reply
#5

Quote:

new
IPz[ 20 ],
zIP[ 20 ]
;
mysql_fetch_field_row( fetch,"nolog" ); playerDB[ playerid ][ nolog ] = strval(fetch);
mysql_get_field( "IP", IPz );
new IPAS = GetPlayerIp(playerid,zIP,20);
if( playerDB[ playerid ][ nolog ] == 1 )
{
if(!strcmp(IPAS, IPz, true))
{
SendClientMessage(playerid,COLOR,"Fucking veikia");
return 1;
}
}

I still don't get this

error 035: argument type mismatch (argument 1)
Reply
#6

Quote:
Originally Posted by ancezas
Посмотреть сообщение
I still don't get this

error 035: argument type mismatch (argument 1)
oh cmon ... thats not that hard.
pawn Код:
new
IPz[ 20 ],
zIP[ 20 ]
;
mysql_fetch_field_row( fetch,"nolog" ); playerDB[ playerid ][ nolog ] = strval(fetch);
mysql_fetch_field_row( IPz,"IP" );
GetPlayerIp(playerid,zIP,20);
if( playerDB[ playerid ][ nolog ] == 1 )
{
if(!strcmp(zIP, IPz, true))
{
SendClientMessage(playerid,COLOR,"Fucking veikia");
return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)