24.09.2016, 13:58
hey guys i have a /invite command where if you have maxmembers setter by an admin like 5/5 you can't invite more but i have a problem i am alone i have 0/5 members and i can't invite it say's "you reached the maximum members"
and the /invite command
what is wrong :-s ?
Код HTML:
stock GetFactionMembers(fid) { new Cache: Result, Get[2]; format(gQuery, sizeof(gQuery), "SELECT `Member` FROM `players` WHERE `Member` = %d", fid); Result = mysql_query(handle, gQuery); cache_get_data(Get[0], Get[1], handle); cache_delete(Result); return Get[0]; }
Код HTML:
CMD:invite(playerid, params[]) { new id, giveplayerid, splayer[25]; if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!"); if(PlayerInfo[playerid][pLeader] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have leader."); if(sscanf(params,"s[25]", splayer)) return SendClientMessage(playerid, COLOR_SYN, "Sintaxa:{FFFFFF} /invite <Player ID/Name>"); { new membrii = GetFactionMembers(PlayerInfo[playerid][pMember]); if(membrii >= DynamicFactions[PlayerInfo[playerid][pMember]][fMaxMembers]) return SendClientMessage(playerid, COLOR_LIGHTRED, "You have reached maximum faction members."); if(PlayerInfo[id][pLevel] < DynamicFactions[PlayerInfo[playerid][pMember]][fMinLevel]) { format(gString,sizeof(gString),"Pentru a invita un membru in aceasta factiune acesta trebuie sa aiba minim level %d.",DynamicFactions[PlayerInfo[playerid][pMember]][fMinLevel]); SendClientMessage(playerid, COLOR_LIGHTRED, gString); return 1; } if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid); else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid); else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer); else giveplayerid = GetPlayers(splayer); if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_ERROR, "You cannot invite yourself."); if(PlayerInfo[giveplayerid][pMember] + PlayerInfo[giveplayerid][pLeader] != 0 || PlayerInfo[giveplayerid][pFPunish] > 0) return SendClientMessage(playerid, COLOR_ERROR, "Player is already in a faction/has faction punish."); InviteOffer[giveplayerid][playerid] = PlayerInfo[playerid][pLeader]; format(gString, sizeof(gString), "L-ai invitat pe %s sa se alature factiunii tale.",GetName(giveplayerid)); SendClientMessage(playerid, COLOR_SYN2, gString); format(gString, sizeof(gString), "Liderul %s te-a invitat sa te alaturi %s, scrie (/accept invite %d) ca sa accepti.",GetName(playerid),FactionName[PlayerInfo[playerid][pLeader]],playerid); SendClientMessage(giveplayerid, COLOR_SYN2, gString); } return 1; }