little faction help
#1

hey please help me
i am looking to create a command example
/factions to show the faction list to civilians with example
SendClientMessage:.......[members 10/45] [online 3]
but i have it and i made it only fake message can some one help me to make it real please
some one give me an exaple and i am going create it please help me thanks
Reply
#2

Create a variable for each faction. Get the faction of players when he connect to server and add +1 in the faction variable You create before.
pawn Код:
new FactionName;

public OnPlayerConnect(playerid)
{
    FactionName++;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    FactionName--;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/faction", true))
    {
        new str[70];
        fomat(str, sizeof(str), "FactionName : %d / 45", FactionName);
        SendClientMessage(playerid, -1, str);
        return 1;
    }
    return 0;
}
Sry for my bad English, i'm french.
Reply
#3

I personally would use MySQL Databases to determine whether a player is a member of a faction or not. Then when someone types uses the /factions command, just use a MySQL query to loop through all player files that are a member of the faction.

Alternatively, you could also create a table for the faction members, so that your server doesn't need to loop through each player file every time that command is run.
Reply
#4

i tried that Lapimonster but it doesnt work it gives me so much errors


any other idea ?
Reply
#5

give me error.
Reply
#6

Nevermind this i problem sloved THanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)