Invite command
#4

PHP код:
CMD:invite(playeridparams[])
{
    new 
idgiveplayeridsplayer[25];
    if(
gLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_ERROR"Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    if(
PlayerInfo[playerid][pLeader] == 0) return SendClientMessage(playeridCOLOR_ERROR"You don't have leader.");
    if(
sscanf(params,"s[25]"splayer)) return SendClientMessage(playeridCOLOR_SYN"Sintaxa:{FFFFFF} /invite <Player ID/Name>");
        new 
membrii GetFactionMembers(PlayerInfo[playerid][pMember]);
         
printf("membrii = %d and fMaxMembers = %d"membriiDynamicFactions[PlayerInfo[playerid][pMember]][fMaxMembers]);
           if(
membrii >= DynamicFactions[PlayerInfo[playerid][pMember]][fMaxMembers]) return SendClientMessage(playeridCOLOR_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(playeridCOLOR_LIGHTREDgString);
            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(playeridsplayer);
        else 
giveplayerid GetPlayers(splayer);
        if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_ERROR"You cannot invite yourself.");
        if(
PlayerInfo[giveplayerid][pMember] + PlayerInfo[giveplayerid][pLeader] != || PlayerInfo[giveplayerid][pFPunish] > 0) return SendClientMessage(playeridCOLOR_ERROR"Player is already in a faction/has faction punish.");
        
InviteOffer[giveplayerid][playerid] = PlayerInfo[playerid][pLeader];
        
format(gStringsizeof(gString), "L-ai invitat pe %s sa se alature factiunii tale.",GetName(giveplayerid));
        
SendClientMessage(playeridCOLOR_SYN2gString);
        
format(gStringsizeof(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(giveplayeridCOLOR_SYN2gString);
    return 
1;

Use this command and tell me what prints on your log
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)