SA-MP Forums Archive
withdraw command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: withdraw command (/showthread.php?tid=545960)



withdraw command - proSeryoga - 11.11.2014

Help plz command withdraw
Код:
CMD:deposit(playerid, params[])
{
	new string[128], input;
	if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /deposit [amount]");
	if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
	PlayerInfo[playerid][Bank] += input, GivePlayerMoney(playerid, -input);
	format(string, sizeof(string), "SERVER:{FFFFFF} You have deposited $%d into your bank account.", input);
	SendClientMessage(playerid, 0x46E850FF, string);
	return 1;
}



Re: withdraw command - DavidBilla - 11.11.2014

pawn Код:
CMD:withdraw(playerid, params[])
{
    new string[128], input;
    if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw [amount]");
    if(PlayerInfo[playerid][Bank] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money in bank!");
    PlayerInfo[playerid][Bank] -= input, GivePlayerMoney(playerid, input);
    format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
    SendClientMessage(playerid, 0x46E850FF, string);
    return 1;
}



Re: withdraw command - Eth - 11.11.2014

pawn Код:
CMD:withdraw(playerid, params[])
{
    new string[128], input;
    if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw[amount]");
    if(PlayerInfo[playerid][Bank] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money in bank!");
    PlayerInfo[playerid][Bank] -= input, GivePlayerMoney(playerid, input);
    format(string, sizeof(string), "SERVER:{FFFFFF} You have withdraw $%d into your bank account.", input);
    SendClientMessage(playerid, 0x46E850FF, string);
    return 1;
}