clan rank bug
#1

when im selecting a player from this list of memebrs to change their rank it only sets my rank,or the rank of the person who selects the member i don't know what the problem
the part with the rank select it's not posted here, i will post it if it's necessary

new aim[569],query[300],clanrank,skin,string[MAX_PLAYER_NAME],idd,mid=1, name[MAX_PLAYER_NAME + 20], test[128];
format(query, sizeof(query), "SELECT * FROM `users` WHERE `Clanid` = '%d' ORDER BY `ClanRank` DESC LIMIT 10", PlayerInfo[playerid][pClanid]);
new cache:membersmod = mysql_query(mysql, query);
for(new i, j = cache_get_row_count(); i < j; i++)
{
cache_get_field_content(i, "Username", string);
clanrank = cache_get_field_content_int(i, "ClanRank");
skin = cache_get_field_content_int(i, "Skin");
new idd = GetPlayerID(string);
format(Selected[playerid][mid], MAX_PLAYER_NAME, string);
format(aim, sizeof(aim), "%s%s\t%d\t%d\t%s\n",aim ,string, clanrank, skin, ( idd != INVALID_PLAYER_ID) ? ("online") : ("offline"));
mid++;
}
format(test, sizeof(test), "Name\tRank\tSkin\tStatus\n%s", aim);
cache_delete(membersmod);
ShowPlayerDialog(playerid, DIALOG_CMODIFICATIONS, DIALOG_STYLE_TABLIST_HEADERS, "Members :",test, "Select", "Cancel");
}
Reply
#2

First of all please use the [CODE] tags around your code and second: the snipped you posted only shows a dialog to a player. As you wrote you'll have to provide the snippet where the rank is being set.
Reply
#3

Your problem is here:
PHP Code:
format(querysizeof(query), "SELECT * FROM `users` WHERE `Clanid` = '%d' ORDER BY `ClanRank` DESC LIMIT 10"PlayerInfo[playerid][pClanid]); 
PlayerInfo[***playerid***][pClanid]
replace the "playerid" to the target's id
Reply
#4

Quote:
Originally Posted by Lirbo
View Post
Your problem is here:
PHP Code:
format(querysizeof(query), "SELECT * FROM `users` WHERE `Clanid` = '%d' ORDER BY `ClanRank` DESC LIMIT 10"PlayerInfo[playerid][pClanid]); 
PlayerInfo[***playerid***][pClanid]
replace the "playerid" to the target's id
^ this is wrong


This query only gets the list of members of the clan that the player[who uses the command] is in.
It has nothing to do with setting any rank, only gets information.
Reply
#5

And start using threaded queries, much easier and better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)