Help /robbank command
#1

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??
Reply
#2

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

Reply
#3

solved already?
Reply
#4

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
Reply
#5

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

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;
}
Reply
#7

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)
Reply
#8

Esss
Reply
#9

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 !
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)