Factions not working.
#1

Well, here's my factions script, but it's just not working IG (no errors or anything) can I please have some help.

pawn Код:
enum Factionenum
{
    Faction,
    Rank,
    Leader
};
pawn Код:
CMD:makeleader(playerid,params[])
{
    new id, factionid;
    if(!PermissionCheck(playerid, 4))
    {
        if(sscanf(params,"ui",id, factionid)) return SendClientMessage(playerid,-1,"SERVER: /makeleader [id] [faction]");
        if(factionid == 0) // Faction NONE
        {
            SendClientMessage(id,-1," Your faction's been set to 0, therefore you aren't in one.");
            fInfo[id][Faction] = 0;
            fInfo[id][Leader] = 0;
            fInfo[id][Rank] = 6;
        }
        else if(factionid == 1)// SD
        {
            SendClientMessage(id,-1,"You're now the leader of the Sheriff's Department.");
            fInfo[id][Faction] = 1;
            fInfo[id][Leader] = 1;
            fInfo[id][Rank] = 6;
        }
        else if(factionid == 2)// ES
        {
            SendClientMessage(id,-1,"You have been made the leader of the Emergency Servies.");
            fInfo[id][Faction] = 2;
            fInfo[id][Leader] = 0;
            fInfo[id][Rank] = 6;
        }

    }
    return 1;
}

CMD:invite(playerid,params[])
{
    new id;
    if(fInfo[playerid][Leader] || fInfo[playerid][Rank] >= 6)
    {
        if(sscanf(params,"i", id)) return SendClientMessage(playerid,-1,"SERVER: /invite [id]");
        if(fInfo[playerid][Faction] == 1)
        {
            SendClientMessage(id,-1," You have been invited into the Sherrif's Department ");
            fInfo[id][Faction] = 1;
            fInfo[id][Leader] = 1;
            fInfo[id][Rank] = 1;
        }
    }
    /*
            TO ADD EMT USE - - - -
            else if(fInfo[playerid][Faction] == 2) to get the leaders faction then performs the code, just lookin at the code I did above.
    */

    return 1;
}
Reply
#2

Bump.
Reply
#3

I presume you have:
pawn Код:
new fInfo[MAX_PLAYERS][Factionenum];
Are you saw your '!PermissionCheck(playerid,4))' is right? That's in other words saying IS NOT [function PermissionCheck...]. Check this function/stock please.

Try:

pawn Код:
CMD:makeleader(playerid, params[])
{
    new id, factionid;
    if(!PermissionCheck(playerid, 4))
    {
        if(sscanf(params,"ii", id, faction))return SendClientMessage(playerid,-1,"SERVER: /makeleader [id] [faction]");
        switch(faction)
        {
            case 0:{
                        SendClientMessage(id,-1," Your faction's been set to 0, therefore you aren't in one.");
                        fInfo[id][Faction] = 0;
                        fInfo[id][Leader] = 0;
                        fInfo[id][Rank] = 6;
            }
            case 1:{          
                        SendClientMessage(id,-1,"You're now the leader of the Sheriff's Department.");
                        fInfo[id][Faction] = 1;
                        fInfo[id][Leader] = 1;
                        fInfo[id][Rank] = 6;
            }
            case 2:{
                        SendClientMessage(id,-1,"You have been made the leader of the Emergency Servies.");
                        fInfo[id][Faction] = 2;
                        fInfo[id][Leader] = 0;
                        fInfo[id][Rank] = 6;
            }
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by iiNzTicTx
Посмотреть сообщение
I presume you have:
pawn Код:
new fInfo[MAX_PLAYERS][Factionenum];
Are you saw your '!PermissionCheck(playerid,4))' is right? That's in other words saying IS NOT [function PermissionCheck...]. Check this function/stock please.

Try:

pawn Код:
CMD:makeleader(playerid, params[])
{
    new id, factionid;
    if(!PermissionCheck(playerid, 4))
    {
        if(sscanf(params,"ii", id, faction))return SendClientMessage(playerid,-1,"SERVER: /makeleader [id] [faction]");
        switch(faction)
        {
            case 0:{
                        SendClientMessage(id,-1," Your faction's been set to 0, therefore you aren't in one.");
                        fInfo[id][Faction] = 0;
                        fInfo[id][Leader] = 0;
                        fInfo[id][Rank] = 6;
            }
            case 1:{          
                        SendClientMessage(id,-1,"You're now the leader of the Sheriff's Department.");
                        fInfo[id][Faction] = 1;
                        fInfo[id][Leader] = 1;
                        fInfo[id][Rank] = 6;
            }
            case 2:{
                        SendClientMessage(id,-1,"You have been made the leader of the Emergency Servies.");
                        fInfo[id][Faction] = 2;
                        fInfo[id][Leader] = 0;
                        fInfo[id][Rank] = 6;
            }
        }
    }
    return 1;
}
Not working.
Reply
#5

By the way, I've had a scripter go though my whole script to see why it's not working and he couldn't find out what was wrong :/
Reply
#6

Any help?
Reply
#7

You aren't setting anything for the player. I'm not sure what you're really trying to do here. I wrote a tutorial on groups, dynamically. Maybe you could check it out? Cross reference with what you're trying to do here and maybe even improve it a bit. If not, then let me know what I can do to help as I'm not really sure what this code is meant to do.

Here is my tutorial: http://forum.sa-mp.com/showthread.ph...75#post3240675
Reply
#8

Show your PermissionCheck.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)