05.09.2010, 02:28
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:
and my error:
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;
}
}
Код:
gamemodes\CoolGamemode.pwn(810) : error 033: array must be indexed (variable "BankInteriors")