SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/05/2012, 04:36 PM   #1
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,304
Reputation: 167
Question CMD problem?

Error: I have return for /robbank check it self
Code:
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 Code:
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;
    }
}
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 15/05/2012, 04:37 PM   #2
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,336
Reputation: 138
Default Re: CMD problem?

down there
Quote:
return 1;
}
}
replace
by
Quote:
}
return 1;
}
__________________
nope[IMG]http://*******/1r0SOkH_[/IMG]
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 15/05/2012, 04:40 PM   #3
HaZaRaS™
Big Clucker
 
HaZaRaS™'s Avatar
 
Join Date: May 2012
Location: Uk - London
Posts: 142
Reputation: 6
Default Re: CMD problem?

and dont use }} just use it one time like
pawn Code:
return 1;
}
__________________


I wont read the long and longest answer like 1-7 line .


MY EXPERIANCE = Table making,Forum making,Coding fixing,Port forwording,Fixing 19 run time error.Making an public server, and alot of more ..."PM ME" if you have any kind of question. Feel free to ask.
HaZaRaS™ is offline   Reply With Quote
Old 15/05/2012, 04:44 PM   #4
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,304
Reputation: 167
Default Re: CMD problem?

I get this now on this line
Code:
C:\Users\Hellman\Desktop\Rebound Roleplay server\pawno\include\/CRP/Commands/robbank.pwn(40) : error 029: invalid expression, assumed zero
pawn Code:
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;
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 15/05/2012, 04:52 PM   #5
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,336
Reputation: 138
Default Re: CMD problem?

pawn Code:
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
Code:
}
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
        }
by
pawn Code:
}

        }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                return 1;
            }
__________________
nope[IMG]http://*******/1r0SOkH_[/IMG]
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 15/05/2012, 04:58 PM   #6
HaZaRaS™
Big Clucker
 
HaZaRaS™'s Avatar
 
Join Date: May 2012
Location: Uk - London
Posts: 142
Reputation: 6
Default Re: CMD problem?

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


I wont read the long and longest answer like 1-7 line .


MY EXPERIANCE = Table making,Forum making,Coding fixing,Port forwording,Fixing 19 run time error.Making an public server, and alot of more ..."PM ME" if you have any kind of question. Feel free to ask.
HaZaRaS™ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Killing Spree problem[Most simple and I have problem :( ] SpiderWalk Scripting Help 13 29/04/2012 08:13 AM
SetVehicleHealth problem (Angle problem SOLVED) Paranoja Help Archive 5 03/08/2009 01:06 PM
problem with CWRP in linux (mysql problem) BSMan Server Support 1 16/06/2009 02:36 PM


All times are GMT. The time now is 07:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.