if(arrFaction[playerid][p_iMember] > -1 && arrFaction[playerid][g_iFactionType] == 1) { SendClientMessage(playerid, COLOR_BLUE, "*** LAW ENFORCEMENT *** /breathalizer - /fingerprint - /m[egaphone] - /su - /arrest - /tow - /untow"); SendClientMessage(playerid, COLOR_BLUE, "*** LAW ENFORCEMENT *** /searchtruck - /cleartruck - /cuff - /uncuff - givedl - /revokedl - /mdc - /gov"); } if(arrFaction[playerid][p_iMember] > -1 && arrFaction[playerid][g_iFactionType] == 2) { SendClientMessage(playerid, COLOR_GREY, "*** GOVERNMENT *** /mdc "); } |
FactionRanks_ReturnType(iFac) { new szName[32] = "Undefined"; switch(arrFaction[iFac][p_iRanks]) { case 1: szName = "Cadet"; case 2: szName = "Officer"; case 3: szName = "Senior Officer"; case 4: szName = "Corporal"; case 5: szName = "Head Corporal"; case 6: szName = "Sergeant"; case 7: szName = "Senior Sergeant"; case 8: szName = "Lieutentant"; case 9: szName = "Captain"; case 10: szName = "Head Captain"; case 11: szName = "Assistant Chief"; case 12: szName = "Chief"; } return szName; } |
if(arrFaction[playerid][p_iMember] > 11 && arrFaction[playerid][g_iFactionType] == 1) { if(arrFaction[playerid][p_iMember] == 12) { format(string, sizeof(string), "** %s %s: %s **", FactionRanks_ReturnType(playerid), GetPlayerNameEx(playerid), params); SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Announcement ___________|"); SendClientMessageToAll(COLOR_DBLUE, string); } else if(arrFaction[playerid][p_iMember] == 11) { format(string, sizeof(string), "** %s %s: %s **", FactionRanks_ReturnType(playerid), GetPlayerNameEx(playerid), params); SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Announcement ___________|"); SendClientMessageToAll(COLOR_DBLUE, string); } else { SendClientMessageEx(playerid, COLOR_WHITE, "You are not a high enough rank to use this!"); } } |
stock strset(dest[], source[])
{
new count = strlen(source);
for(new i = 0; i < count; i++)
{
dest[i] = source[i];
}
dest[count] = 0;
}
arrFaction[playerid][p_iMember] > -1 &&
case 1: strset(PlayerFactionNameArray, "Cadet");
[...]
switch(arrFaction[playerid][g_iFactionType])
{
case 1:/*Law message*/
case 2:/*Gov. message*/
default:// Error message
}
new factioninformation[20]; if(arrFaction[playerid][p_iMember] == -1) { factioninformation = "None"; } else if(arrFaction[playerid][p_iMember] > 0) { factioninformation = arrFaction[playerid][g_szFactionName]; } |
array sizes do not match, or destination array is too small |
{ factioninformation = arrFaction[playerid][g_szFactionName]; } |
new factioninformation[20];