11.07.2011, 22:26
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:
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 Код:
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()) Name = "Direktorius {FF0000}neiрrinktas";
}
return Name;
}