How can I enable business robbing?
#1

Heres the pawno code:
pawn Код:
CMD:robbiz(playerid, params[])
{
    SendClientMessage(playerid, COLOR_BLUE, "Business Robbery has been disabled due to the fact > Abuse");
    return 1;
}

#define MAX_ROBCASH 4000
new randomrobmoney;

CMD:rob(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pJob] != JOB_THIEF && PlayerInfo[playerid][pVIPJob] != JOB_THIEF) return SendClientMessage(playerid, COLOR_GREY, "You are not a Thief.");
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /rob [playerid]");
    if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't rob yourself.");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(PlayerInfo[playerb][pMoney] < 4000) return SendClientMessage(playerid, COLOR_GREY, "This player don't have enough on-hand");
    //if(IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough at the player");
    if(IsPlayerNearPlayer(playerid, playerb, 2))
    {
        if(robtime[playerid] == 0)
        {
            new rob = random(4);
            if(rob == 1)
            {
                format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                robtime[playerid] = 1;
                SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
            }
            else if(rob == 2)
            {
                format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                robtime[playerid] = 1;
                SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
            }
            else if(rob == 3)
            {
                format(string, sizeof(string), "* %s has stolen some money from %s his pocket", RPN(playerid), RPN(playerb));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                randomrobmoney = random(MAX_ROBCASH);
                GiveZaiatMoney(playerid,randomrobmoney);
                GiveZaiatMoney(playerb,randomrobmoney);
                format(string, sizeof(string), "* You've stolen %d from %s", randomrobmoney, RPN(playerid));
                SendClientMessage(playerb, COLOR_PURPLE,string);
                format(string, sizeof(string), "* %s has stolen %d from you", RPN(playerb), randomrobmoney);
                SendClientMessage(playerid, COLOR_PURPLE, string);
                robtime[playerid] = 1;
                SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
            }
            else if(rob == 4)
            {
                format(string, sizeof(string), "* %s has tried to take money from %s his pocket", RPN(playerid), RPN(playerb));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                robtime[playerid] = 1;
                SetTimerEx("robtimer", ROB_TIME, false, "i", playerid);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Wait before you can rob someone again.");
        }
    }
    return 1;
}

When I try to rob it it says something about it being disabled, which I didn't do.. The stuff under the first 4 or so lines are to rob a normal person.. Just added it so you can get more of the code to know how its been coded and stuuuuuuff ))
Reply
#2

Bump
Reply
#3

Wow, you gotta be kidding me. The cmd itself returns a message which clearly says: DISABLED DUE TO ABUSE
Reply
#4

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
Wow, you gotta be kidding me. The cmd itself returns a message which clearly says: DISABLED DUE TO ABUSE
I know, I'm just wondering whether anyone can maybe make a script for it ?
Reply
#5

Quote:
Originally Posted by jremi
Посмотреть сообщение
I know, I'm just wondering whether anyone can maybe make a script for it ?
Your code won't work, because you did not assign a variable if it's true or false, you just showed a player a message when they type /robbiz
Reply
#6

@pds2k12 ---
he doesnt know about it maybe cause its not his code :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)