SA-MP Forums Archive
Can someone help me with this thing. :/ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can someone help me with this thing. :/ (/showthread.php?tid=337126)



Can someone help me with this thing. :/ - ToiletDuck - 25.04.2012

When i compile this Filter Script it say

Код:
C:\DOCUME~1\37rjemms\Desktop\Robbank.pwn(67) : warning 217: loose indentation
C:\DOCUME~1\37rjemms\Desktop\Robbank.pwn(77) : warning 209: function "cmd_robbank" should return a value
Код:
CMD:robbank(playerid, params[])
{
        if(IsPlayerConnected(playerid))
        {
            if(robbing[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, " You are already robbing the bank, please slow down");
                return 1;
            }
            if(alreadyrobbed[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
                return 1;
               }
            if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not at the bank !");
                return 1;
            }
     			SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");
      			SetTimerEx("bankrob", 600000, false, "i", playerid);
       			robbing[playerid] = 1;
        		SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
        		SendClientMessageToAll(COLOR_WHITE, " The bank is currently getting robbed.");
         		SendClientMessageToAll(COLOR_WHITE, " We are currently waiting for the cops");
         		SendClientMessageToAll(COLOR_WHITE, " We will report more when we get more information");
         		SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
                return 1;
                }



Re: Can someone help me with this thing. :/ - Azazelo - 25.04.2012

line 67 > check alignment of text.
line 77 > add return 1; after last } you missing one


Re: Can someone help me with this thing. :/ - ToiletDuck - 25.04.2012

Line 67 is SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");
that one why it should be loose indentitation?


Re: Can someone help me with this thing. :/ - Azazelo - 25.04.2012

if(alreadyrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
return 1;
}
...
>>> this { and this } in a same line. fix your indentation.
{
code
code
}
code < warning 217: loose indentation
code
code


Re: Can someone help me with this thing. :/ - ToiletDuck - 25.04.2012

Quote:
Originally Posted by Azazelo
Посмотреть сообщение
if(alreadyrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
return 1;
}
...
>>> this { and this } in a same line. fix your indentation.
Thanks dude but now the problem is
Код:
C:\DOCUME~1\37rjemms\Desktop\Robbank.pwn(85) : warning 209: function "cmd_robbank" should return a value
how could i fix this thing?


Re: Can someone help me with this thing. :/ - Azazelo - 25.04.2012

Quote:

CMD:robbank(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(robbing[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You are already robbing the bank, please slow down");
return 1;
}
if(alreadyrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You already robbed the bank! Wait 1 hour.");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2308.8071,-13.2485,26.7422)) // Change X Y Z to the location you want
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the bank !");
return 1;
}
SendClientMessage(playerid, COLOR_WHITE, " You started to rob the bank, This will take 10 minutes");
SetTimerEx("bankrob", 600000, false, "i", playerid);
robbing[playerid] = 1;
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
SendClientMessageToAll(COLOR_WHITE, " The bank is currently getting robbed.");
SendClientMessageToAll(COLOR_WHITE, " We are currently waiting for the cops");
SendClientMessageToAll(COLOR_WHITE, " We will report more when we get more information");
SendClientMessageToAll(COLOR_ORANGE, "||----------Latest News----------||");
}
return 1;
}

Edit.


Re: Can someone help me with this thing. :/ - ToiletDuck - 25.04.2012

Quote:
Originally Posted by Azazelo
Посмотреть сообщение
Edit.
Man thanks for helping me


Re: Can someone help me with this thing. :/ - ToiletDuck - 25.04.2012

So now i FS now Fix but how can i make the cash permanently in the Player who robbed the bank?


Re: Can someone help me with this thing. :/ - Ballu Miaa - 25.04.2012

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
So now i FS now Fix but how can i make the cash permanently in the Player who robbed the bank?
Check your PlayerInfo enum. Is there anything like this : PlayerInfo[playerid][pCash] or PlayerInfo[playerid][Cash] or PlayerVar[playerid][pCash] or PlayerVariables[playerid][pCash]

Get that line from your game mode which is amount of cash of the player. Give us that line and we will add it in your current command/function.