SA-MP Forums Archive
clan rank bug - 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: clan rank bug (/showthread.php?tid=665285)



clan rank bug - bosmania - 29.03.2019

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");
}


Re: clan rank bug - bgedition - 29.03.2019

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.


Re: clan rank bug - Lirbo - 29.03.2019

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


Re: clan rank bug - bgedition - 29.03.2019

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.


Re: clan rank bug - solstice_ - 29.03.2019

And start using threaded queries, much easier and better.