CMD problem?
#1

Error: I have return for /robbank check it self
Код:
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(40) : error 029: invalid expression, assumed zero
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(51) : warning 225: unreachable code
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(53) : warning 209: function "cmd_robbank" should return a value
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

down there
Quote:

return 1;
}
}

replace
by
Quote:

}
return 1;
}

Reply
#3

and dont use }} just use it one time like
pawn Код:
return 1;
}
Reply
#4

I get this now on this line
Код:
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(40) : error 029: invalid expression, assumed zero
pawn Код:
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;
Reply
#5

pawn Код:
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 // *THis
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
****You closed / returned if statement already At Up
*THIS:- > and i Guess u added this else at wrong place

so replace this
Код:
}
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
        }
by
pawn Код:
}

        }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
Reply
#6

pawn Код:
}
      else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
try this !-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)