SA-MP Forums Archive
/faction problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /faction problem (/showthread.php?tid=272722)



/faction problem - BizzyD - 29.07.2011

Hello, i got a problem with my /faction command. When i write /faction and a text, it says im not in a faction, But i am.

pawn Код:
if(strcmp(cmd, "/faction", true) == 0 || strcmp(cmd, "/f", true) == 0)
    {
        #pragma tabsize 0
        if(IsPlayerConnected(playerid))
        {
            new result[126];
            if(JugadorInfo[playerid][jSilenciado] == 0)
            {
                if(JugadorInfo[playerid][jMiembro] == 1 || JugadorInfo[playerid][jMiembro] == 2 || JugadorInfo[playerid][jLider] == 1 || JugadorInfo[playerid][jLider] == 2 || JugadorInfo[playerid][jMiembro] == 3 || JugadorInfo[playerid][jLider] == 3 || JugadorInfo[playerid][jMiembro] == 4 || JugadorInfo[playerid][jLider] == 4)
                {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
                    {
                        SendClientMessage(playerid, GRIS, "Usage: (/f)action [Text]");
                        return 1;
                    }
                    if(JugadorInfo[playerid][jSilenciado] == 1)
                    {
                        SendClientMessage(playerid, ROJO, "You are muted!");
                        return 1;
                    }
                    if(JugadorInfo[playerid][jMiembro] == 1 || JugadorInfo[playerid][jLider] == 1)
                    {
                        if(JugadorInfo[playerid][jLider] == 1) { format(string, sizeof(string), "** (( Comandant General %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 9) { format(string, sizeof(string), "** (( Comandant %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 8) { format(string, sizeof(string), "** (( General %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 7) { format(string, sizeof(string), "** (( Coronel %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 6) { format(string, sizeof(string), "** (( Captain %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 5) { format(string, sizeof(string), "** (( Mayor %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 4) { format(string, sizeof(string), "** (( Teniente %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 3) { format(string, sizeof(string), "** (( Sergent %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 2) { format(string, sizeof(string), "** (( Cabo %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 1) { format(string, sizeof(string), "** (( Soldier %s: %s )) **", NombreJugador(playerid), result); }
                        else { format(string, sizeof(string), "** (( Student %s: %s )) **", NombreJugador(playerid), result); }
                        printf("[Faction SOF]: %s %s", sendername, result);
                        MensajeDeFaccionOOC(1, CELESTE, string);
                    }
                    else if(JugadorInfo[playerid][jMiembro] == 2 || JugadorInfo[playerid][jLider] == 2)
                    {
                        if(JugadorInfo[playerid][jLider] == 2) { format(string, sizeof(string), "** (( Leader %s: %s )) **", sendername, result);
                        if(JugadorInfo[playerid][jMiembro] == 2) { format(string, sizeof(string), "** (( Member %s: %s )) **", sendername, result); }
                        printf("[Faction EVO]: %s %s", sendername, result);
                        MensajeDeFaccionOOC(1, CELESTE, string);
                    }
                    else if(JugadorInfo[playerid][jMiembro] == 3 || JugadorInfo[playerid][jLider] == 3)
                    {
                        if(JugadorInfo[playerid][jLider] == 3) { format(string, sizeof(string), "** (( Field Commander %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 8) { format(string, sizeof(string), "** (( Chief Deputy %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 7) { format(string, sizeof(string), "** (( Deputy %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 6) { format(string, sizeof(string), "** (( Major %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 5) { format(string, sizeof(string), "** (( Captain %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 4) { format(string, sizeof(string), "** (( First Lieutenant %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 3) { format(string, sizeof(string), "** (( Second Lieutenant %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 2) { format(string, sizeof(string), "** (( Sergeant %s: %s )) **", NombreJugador(playerid), result); }
                        else if(JugadorInfo[playerid][jRango] == 1) { format(string, sizeof(string), "** (( Rookie %s: %s )) **", NombreJugador(playerid), result); }
                        else { format(string, sizeof(string), "** (( Rookie %s: %s )) **", NombreJugador(playerid), result); }
                        printf("[Faction CPA]: %s %s", sendername, result);
                        MensajeDeFaccionOOC(1, CELESTE, string);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, ROJO, "You're not a member of a faction!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, ROJO, "You are silenced!");
                return 1;
            }
        }
    }
    return 1;
}
Код:
forward MensajeDeFaccionOOC(family, color, string[]);
pawn Код:
public MensajeDeFaccionOOC(family, color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(JugadorInfo[i][jMiembro] == family || JugadorInfo[i][jLider] == family)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}
Anyone know how to fix?

Regards, Alex


Re: /faction problem - BizzyD - 29.07.2011

New problem now


Re: /faction problem - BizzyD - 29.07.2011

Anyone know how to fix?


Re: /faction problem - SWEMike - 29.07.2011

I'm guessing you ain't getting any answers because no one knows what the fudge your variable names mean, also you haven't given enough code or specified any information about debugging... So stop with the damn bumping...

Pucko.