Invite command
#1

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"

Код 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];
}
and the /invite command

Код 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;
}
what is wrong :-s ?
Reply


Messages In This Thread
Invite command - by StR_MaRy - 24.09.2016, 13:58
Re: Invite command - by Shinja - 24.09.2016, 14:53
Re: Invite command - by StR_MaRy - 24.09.2016, 14:56
Re: Invite command - by Shinja - 24.09.2016, 15:53
Re: Invite command - by StR_MaRy - 24.09.2016, 15:59
Re: Invite command - by Shinja - 24.09.2016, 16:03
Re: Invite command - by StR_MaRy - 24.09.2016, 16:16
Re: Invite command - by Shinja - 24.09.2016, 16:22
Re: Invite command - by StR_MaRy - 24.09.2016, 16:29
Re: Invite command - by Vince - 24.09.2016, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)