SA-MP Forums Archive
Faction Chat - 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)
+--- Thread: Faction Chat (/showthread.php?tid=446039)



Faction Chat - JaKe Elite - 24.06.2013

Hello guys.
As you can see i'm creating a roleplay server.
My scripting is fine. However, the /faction (/f) is working fine but when player has the rank 4 and above.
The rank is not displaying in the faction chat. It only display in rank 3 and lower.

pawn Код:
CMD:faction(playerid, params[])
{
    if(pLogged[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "** You haven't logged in yet!");
        return 1;
    }
    if(pInfo[playerid][FactionID] != -1)
    {
        new string[128+128];
        if(sscanf(params, "s[128+128]", params)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /f(action) [message]");
        switch(pInfo[playerid][FactionRank])
        {
            case 1: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank1], GetName(playerid), params);
            case 2: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank2], GetName(playerid), params);
            case 3: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank3], GetName(playerid), params);
            case 4: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank4], GetName(playerid), params);
            case 5: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank5], GetName(playerid), params);
            case 6: format(string, sizeof(string), "Faction Chat: %s %s: %s", fInfo[pInfo[playerid][FactionID]][fRank6], GetName(playerid), params);
        }
        foreach(new i : Player)
        {
            if(pInfo[playerid][FactionID] == pInfo[i][FactionID])
            {
                SendSplitMessage(i, COLOR_LIGHTBLUE, string);
            }
        }
    }
    else return SendClientMessage(playerid, COLOR_GRAD2, "** You're not in any faction/gang!");
    return 1;
}
Rank Names

Код:
1=New Member
2=Rookie
3=Member
4=Warrior
5=Co-Leader
6=Leader
Although, The ranks can be changed in game. The rank string length is 100.


Re: Faction Chat - JaKe Elite - 24.06.2013

Never mind guys fixed.

Solution:
I read the string as Rann4/Rann5/Rann6 not Rank4/Rank5/Rank6.


Re: Faction Chat - dEcooR - 24.06.2013

oh so sry then :P