SA-MP Forums Archive
Need help for fakebade for hitmans cmd... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help for fakebade for hitmans cmd... (/showthread.php?tid=426176)



Need help for fakebade for hitmans cmd... - Scrillex - 28.03.2013

So basiclly what I want is just set hitman /showfakebadge [playerid] [factionid] the question is how to do it..

This is my cmd:
pawn Код:
CMD:showfakebadge(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
        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))
            {
                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] == 8 || PlayerInfo[playerid][pLeader] == 8)
                {
                    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);
            }
            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;
}



Re: Need help for fakebade for hitmans cmd... - Ibrahim.E - 28.03.2013

I can not under stand what you want .


Re: Need help for fakebade for hitmans cmd... - Ibrahim.E - 28.03.2013

/showfakebadge [playerid] [factionid]
Already added on your code that when anyhitmen write /showfakebadge only !
He will send his a massege /showfakebadge [playerid] [factionid]
Код:
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /showfakebadge [playerid] [factionid]");



Re: Need help for fakebade for hitmans cmd... - Scrillex - 28.03.2013

u will work only for player id First of all.. Secondly is that I need to know how hitman could effect the like more badges.
As you can see in the code I have more factions then 1 so basiclly what I want is to show the factions id badge!

+ don't double post!


Re: Need help for fakebade for hitmans cmd... - Slix_ - 28.03.2013

I managed to do a little part for you, as I'm not really such a guy who likes scripting for others, but I did the main shit for you. You do the rest, it's the point of learning scripting...

pawn Код:
CMD:showfakebadge(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
        new string[128], giveplayerid, factionid, fname[32];
        if(sscanf(params, "ud", giveplayerid, factionid))
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /showfakebadge [playerid] [faction id]");
            SendClientMessageEx(playerid, COLOR_GRAD3, "|1 LSPD |2 FBI |3 SFPD |4 FDSA");
            SendClientMessageEx(playerid, COLOR_GRAD2, "|6 Government |7 SASD");
            SendClientMessageEx(playerid, COLOR_GRAD1, "|11 NG");
        }

        if(giveplayerid != INVALID_PLAYER_ID)
        {
            if(ProxDetectorS(5.0, playerid, giveplayerid))
            {
                if(factionid != 1 && factionid != 2 && factionid != 3 && factionid != 4 && factionid != 7 && factionid != 11 && factionid != 6)
                    return SendClientMessageEx(playerid, COLOR_GREY, "That faction does not have a badge or is non existant.");

                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);
                SendClientMessageEx(giveplayerid, COLOR_WHITE, "Current Assignment: None.");
                switch(factionid)
                {
                    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(factionid != 6 && factionid != 12) 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);
            }
            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;
}
You'll never learn if you don't get to try for yourself. Cheers, mate.


Re: Need help for fakebade for hitmans cmd... - Scrillex - 28.03.2013

Big thanks mate I hope it will work.