Help with something please as fast as you can!
#1

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
Код:
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;
}
i want /hbadge that fits with this code.

Thanks for helping me!
Reply
#2

Please anyone help!
Reply
#3

Try make it yourself..

I made something that will help you understand where to begin and how it could be made.
pawn Код:
CMD:hbadge(playerid, params[])
{
    if(/*if the player is hitman*/)
    {
        new badge[128], id;
        if(sscanf(params,"us",id,badge)) return SendClientMessage(playerid, -1, "SYNTAX: /hbadge [Player] [Badge]");
        if(sscanf(params,"badge1",badge))
        {
            /*
            Code to show badge1
            */

        }
        if(sscanf(params,"badge2",badge))
        {
            /*
            Code to show badge2
            */

        }
Reply
#4

Thanks for being helpful will try to make it now and will tell you.
Reply
#5

here's the command i did but when i compile the compiler crashs
Код:
CMD:hbadge(playerid, params[])
{
    if(PlayerInfo[playerid][playerteam] == HITMAN) return SendClientMessage,COLOR_RED, "[Error] You're not a hitman"
    {
        new badge[128], id;
        if(sscanf(params,"us",id,badge)) return SendClientMessage(playerid, -1, "SYNTAX: /hbadge [Player] [Badge]");
        if(sscanf(params,"badge1",badge))
        {
        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.A.S.F.", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
        }
        if(sscanf(params,"badge2",badge))
        {
        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}F.B.I.", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
        }
        if(sscanf(params,"badge3",badge))
        {
        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}Police", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		format(iStr, sizeof(iStr), " {7ada7d}Position: {FFFFFF}N/A", PlayerInfo[playerid]);
		SendClientMessage(iPlayer, COLOR_WHITE, iStr);
		SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Government Badge] {3f9541}=========");
		}
                return 1;
}
Reply
#6

pawn Код:
COMMAND:hbadge(playerid, params[])
{
    if(GetPlayerFaction(playerid) == HITMAN)
    {
        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);
       
        SendClientMessage(iPlayer, COLOR_WHITE, "{3f9541}========= {7ada7d}[Hitman 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}[HitmanBadge] {3f9541}=========");
    }
    else return SendClientError(playerid, CANT_USE_CMD);
    return 1;
}
Reply
#7

You made a command to show hitman badge but i don't want that i want a command in which when you're a hitman you can show a fake badge of FBI/SASF/LSPD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)