/hshowbadge for Hitman
#1

Hey, I'm looking for the /hshowbadge command, which shows a fake badge to a player.

NOTE: THIS COMMAND IS FOR HITMAN AGENCY FACTION ONLY, FACTION NUMBER IS 8.

Example:
I would /hshowbadge [Player ID] [Faction ID] [Division ID]

----------------------------------
[FIRSTNAME_SECONDNAME] is a duly sworn member of the [FACTION].
Current Assignment: [DIVISION].
Under the authority of the City of Los Santos.
Official has the authority to [ARREST/ASSIST IN ARRESTS].
----------------------------------
So, I'm looking for someone experienced enough to script that for me.

Factions I need are:
LSPD [Los Santos Police Department - Arrest]
FBI [Federal Bureau of Investigation - Arrest]
NG [National Guard - Arrest]
GOV [The Government - Assist in Arrest]
FDSA [Fire Department of San Andreas - Assist in Arrest]
SADPS [San Andreas Department of Public Safety - Assist in Arrest]
SASP [San Andreas State Police - Arrest]
Judical System
SAN [San Andreas News - Assist in Arrest]
That's all.

Question: Why do I desperately need this script?
Answer: Because I've a roleplay server, not yet public, everything in this server is BASED on roleplay. You have to roleplay everything, medium - high roleplay server. And this command makes it more perfect.

Thanks!
Reply
#2

At least give us code of divisions and such things, also wrong section.
Reply
#3

Quote:
Originally Posted by HyDrAtIc
Посмотреть сообщение
At least give us code of divisions and such things, also wrong section.
I hope someone moves this then.
On-Topic: Do you need divisions of the factions up-there? I can provide them easily.
Reply
#4

Like this?

pawn Код:
CMD:hshowbadge(playerid, params[])
{
new factionid, rank, divid;
if(IsAHitman(playerid)) {
if(sscanf(params, "ddd", factionid, rank, divid)) return SCM(playerid, COLOR_GREY, "USAGE: /hshowbadge [facid] [rank] [div]");
new iFac = PlayerInfo[playerid][pFaction];
new iRank = PlayerInfo[playerid][pRank];
new iDiv = PlayerInfo[playerid][pDivID];
PlayerInfo[playerid][pFaction] = factionid;
PlayerInfo[playerid][pRank] = rankid;
PlayerInfo[playerid][pDivID] = divid;
cmd_showbadge(playerid, params);
PlayerInfo[playerid][pFaction] = iFac;
PlayerInfo[playerid][pRank] = iRank;
PlayerInfo[playerid][pDivID] = divid;
return 1;
}
Untested.
Reply
#5

Alright, I will make this easier.
I found this but it needs to be corrected.
Gives me some errors about pFakeMember not being valid or something.
Just correct the pFakeMember error and I'll do the rest.
Код:
CMD:hshowbadge(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: /hshowbadge [playerid]");
                if(PlayerInfo[playerid][pFakeMember] == 0 || PlayerInfo[playerid][pFakeMember] == 8) { return SendClientMessageEx(playerid, COLOR_GREY, "You need a valid badge to show."); }
                if(giveplayerid != INVALID_PLAYER_ID) {
                        if(ProxDetectorS(5.0, playerid, giveplayerid)) {
                                PlayerInfo[playerid][pHBadgeShown] = 1;
                                switch(PlayerInfo[playerid][pFakeMember]) {
                                case 1 .. 4, 5, 6, 7, 11, 12, 13: {
                                                new
                                                infoArrays[3][64];
 
                                                GetPlayerFactionInfo(playerid, infoArrays[0], infoArrays[1], infoArrays[2]);
                                                printf("%d %d",PlayerInfo[playerid][pFakeMember], infoArrays[2]);
                                                printf("%d %d",PlayerInfo[playerid][pFakeRank], infoArrays[0]);
                                                printf("%d %d",PlayerInfo[playerid][pFakeDivision], infoArrays[1]);
                                                print(PlayerInfo[playerid][pHBadgeShown]);
 
                                                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);
                                                PlayerInfo[playerid][pHBadgeShown] = 0;
                                        }
                                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;
}
Thanks.
I will not be able to reply anymore because I will not be home. I will be back tonight.
Reply
#6

Just use the method I provided. Basically, your setting their faction info to the "fake faction", then setting everything back after showing the command. This is the easiest way to do it.
Reply
#7

Alright Abagail, thanks for your help. L&A this.
Reply
#8

Oh hell, it started giving me "error 017: undefined sympol "ProxDetector"", "error 017: undefined sympol "GivePlayerCash"", "error 017: undefined sympol "NOPCheck"", any help?
Reply
#9

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Just use the method I provided. Basically, your setting their faction info to the "fake faction", then setting everything back after showing the command. This is the easiest way to do it.
Hey, again. Once I started using the code you gave me I started getting the error codes upthere ^^, once I deleted it everything went back to normal and I was able to successfully compile the script. So what's wrong with it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)