24.06.2013, 08:51
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.
Rank Names
Although, The ranks can be changed in game. The rank string length is 100.
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;
}
Код:
1=New Member 2=Rookie 3=Member 4=Warrior 5=Co-Leader 6=Leader