26.09.2016, 21:21
i have this cmd /invite if i do not have space in my faction works it gives me the message like "your factions is full" and if i have space i can invite it works but i have just a problem
minlevel is not working i mean he is level 2 and i have at my faction minlevel 5 and i still can invite him
what is wrong with this cmd ?
and also have this both first is for space in faction
and this for minlevel
what could be wrong ?
minlevel is not working i mean he is level 2 and i have at my faction minlevel 5 and i still can invite him
what is wrong with this cmd ?
Код HTML:
CMD:invite(playerid, params[])
{
new 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>");
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(FactionMembers(PlayerInfo[playerid][pLeader]) >= FactionInfo[PlayerInfo[playerid][pLeader]][fSlots]) return SendClientMessage(playerid, COLOR_ERROR, "Your faction is full.");
if(FactionLevelMembers(PlayerInfo[playerid][pLeader]) >= FactionInfo[PlayerInfo[playerid][pLeader]][fMinLevel]) return SendClientMessage(playerid, COLOR_ERROR, "His level is to low.");
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;
}
Код HTML:
function FactionMembers(faction) { gQuery[0] = (EOS); mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `ID` FROM `players` WHERE `Member` = %d", faction); new Cache:result = mysql_query(handle, gQuery); new number = cache_num_rows(); cache_delete(result); return number; }
Код HTML:
function FactionLevelMembers(faction) { gQuery[0] = (EOS); mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `ID` FROM `factions` WHERE `MinLevel` = %d", faction); new Cache:result = mysql_query(handle, gQuery); new number = cache_num_rows(); cache_delete(result); return number; }