SA-MP Forums Archive
Help /robbank command - 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: Help /robbank command (/showthread.php?tid=318777)



Help /robbank command - Dark Crow - 16.02.2012

I have this



the problem is when i type /robbank i can type again and again how can i make when i type once that i won't be able to type in an hour again ?? and the bank alarm to be seen only by the Police which are teams 1, 2 ,3 if anyone knows??


Re: Help /robbank command - deltapro - 16.02.2012

https://sampwiki.blast.hk/wiki/SetTimer
This will be helpfull i think

and this
Quote:

If PlayerInfo[playerid][playerteam]==SASF || PlayerInfo[playerid][playerteam]==COPS || PlayerInfo[playerid][playerteam]==FBI)
SendClientMessage(playerid,COLOR_BRIGHTRED,"[Los Santos bank is robbed."); // You can change the text
SendClientMessage(playerid,COLOR_BRIGHTRED,"[Go Fast and arrest the robbers"); // You can change the text
SendClientMessage(playerid,COLOR_BRIGHTRED,"[Fast Fast FAST! .."); // You can change the text




Re: Help /robbank command - M.Wilson - 16.02.2012

solved already?


Re: Help /robbank command - park4bmx - 16.02.2012

pawn Код:
//at the top
new UseCmd[MAX_PLAYERS];

if(strcmp(cmdtext, "/robbank", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(UseCmd[playerid]==1) return SendClientMessage(playerid,-1,"You need to wait 1hr to use this command!");//check if the player has typed the cmd
            SetTimerEx("RobBankCmd", 3600000, false, "i", playerid);//if not then set a timer
            UseCmd[playerid]=1;//make sure the player will not use the cmd for 1hr
            if(PlayerInfo[playerid][pRank] < 5)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Morate da ste  Rank 5 za da ja ograbite bankata !");
                return 1;
            }
            if(RobStart2[playerid] == 1)
            {
                if (!PlayerToPoint(30, playerid, -482.10000610,-183.69999695,972.29998779))
                {
                    SendClientMessage(playerid, COLOR_GREY, "You aren't near a bank!");
                    return 1;
                }
                if(BankRobbedLast+60000 > gettime()) return SendClientMessage(playerid, 0xFF0000FF, "The bank was already robbed.");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                SendClientMessage(playerid,COLOR_WHITE,"||| VESTI NA DENOT |||");
                format(string, sizeof(string), "BANK ALARM: %s go zapocna grabezot BANK ALARM !!!.", sendername);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendClientMessage(playerid,COLOR_WHITE,"** Please wait 5 min  while the money are transfered");
                SetTimerEx("RobDone",60000, false, "i", playerid);
                BankRobbedLast = gettime();
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "* You can't do that ! ");
            }
        }
    }

//at the bottom
forward RobBankCmd(playerid);
public RobBankCmd(playerid){
UseCmd[playerid]=0;
return 1;
}
i dont know what tha check is "if(PlayerInfo[playerid][pRank] < 5)"
but if its to not allow a lower level rank to accses this then put the code i added after it


Re: Help /robbank command - Dark Crow - 18.02.2012

that doesn't work i rob the bank but i never get the money 10 min pass adn you don't get nothing


Re: Help /robbank command - park4bmx - 18.02.2012

Quote:
Originally Posted by Dark Crow
Посмотреть сообщение
that doesn't work i rob the bank but i never get the money 10 min pass adn you don't get nothing
there is no GivePlayerMoney code on ther :X
i only added the time limiter !
EDIT
after 5 min the money are transfared
pawn Код:
//at the top
new UseCmd[MAX_PLAYERS];

if(strcmp(cmdtext, "/robbank", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(UseCmd[playerid]==1) return SendClientMessage(playerid,-1,"You need to wait 1hr to use this command!");//check if the player has typed the cmd
            if(PlayerInfo[playerid][pRank] < 5)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Morate da ste  Rank 5 za da ja ograbite bankata !");
                return 1;
            }
            if(RobStart2[playerid] == 1)
            {
                if (!PlayerToPoint(30, playerid, -482.10000610,-183.69999695,972.29998779))
                {
                    SendClientMessage(playerid, COLOR_GREY, "You aren't near a bank!");
                    return 1;
                }
                if(BankRobbedLast+60000 > gettime()) return SendClientMessage(playerid, 0xFF0000FF, "The bank was already robbed.");

                GetPlayerName(playerid, sendername, sizeof(sendername));
                SendClientMessage(playerid,COLOR_WHITE,"||| VESTI NA DENOT |||");
                format(string, sizeof(string), "BANK ALARM: %s go zapocna grabezot BANK ALARM !!!.", sendername);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendTeamMessage(1, COLOR_YELLOW, string);
                SendTeamMessage(2, COLOR_YELLOW, string);
                SendTeamMessage(3, COLOR_YELLOW, string);
                SendClientMessage(playerid,COLOR_WHITE,"** Please wait 5 min  while the money are transfered");
                SetTimerEx("RobDone",60000, false, "i", playerid);
                SetTimerEx("RobBankCmd", 3600000, false, "i", playerid);//1hr timer
                UseCmd[playerid]=1;//make sure the player will not use the cmd for 1hr
                BankRobbedLast = gettime();
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "* You can't do that ! ");
            }
        }
    }

forward RobDone(playerid);
public RobDone(playerid){
SendClientMessage(playerid,COLOR_WHITE,"Robbery done");
GivePlayerMoney(playerid,0000);//change it to what ever you want !
return 1;
}

//at the bottom
forward RobBankCmd(playerid);
public RobBankCmd(playerid){
UseCmd[playerid]=0;
return 1;
}



Re: Help /robbank command - Dark Crow - 25.02.2012

well i tryed it but it works but a problem when a player robs the bank and then tryes again after an hour it still says The bank was roobed do i need a public for
Код:
BankRobbedLast+60000
or something else to make the bank to be robbed every 1 pay day (hour)


Re: Help /robbank command - Wizz123 - 25.02.2012

Esss


Re: Help /robbank command - park4bmx - 26.02.2012

Quote:
Originally Posted by Dark Crow
Посмотреть сообщение
well i tryed it but it works but a problem when a player robs the bank and then tryes again after an hour it still says The bank was roobed do i need a public for
Код:
BankRobbedLast+60000
or something else to make the bank to be robbed every 1 pay day (hour)
Don't use 6000
Just put = 1 when the player has used the cmd then after the 1hr timer put = 0
And yes mai it global.
Also u will need to change your if(BankRobbedLast==1){ that's when they robbeded the bank !


Re : Help /robbank command - ChrisRedfield00 - 03.05.2012

still i can`t use it alot of errors 20

here is the errors


C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(57256) : warning 217: loose indentation
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(60327) : warning 217: loose indentation
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88696) : warning 217: loose indentation
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88703) : warning 217: loose indentation
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88712) : warning 217: loose indentation
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88749) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88751) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88753) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88754) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88757) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88759) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88761) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88764) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88766) : error 010: invalid function or declaration
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(8876 : error 021: symbol already defined: "GetPlayerName"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88771) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88772) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88773) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88774) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88775) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88776) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88777) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(8877 : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88779) : error 021: symbol already defined: "SendTeamMessage"
C:\Users\Harold\Desktop\tmp_fm_LAsRPUPDATED\gamemo des\tmp_fm_tmp_fm_tmp_fm_NG-RP.pwn(88786) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


20 Errors.