CMD problem?
#1

Error i get
Код:
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(40) : error 029: invalid expression, assumed zero
cmd

pawn Код:
CMD:robbank(playerid, params[])
{
    new success = random(2);
    if(BankRobbedRecently == 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later");
        return 1;
    }
    if(PlayerInfo[playerid][pRobTime] >= 1)
    {
         SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.");
         return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2, 1423.6083,-1003.7733,1639.7843))
    {
        if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
        {
            if(PlayerInfo[playerid][pFaction] == SASD || PlayerInfo[playerid][pFaction] == LSPD || PlayerInfo[playerid][pFaction] == DHS) { SendClientMessage(playerid, COLOR_WHITE, "Law faction cannot rob the bank!"); return 1; }
            {
                if(success == 1)
                {
                    SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos Bank, please remain in the checkpoint for 95 Seconds!");
                    RobbingTime[playerid] = 95;
                    RobBankTimer = SetTimerEx("RobBank",1000,true,"i",playerid);
                    WantedPoints[playerid] = 5;
                    SetPlayerCriminal(playerid,255, "Robbing the Bank");
                    PlayerInfo[playerid][pRobTime] = 900;
                    BankRobbedRecently = 1;
                    SetTimer("UnsetBankRob",1500000,false);
                    OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
                }
                else
                {
                    SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
                    WantedPoints[playerid] = 2;
                    SetPlayerCriminal(playerid,255, "Attempting to rob the Bank");
                    PlayerInfo[playerid][pRobTime] = 500;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");
            return 1;
        }
    }
    return 1;
}
Reply
#2

what line?
Reply
#3

which line is 40?
Reply
#4

pawn Код:
}
                else
                {
                    SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
                    WantedPoints[playerid] = 2;
                    SetPlayerCriminal(playerid,255, "Attempting to rob the Bank");
                    PlayerInfo[playerid][pRobTime] = 500;
                }
            }
            else line 40
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");
            return 1;
        }
    }
    return 1;
}
Reply
#5

Add a comment to the line number 40 so we can see which one it is.
Reply
#6

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
Add a comment to the line number 40 so we can see which one it is.
i already did that.
Reply
#7

Try
pawn Код:
CMD:robbank(playerid, params[])
{
    if(BankRobbedRecently == 1)
        return SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later");

    if(PlayerInfo[playerid][pRobTime] >= 1)
         return SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.");

    if(IsPlayerInRangeOfPoint(playerid, 2, 1423.6083,-1003.7733,1639.7843))
    {
        if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
        {
            if(PlayerInfo[playerid][pFaction] == SASD || PlayerInfo[playerid][pFaction] == LSPD || PlayerInfo[playerid][pFaction] == DHS)
                return SendClientMessage(playerid, COLOR_WHITE, "Law faction cannot rob the bank!");
            new success = random(2);
            if(success == 1)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos Bank, please remain in the checkpoint for 95 Seconds!");
                RobbingTime[playerid] = 95;
                RobBankTimer = SetTimerEx("RobBank",1000,true,"i",playerid);
                WantedPoints[playerid] = 5;
                SetPlayerCriminal(playerid,255, "Robbing the Bank");
                PlayerInfo[playerid][pRobTime] = 900;
                BankRobbedRecently = 1;
                SetTimer("UnsetBankRob",1500000,false);
                OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
            }
            else
            {
                SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
                WantedPoints[playerid] = 2;
                SetPlayerCriminal(playerid,255, "Attempting to rob the Bank");
                PlayerInfo[playerid][pRobTime] = 500;
            }
        }
        else
            return SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
    }
    else
        return SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");

    return 1;
}
Reply
#8

This should work.
pawn Код:
CMD:robbank(playerid, params[])
{
    new success = random(2);
    if(BankRobbedRecently == 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later");
        return 1;
    }
    if(PlayerInfo[playerid][pRobTime] >= 1)
    {
         SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.");
         return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 2, 1423.6083,-1003.7733,1639.7843))
    {
        if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
        {
            if(PlayerInfo[playerid][pFaction] == SASD || PlayerInfo[playerid][pFaction] == LSPD || PlayerInfo[playerid][pFaction] == DHS) { SendClientMessage(playerid, COLOR_WHITE, "Law faction cannot rob the bank!"); return 1; }
            if(success == 1)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos Bank, please remain in the checkpoint for 95 Seconds!");
                RobbingTime[playerid] = 95;
                RobBankTimer = SetTimerEx("RobBank",1000,true,"i",playerid);
                WantedPoints[playerid] = 5;
                SetPlayerCriminal(playerid,255, "Robbing the Bank");
                PlayerInfo[playerid][pRobTime] = 900;
                BankRobbedRecently = 1;
                SetTimer("UnsetBankRob",1500000,false);
                OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
            }
            else
            {
                SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
                WantedPoints[playerid] = 2;
                SetPlayerCriminal(playerid,255, "Attempting to rob the Bank");
                PlayerInfo[playerid][pRobTime] = 500;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");
        return 1;
    }
    return 1;
}
[EDIT] Use Viniborn script, he put more effort in it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)