Strcmp problem
#1

Hi all I have a strange problem with the function strcmp. This is the error:
Quote:

error 035: argument type mismatch (argument 1)

And here is a function GetGroupOwner:
Quote:

stock GetGroupOwner(gid)
{
new query[128];
format(query, sizeof(query), "SELECT `Owner` FROM `FRL_Grupy` WHERE `UID` = '%d'", gid);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows())return mysql_fetch_row_data();
mysql_free_result();
return false;
}

and this whole if strcmp
Quote:

if(!strcmp(GetGroupOwner(gid), PlayerName(playerid)))

Please help
Reply
#2

pawn Код:
if(strcmp(GetGroupOwner(gid), PlayerName(playerid), true) == 0)
Reply
#3

Damn to slow, Yea what he said :\
Reply
#4

Quote:
Originally Posted by Crodox RP
Посмотреть сообщение
Damn to slow, Yea what he said :\
I tried and unfortunately does not work
Reply
#5

"GetGroupOwner(gid)" don't returns a string, that's the problem!
Reply
#6

Quote:
Originally Posted by MrDeath
Посмотреть сообщение
"GetGroupOwner(gid)" don't returns a string, that's the problem!
And how do I do to GetGroupOwner return a string?
Reply
#7

Quote:
Originally Posted by LeNy
Посмотреть сообщение
And how do I do to GetGroupOwner return a string?
What is the callback retrieving an integer, float or text?
Reply
#8

Quote:
Originally Posted by _rAped
Посмотреть сообщение
What is the callback retrieving an integer, float or text?
This function is to collect the text
Reply
#9

not sure, but should work
pawn Код:
stock GetGroupOwner(gid)
{
    new query[128];
    new pname[MAX_PLAYER_NAME];
    format(query, sizeof(query), "SELECT `Owner` FROM `FRL_Grupy` WHERE `UID` = '%d'", gid);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows()) mysql_fetch_string(pname);
    else pname="Unknown";
    mysql_free_result();
    return pname;
}
e: free result was in wrong place
Reply
#10

Quote:
Originally Posted by veyron
Посмотреть сообщение
not sure, but should work
pawn Код:
stock GetGroupOwner(gid)
{
    new query[128];
    new pname[MAX_PLAYER_NAME];
    format(query, sizeof(query), "SELECT `Owner` FROM `FRL_Grupy` WHERE `UID` = '%d'", gid);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())mysql_fetch_string(pname);
    else pname="Unknown";
        mysql_free_result();
    return pname;
}
Yes this is it! Works perfectly

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)