15.03.2014, 16:34
Try this:
Its my code from my script. Note: In this code its /showbadge and not /showhbadge. Enjoy.
pawn Код:
CMD:showbadge(playerid, params[])
{
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pLeader] >= 1)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /showbadge [playerid]");
if(giveplayerid != INVALID_PLAYER_ID) {
if(ProxDetectorS(5.0, playerid, giveplayerid)) {
switch(PlayerInfo[playerid][pMember]) {
case 1 .. 4, 5, 6, 7, 11, 12, 13: {
new
infoArrays[3][64];
GetPlayerFactionInfo(playerid, infoArrays[0], infoArrays[1], infoArrays[2]);
SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
format(string, sizeof(string), "%s %s is a duly sworn member of the %s.", infoArrays[0], GetPlayerNameEx(playerid), infoArrays[2]);
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "Current Assignment: %s.", infoArrays[1]);
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
switch(PlayerInfo[playerid][pMember]) {
case 1: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the City of Los Santos.");
case 2: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
case 3: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the City of San Fierro.");
case 12: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the Nation of Tierra Robada.");
case 13: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the United States Government.");
default: SendClientMessageEx(giveplayerid, COLOR_WHITE, "Under the Authority of the State of San Andreas.");
}
if(PlayerInfo[playerid][pMember] != 6 && PlayerInfo[playerid][pMember] != 12) SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
else if(PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to arrest.");
else SendClientMessageEx(giveplayerid, COLOR_WHITE, "Official has the authority to assist in arrests.");
SendClientMessageEx(giveplayerid, COLOR_GRAD2, "----------------------------------------------------------------------------------------------------");
format(string, sizeof(string), "* %s shows their badge to %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
default: SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a civil service faction.");
}
}
else SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
}
else SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a civil service faction.");
}
return 1;
}
