13.08.2015, 06:18
So, basically. I have created this:
I am using this stock to show the faction name in /stats.
I decided to create a new stock with division names, but here is the problem. I have six factions, and only some of them are using divisions. For example, Fort Carson Sheriffs Department has the following divisions.
But the Fire Department is not using them.
So here is my question. I want to create a new stock GetDivisionName. I tried and here it is.
This didnt work tho, I get the following errors when I try to include the stock in /stats: Here is the line.
And the errors:
I am not sure what I have to in order to get the right division for the faction. You might be confused. If you know a easier way to input the name of the division in /stats without using these stocks, go ahead and tell me. Either way, I need to know how to not get the division names mixed with other faction's division names.
pawn Код:
stock GetFactionName(playerid)
{
new astring[50];
if(PlayerInfo[playerid][pFaction] == 1)format(astring, sizeof(astring), "Fort Carson Sheriffs Department");
else if(PlayerInfo[playerid][pFaction] == 2)format(astring, sizeof(astring), "Federal Bureau of Investigation");
else if(PlayerInfo[playerid][pFaction] == 3)format(astring, sizeof(astring), "Fort Carson Fire Department");
else if(PlayerInfo[playerid][pFaction] == 4)format(astring, sizeof(astring), "International Contract Agency");
else if(PlayerInfo[playerid][pFaction] == 5)format(astring, sizeof(astring), "Government");
else if(PlayerInfo[playerid][pFaction] == 6)format(astring, sizeof(astring), "SA News");
return astring;
}
pawn Код:
format(string, sizeof(string), "Faction: {50BB44}%s",GetFactionName(playerid),PlayerInfo[playerid][pFaction]);
SendClientMessage(playerid, WHITE, string);
pawn Код:
1 (None), 3 (FTO), 4 (S.W.A.T.), 5 (D.E.B.), 7 (TE)
So here is my question. I want to create a new stock GetDivisionName. I tried and here it is.
pawn Код:
stock GetDivisionName(playerid)
{
new astring[24];
if(PlayerInfo[playerid][pFaction] == 1) & [PlayerInfo][playerid][pDivision] == 1)format(astring, sizeof(astring), "None");
else if(PlayerInfo[playerid][pFaction] == 2) & [PlayerInfo][playerid][pDivision] == 3) format(astring, sizeof(astring), "FTO");
else if(PlayerInfo[playerid][pFaction] == 3) & [PlayerInfo][playerid][pDivision] == 4) format(astring, sizeof(astring), "S.W.A.T.");
else if(PlayerInfo[playerid][pFaction] == 4) & [PlayerInfo][playerid][pDivision] == 5) format(astring, sizeof(astring), "D.E.B.");
else if(PlayerInfo[playerid][pFaction] == 5) & [PlayerInfo][playerid][pDivision] == 7) format(astring, sizeof(astring), "TE");
return astring;
}
pawn Код:
format(string, sizeof(string), "Faction Division: {50BB44}%s",GetDivisionName(playerid),PlayerInfo[playerid][pDivision]);
SendClientMessage(playerid, WHITE, string);
pawn Код:
(915) : error 029: invalid expression, assumed zero
(915) : error 029: invalid expression, assumed zero
(915) : error 001: expected token: ";", but found "]"
(915) : fatal error 107: too many error messages on one line
------------------------------------------------------------------------------
Line 915: if(PlayerInfo[playerid][pFaction] == 1) & [PlayerInfo][playerid][pDivision] == 1)format(astring, sizeof(astring), "None");