Request | make the bank system dialoge
#1

Can someone please make the Bank dialogue system,
I could not, I'd be happy if someone help me
Thanks


Код:
//---------------------------------Bank System----------------------------------
	if(strcmp(cmd, "/Deposit", true) == 0)
	{
  if(!CPS_IsPlayerInCheckpoint(playerid,CP_Bank))return SendClientMessage(playerid, COLOR_KRED, "/Bank - To make this command you are bound to be a bank");
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp))return SendClientMessage(playerid,COLOR_WHITE, "/Deposit [Amount] ");
  if(strlen(tmp) > 10 || strval(tmp) < 1 || !IsNumber(tmp))return SendClientMessage(playerid,COLOR_WHITE, "/Deposit [Amount] ");
	if(FAC_GetPlayerMoney(playerid) < strval(tmp))return SendClientMessage(playerid, COLOR_BRIGHTRED, "[Bank System] You do not have this amount of money");
  SendClientMessage(playerid, COLOR_YELLOW,"Wait...");
	SetTimerEx("BankDeposit",5000,0,"ii",playerid,strval(tmp));
  return 1;
	}

//==============================================================================
	if(strcmp(cmd, "/DepositAll", true) == 0)
	{
  if(!CPS_IsPlayerInCheckpoint(playerid,CP_Bank))return SendClientMessage(playerid, COLOR_KRED, "/Bank - To make this command you are bound to be a bank");
  	if(FAC_GetPlayerMoney(playerid) < 1)return SendClientMessage(playerid, COLOR_BRIGHTRED, "[Bank System] You do not have this amount of money");
  SendClientMessage(playerid, COLOR_YELLOW,"...deposit...wait");
	new allamount = FAC_GetPlayerMoney(playerid);
  SetTimerEx("BankDeposit",5000,0,"ii",playerid,allamount);
  return 1;
  }
//------------------------------Withdraw from Bank------------------------------
	if(strcmp(cmd, "/Withdraw", true) == 0)
	{
  if(!CPS_IsPlayerInCheckpoint(playerid,CP_Bank))return SendClientMessage(playerid, COLOR_KRED, "/Bank - To make this command you are bound to be a bank");
	  tmp = strtok(cmdtext, idx);
	  if(!strlen(tmp))return SendClientMessage(playerid,COLOR_WHITE, "/Withdraw [Amount] - щйоещ");
	  if(strlen(tmp) > 10 || strval(tmp) < 1)return SendClientMessage(playerid,COLOR_WHITE, "/Withdraw [Amount] -");
	  if(!IsNumber(tmp))return SendClientMessage(playerid,COLOR_WHITE, "/Withdraw [Amount] - щйоещ");
 		if(strval(tmp) > dini_Int(PlayerFile(playername),"Bank"))return SendClientMessage(playerid, COLOR_BRIGHTRED, "[Bank System] Can not find
this
amount in your account");
		FAC_GivePlayerMoney(playerid,strval(tmp));
		dini_IntSet(PlayerFile(playername), "Bank",dini_Int(PlayerFile(playername),"Bank") - strval(tmp));
		format(String, sizeof(String), "Your Balance now[%d $] -you Withdraw from your account [%d $]",dini_Int(PlayerFile(playername),"Bank"),strval(tmp));
		SendClientMessage(playerid, COLOR_YELLOW, String);
		return 1;
  	}


  	if(strcmp(cmd, "/WithdrawAll", true) == 0 )
	{
  if(!CPS_IsPlayerInCheckpoint(playerid,CP_Bank))return SendClientMessage(playerid, COLOR_KRED, "/Bank -To make this command you are bound to be a bank");
    format(String, sizeof(String), ".[%d $] Pulled all the money from your account",dini_Int(PlayerFile(playername),"Bank"));
    SendClientMessage(playerid, COLOR_YELLOW, String);
    FAC_GivePlayerMoney(playerid,dini_Int(PlayerFile(playername),"Bank"));
    dini_IntSet(PlayerFile(playername), "Bank",0);
    return 1;

    }
//-----------------------------------Balance------------------------------------
	if(strcmp(cmd, "/Balance", true) == 0){
  if(!CPS_IsPlayerInCheckpoint(playerid,CP_Bank))return SendClientMessage(playerid, COLOR_KRED, "/Bank - To make this command you are bound to be a bank");
  format(String, sizeof(String), ".Your Balance:[%d $] ",dini_Int(PlayerFile(playername),"Bank"));
	SendClientMessage(playerid, COLOR_YELLOW, String);
  return 1;
	}
Reply
#2

Ask in the script request topic.
Reply
#3

http://forum.sa-mp.com/index.php?topic=144062.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)