[SOLVED] variable ERROR
#1

I have one Problem
Код:
error 033: array must be indexed (variable "rip")
Reply
#2

Please post the line where is the error from
Reply
#3

This is a part of the Script

pawn Код:
GetPlayerIp(playerid,pip[playerid],16);
  rip[playerid] = dini_Int(file,"IP");     /*<<<ERROR IS HERE */
  if(strcmp(pip[playerid],rip[playerid]))
Reply
#4

an IP is a string, so use dini_Get to retrieve it
Reply
#5

Ok i will try TY
Reply
#6

now i have another ERROR same line
ERROR
Код:
error 047: array sizes do not match, or destination array is too small
ERROR LINE
pawn Код:
GetPlayerIp(playerid,pip[playerid],16);
  rip[playerid] = dini_Get(file,"IP");     /*<<<ERROR IS HERE */
  if(strcmp(pip[playerid],rip[playerid]))
Reply
#7

format(rip[playerid], sizeof(rip[]), dini_Get(file, "IP")); You know?
Reply
#8

Read the error. It say destination array is to small which means you made the array to small. dini_Get returns a 256 characters long string, so your array needs to have 256 cells. On the other hand, you can just do it like this

pawn Код:
GetPlayerIp(playerid,pip[playerid],16);
  if(strcmp(pip[playerid], dini_Get(file,"IP")))
Reply
#9

OK. Thanks u BOTH GUYS
Reply
#10

no problem. HAND
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)