30.07.2014, 21:28
here's the /badge command and i want /hbadge command that can be used by hitman only to show any badge of following factions he want
i want /hbadge that fits with this code.
Thanks for helping me!
Код:
COMMAND:badge(playerid, params[]) { if( GetPlayerFaction(playerid) != COPS && GetPlayerFaction(playerid) != SASF && GetPlayerFaction(playerid) != FBI) return SendClientError(playerid, CANT_USE_CMD); new iPlayer; if( sscanf ( params, "u", iPlayer)) return SCP(playerid, "[PlayerID/PartOfName]"); if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND); if(GetDistanceBetweenPlayers(playerid, iPlayer) > 5) return SendClientError(playerid, "Too far away"); format(iStr, sizeof(iStr), "has shown their badge to %s.", MaskedName(iPlayer)); Action(playerid, iStr); if (PlayerInfo[playerid][playerteam] == SASF) { SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid)); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); } else if (PlayerInfo[playerid][playerteam] == FBI) { SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}Stranger"); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); } else { SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); format(iStr, sizeof(iStr), " {7ada7d}Name: {FFFFFF}%s", RPName(playerid)); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Employed at: {FFFFFF}%s", PlayerInfo[playerid][PTeamName]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}%s", PlayerInfo[playerid][rankname]); SendClientMessage(iPlayer, COLOR_WHITE, iStr); SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}========="); } return 1; }
Thanks for helping me!