Range contract
#4

pawn Код:
if(strcmp(cmd, "/contract", true) == 0)
    {
        if(PlayerInfo[playerid][pLevel] >= 2)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /contract [playerid/PartOfName] [amount]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /contract [playerid/PartOfName] [amount]");
                return 1;
            }
            moneys = strvalEx(tmp);
            if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) { SendClientMessage(playerid, COLOR_GREY, "   Hitmen cannot place contracts on people !"); return 1; }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "   You cannot Contract yourself !"); return 1; }
                    if(PlayerInfo[giveplayerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "  You can not place contracts on people level 1-2");
                    if(moneys < 10000) { SendClientMessage(playerid, COLOR_GREY, "   Contract money must be at least $10000 !"); return 1; }
                    if(moneys + PlayerInfo[giveplayerid][pHeadValue] > 1000000) { SendClientMessage(playerid, COLOR_GREY, "   That player has the maximum amount on their head !"); return 1; }
                    if(IsACop(giveplayerid) && IsATrooper(playerid) && moneys < 100000) { SendClientMessage(playerid, COLOR_GREY, "   Contract price must be atleast $100000 for Cops !"); return 1; }
                    if(PlayerTied[playerid] != 0 || PlayerCuffed[playerid] != 0) { SendClientMessage(playerid, COLOR_GREY, "   You can't do that at this time !"); return 1; }
                    new playermoney = PlayerInfo[playerid][pCash];
                    if(moneys > 0 && playermoney >= moneys)
                    {
                        strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
                        strmid(giveplayer, PlayerRPName(giveplayerid), 0, MAX_PLAYER_NAME);
                        format(string, sizeof(string), "%s", sendername);
                        strmid(PlayerInfo[giveplayerid][pContractBy], string, 0, strlen(string), 255);
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-moneys;
                        GivePlayerMoney(playerid, (0 - moneys));
                        PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                        format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
                        SendFamilyMessage(8, COLOR_YELLOW, string);
                        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
                        ABroadCast(COLOR_WHITE,string,4);
                        format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount !");
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "   You must be atleast level 2 to place a Contract !");
        }
    }
Reply


Messages In This Thread
Range contract - by JaydenJason - 06.11.2014, 22:22
Re: Range contract - by UltraScripter - 06.11.2014, 22:27
Re: Range contract - by JaydenJason - 06.11.2014, 22:41
Re : Range contract - by D3vin - 07.11.2014, 10:37
Re: Range contract - by JaydenJason - 07.11.2014, 20:16
Re: Range contract - by JaydenJason - 10.11.2014, 21:35
Re: Range contract - by JaydenJason - 11.11.2014, 18:49

Forum Jump:


Users browsing this thread: 1 Guest(s)