little help.
#1

Hi peoples i want to ask one thing.Maybe can say what is wrong here:

Код:
while(mysql_retrieve_row())
{
new players,username[25],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
players ++;
if(mysql_fetch_field_row(username, "Name") == name)
{
SendClientMessage(playerid,COLOR_GREEN,"Hello");
players = 0;
mysql_free_result();
}
return 1;
}
It's not all code,but when i compile in this line:

Код:
if(mysql_fetch_field_row(username, "Name") == name)
{
I get this error:

pawn Код:
C:\Documents and Settings\Owner\Desktop\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(1102) : error 033: array must be indexed (variable "name")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

PHP код:
if(mysql_retrieve_row()){ mysql_fetch_field_row(username"Name"); } 
That's how i use it, try it
Reply
#3

No,you just get name from db,but i want to make if get name is same with my name then will function work,that's why i ask what is wrong in my code?
Reply
#4

uh............ i dont know....i had this problem before...i fixed it...then i forgot how

i wish i could help you bro
Reply
#5

i try to do that:

Код:
if(mysql_fetch_field_row(username, "Name") == name[23])
{
No errors,but not work,i look in my mysql.txt and all is good there.
Reply
#6

Need strcmp to string compare.
Reply
#7

pawn Код:
if(strcmp(mysql_fetch_field_row(username, "Name"), name,true,MAX_PLAYER_NAME))
Reply
#8

Here i get error:

pawn Код:
C:\Documents and Settings\Owner\Desktop\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(1102) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

pawn Код:
mysql_fetch_field_row(username, "Name")
That function isn't returning string. Use MYSQL function that getting string (Or whatever to get the string). No I don't know what it is.
Reply
#10

Please,maybe anybody can help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)