11.07.2011, 22:28
Quote:
Hi, I want to make function like "GetLeaderName(jobid)".
It should work something like this: If any player field "Direktorius" value is jobid in MySQL then it would return that player name. But, if there arent any player which field "Direktorius" value in MySQL isnt jobid - it will return {hex}Direktorius {hex}neiљrinktas I tried to do something, but nah, it doesnt work :S: pawn Код:
|
pawn Код:
stock GetLeaderName(jobid)
{
new Query[63];
format(Query, 63, "SELECT Vardas FROM `zaidejudb` ORDER BY `Direktorius` = '%d'", jobid);
mysql_query(Query);
mysql_store_result();
new Name[32];
while(mysql_fetch_row(Name))
{
if(!mysql_num_rows()) strmid(Name, "Direktorius {FF0000}neiрrinktas")); // Strcat, i prefer strmid.
}
return Name;
}