help with my bank
#1

Hey, I just made a bank system for my GM but now I need to know how to get it to work whenever a player is in a correct interior, this is what I got so far:

pawn Код:
new BankInteriors[][] =
{
    18,4,6,17
};
pawn Код:
CMD:deposit(playerid,params[])
{
    if(GetPlayerInterior(playerid) == BankInteriors)
    {
        new ammount,pn[MAX_PLAYER_NAME],file[256],str[128];
        if(Logged[playerid] == 0) return SendClientMessage(playerid,WHITE,"You have to be logged in to use this");
        if(sscanf(params,"i",ammount))
        {
            SendClientMessage(playerid,WHITE,"USAGE: /deposit [AMMOUNT]");
            return 1;
        }
        if(ammount > GetPlayerMoney(playerid) || ammount <= 0) return SendClientMessage(playerid,WHITE,"Invalid ammount");
        GetPlayerName(playerid,pn,sizeof(pn));
        format(file,sizeof(file),"NewAdmin/Users/%s",pn);
        BMoney[playerid] += ammount;
        format(str,sizeof(str),"You have just deposited $%d into your account, your current balance is $%d",ammount,BMoney[playerid]);
        SendClientMessage(playerid,LIMEGREEN,str);
        dini_IntSet(file,"BMoney",BMoney[playerid]);
        GivePlayerMoney(playerid,-ammount);
       
    }
    else
    {
        SendClientMessage(playerid,WHITE,"You are not at a bank");
        return 1;
    }
}
and my error:
Код:
gamemodes\CoolGamemode.pwn(810) : error 033: array must be indexed (variable "BankInteriors")
Reply


Messages In This Thread
help with my bank - by mrcoolballs - 05.09.2010, 02:28
Re: help with my bank - by Toni - 05.09.2010, 02:31
Re: help with my bank - by mrcoolballs - 05.09.2010, 02:38
Re: help with my bank - by Toni - 05.09.2010, 02:52
Re: help with my bank - by mrcoolballs - 05.09.2010, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)