15.05.2012, 16:36
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;
}
}