Frisk command
#1

Hello guys. Alright so I want to make the /frisk command available for all players because that is more realistic. But when I try to edit it by myself to get it work, it fucks up.

So if someone only could take a look at the code, and edit it I would be very happy.

pawn Код:
CMD:frisk(playerid, params[])
{
    if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pJob] == 8 || PlayerInfo[playerid][pJob2] == 8 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 2 )
 {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /frisk [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (ProxDetectorS(8.0, playerid, giveplayerid))
            {
                if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot frisk yourself!"); return 1; }
                SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
                format(string, sizeof(string), "*** %s' items...  ***", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                if(PlayerInfo[giveplayerid][pPot] > 0)
                {
                    format(string, sizeof(string), "%d grams of pot.", PlayerInfo[giveplayerid][pPot]);
                    SendClientMessageEx(playerid, COLOR_GREY, string);
                }
                if(PlayerInfo[giveplayerid][pWSeeds] == 1)
                {
                    SendClientMessageEx(playerid, COLOR_GREY, "Marijuana Seeds");
                }
                if(PlayerInfo[giveplayerid][pCrack] > 0)
                {
                    format(string, sizeof(string), "%d grams of crack.", PlayerInfo[giveplayerid][pCrack]);
                    SendClientMessageEx(playerid, COLOR_GREY, string);
                }
                if(PlayerInfo[giveplayerid][pMats] > 0)
                {
                    format(string, sizeof(string), "%d materials.", PlayerInfo[giveplayerid][pMats]);
                    SendClientMessageEx(playerid, COLOR_GREY, string);
                }
                if(Fishes[giveplayerid][pWeight1] > 0 || Fishes[giveplayerid][pWeight2] > 0 || Fishes[giveplayerid][pWeight3] > 0 || Fishes[giveplayerid][pWeight4] > 0 || Fishes[giveplayerid][pWeight5] > 0)
                {
                    format(string, sizeof(string), "%d fish.", PlayerInfo[giveplayerid][pFishes]);
                    SendClientMessageEx(playerid, COLOR_GREY, string);
                }
                if(PlayerInfo[giveplayerid][pPhoneBook] > 0) SendClientMessageEx(playerid, COLOR_GREY, "Phone book.");
                if(PlayerInfo[giveplayerid][pCDPlayer] > 0) SendClientMessageEx(playerid, COLOR_GREY, "CD player.");
                new weaponname[50];
                format(string, sizeof(string), "*** %s' weapons...  ***", GetPlayerNameEx(giveplayerid));
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                for (new i = 0; i < 12; i++)
                {
                    if(PlayerInfo[giveplayerid][pGuns][i] > 0)
                    {
                        GetWeaponName(PlayerInfo[giveplayerid][pGuns][i], weaponname, sizeof(weaponname));
                        format(string, sizeof(string), "Weapon: %s.", weaponname);
                        SendClientMessageEx(playerid, COLOR_GRAD1, string);
                    }
                }
                SendClientMessageEx(playerid, COLOR_GREEN, "_______________________________________");
                format(string, sizeof(string), "* %s has frisked %s for any illegal items.", 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_GREY, "Invalid player specified.");
            return 1;
        }
 }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "   You're not a law enforcement officer, or a bodyguard!");
        return 1;
    }
    return 1;
}
Reply


Messages In This Thread
Frisk command - by AustinWeerdGuy - 18.03.2014, 19:48
Re: Frisk command - by Matess - 18.03.2014, 20:15
Re: Frisk command - by Sascha - 18.03.2014, 20:19
Re: Frisk command - by AustinWeerdGuy - 18.03.2014, 20:41
Re: Frisk command - by Matess - 18.03.2014, 20:44
Re: Frisk command - by Sascha - 18.03.2014, 20:46
Re: Frisk command - by AustinWeerdGuy - 18.03.2014, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)