06.04.2019, 15:02
Hello. I have a question.
The command works as an entry /giveleaderorg 45 0
What is this all about? Why he does not work or show me the list.
Code:
CMD:giveleaderorg(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 1; new id=-1, family; if( sscanf(params, "dK<fix>(-1)", 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 != -1) { 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 { SendClientMessage(playerid, -1, "================ LIST OF LEADERS ================"); format(str, 128, "SELECT `Nick` FROM `accounts` WHERE `FMember`='%d' AND `Rank`>1000", family); mysql_query(g_SQL, str); new nick[24]; new results = cache_num_rows(); if(results > 0) { for(new i = 0; i < results; i++) { cache_get_value_name(i, "Nick", nick); sscanf(str, "p<|>s[24]", nick); SendClientMessage(playerid, -1, nick); } SendClientMessage(playerid, -1, "================ END ================"); } } return 1; }
What is this all about? Why he does not work or show me the list.
Code:
else { SendClientMessage(playerid, -1, "================ LIST OF LEADERS ================"); format(str, 128, "SELECT `Nick` FROM `accounts` WHERE `FMember`='%d' AND `Rank`>1000", family); mysql_query(g_SQL, str); new nick[24]; new results = cache_num_rows(); if(results > 0) { for(new i = 0; i < results; i++) { cache_get_value_name(i, "Nick", nick); sscanf(str, "p<|>s[24]", nick); SendClientMessage(playerid, -1, nick); } SendClientMessage(playerid, -1, "================ END ================"); } }