07.04.2019, 01:47
Yes, I know rarely use "u". I can not fix the list of leaders. Only one message shows SendClientMessage(playerid, -1, "================ LIST OF LEADERS ================");.
And the rest of the message does not show, for example SendClientMessage(playerid, -1, PlayerInfo[id][Nick]); and SendClientMessage(playerid, -1, "================ END ================");
And the rest of the message does not show, for example SendClientMessage(playerid, -1, PlayerInfo[id][Nick]); and SendClientMessage(playerid, -1, "================ END ================");
Code:
CMD:giveleaderorg(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 1; new id = -1, family; if( sscanf(params, "du", family, id)) return SendClientMessage(playerid, -1, "USAGE /giveleaderorg [ORG ID] [ID]"); if(family < 0 || family > MAX_ORG-1) return 1; if(id != -1) { if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "No such player!"); if(GetPlayerFraction(id) != 0 || GetPlayerOrg(id) != 0) return SendClientMessage(playerid, -1, "This player has factions or family!"); orgInvitePlayer(id, family); gPlayerOrgLeader[id] = true; } new str[128]; if(id == 9) { new orgUID = orgID(family); if(orgUID != 0xFFFF) { format(str, sizeof(str), "%s give control over family to %d player %s", GetNick(playerid), family, GetNick(id)); SendClientMessageToAll(-1, str); PlayerInfo[id][pTeam] = 5; gTeam[id] = 5; } else { SendClientMessage(playerid, -1, "ERROR! An error occured."); } } else { new query[500]; //new nick[24]; //new results = cache_num_rows(); mysql_format(g_SQL, query, sizeof(query), "SELECT `Nick` FROM `accounts` WHERE `FMember`='%d' AND `Rank`>1000", family); mysql_query(g_SQL, query); new rows; cache_get_row_count(rows); GetPlayerName(id, PlayerInfo[id][Nick], MAX_PLAYER_NAME); SendClientMessage(playerid, -1, "================ LIST OF LEADERS ================"); if(rows) { new loaded; while(loaded < rows) { cache_get_value_name(loaded, "Nick", PlayerInfo[id][Nick], 24); sscanf(str, "p<|>s[24]", PlayerInfo[id][Nick]); SendClientMessage(playerid, -1, PlayerInfo[id][Nick]); loaded++; } SendClientMessage(playerid, -1, "================ END ================"); } /* GetPlayerName(id, PlayerInfo[id][Nick], MAX_PLAYER_NAME); mysql_format(g_SQL, query, sizeof(query), "SELECT `Nick` FROM `accounts` WHERE `FMember`='%d' AND `Rank`>1000", family); mysql_query(g_SQL, query); SendClientMessage(playerid, -1, "================ LIST OF LEADERS ================"); if(results > 0) { for(new i = 0; i < results; i++) { cache_get_value_name(i, "Nick", PlayerInfo[id][Nick], 24); sscanf(str, "p<|>s[24]", PlayerInfo[id][Nick]); SendClientMessage(playerid, -1, PlayerInfo[id][Nick]); } SendClientMessage(playerid, -1, "================ END ================"); } */ } return 1; }