SA-MP Forums Archive
[HELP] /deposit 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: [HELP] /deposit command (/showthread.php?tid=329182)



[HELP] /deposit command - BigBaws - 27.03.2012

Hello guys i have a bug when i /deposer ( deposit cash ) it deposing in anywhere oO whats the wrong on the code

Код:
if(strcmp(cmd, "/deposer", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 2308.9021,-13.2615,26.7422))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Vous n'кtes pas a la banque!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposer [montant]");
				format(string, sizeof(string), "Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			new cashdeposit = strval(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposer [montant]");
				format(string, sizeof(string), "Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Vous n'avez pas cette somme sur vous.");
				return 1;
			}
			SafeGivePlayerMoney(playerid,-cashdeposit);
			new curfunds = PlayerInfo[playerid][pAccount];
			PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
			SendClientMessage(playerid, COLOR_WHITE, "|___________ Extrait de Compte ___________|");
			format(string, sizeof(string), "  Argent sur le compte avant depфt: $%d", curfunds);
			SendClientMessage(playerid, COLOR_GRAD2, string);
			format(string, sizeof(string), "  Somme dйposйe: $%d",cashdeposit);
			SendClientMessage(playerid, COLOR_GRAD4, string);
			SendClientMessage(playerid, COLOR_GRAD6, "|------------------------------------------|");
			format(string, sizeof(string), "  Argent sur le compte aprиs dйpфt: $%d", PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}
		return 1;
	}



Re: [HELP] /deposit command - captainjohn - 27.03.2012

What do you actually want it to do?

Deposit money only if you are inside a bank?


Re : [HELP] /deposit command - BigBaws - 27.03.2012

yea im making a costum Bank & this is the interior PlayerToPoint(1.5, playerid, 2308.9021,-13.2615,26.7422))

but i cant /deposit cash in all city not only on the bank :/


Re: [HELP] /deposit command - Skribblez - 27.03.2012

have you tried using

pawn Код:
IsPlayerInRangeOfPoint
instead of the one that you're using now?