[HELP] /deposit command
#1

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;
	}
Reply
#2

What do you actually want it to do?

Deposit money only if you are inside a bank?
Reply
#3

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 :/
Reply
#4

have you tried using

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


Forum Jump:


Users browsing this thread: 1 Guest(s)