bank help
#1

ok i need some help i need someone how to tell me how to make it so i can go ...


/bank <amount>

then this happens ....

gPlayerInfo[playerid][PLAYER_BANK] = (amount)


useing this


Code:
dcmd_bank(playerid, params[])
{
if (strlen(params))
	{
		if (IsPlayerConnected(playerid))
		{
			SendClientMessage(playerid, 0x00FF00AA, "Money Hase Been Banked");
		}
	}
	else
	{
		SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/bank \"");
	}
}

	return 1;
}
Reply
#2

pawn Code:
dcmd_bank(playerid, params[])
{
  if(!IsPlayerConnected(playerid)) return 1;

  new money;
  if (sscanf(params, "d", money) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bank <ammount>");
 
  if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You can't bank more money then you actually have");

  GivePlayerMoney(playerid, money*(-1));  
  gPlayerInfo[playerid][PLAYER_BANK] = gPlayerInfo[playerid][PLAYER_BANK] + money;
  return 1;
}
I use sscanf
https://sampwiki.blast.hk/wiki/Sscanf_code
Reply
#3

Quote:
Originally Posted by dice7
pawn Code:
dcmd_bank(playerid, params[])
{
  if(!IsPlayerConnected(playerid)) return 1;

  new money;
  if (sscanf(params, "d", money) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bank <ammount>");
 
  if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You can't bank more money then you actually have");

  GivePlayerMoney(playerid, money*(-1));  
  gPlayerInfo[playerid][PLAYER_BANK] = gPlayerInfo[playerid][PLAYER_BANK] + money;
  return 1;
}
I use sscanf
https://sampwiki.blast.hk/wiki/Sscanf_code
thx for the help

Reply
#4

how would i make it so i can take out money my problem is this

GivePlayerMoney(playerid, money2*(+1));
gPlayerInfo[playerid][PLAYER_BANK] = gPlayerInfo[playerid][PLAYER_BANK] - money2;

i whant the money to go up for player but down for the bank plz help
Reply
#5

*bump*

i am still haveing problems with this plz help
Reply
#6

ok i got that working but now how would i make that so i can transfer it .. help plz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)