SA-MP Forums Archive
little help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: little help. (/showthread.php?tid=284251)



little help. - budelis - 18.09.2011

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.



Re: little help. - =WoR=G4M3Ov3r - 18.09.2011

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


Re: little help. - budelis - 18.09.2011

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?


Re: little help. - _ELIX_ - 18.09.2011

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

i wish i could help you bro


Re: little help. - budelis - 18.09.2011

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.


Re: little help. - Vince - 18.09.2011

Need strcmp to string compare.


Re: little help. - Xyrex - 18.09.2011

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



Re: little help. - budelis - 19.09.2011

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.



Re: little help. - =WoR=Varth - 19.09.2011

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.


Re: little help. - budelis - 19.09.2011

Please,maybe anybody can help me.