Money drop?
#1

how do i make it so, if you have 1M or over, you start dropping 10k at a time so like every 5 secounds you drop 10k and a message pops up saying "Please store your money in the bank"

But if a player is in a vehicle, then his money is safe and wont drop
Reply
#2

When you say drop do you just mean disappear?
Reply
#3

Quote:
Originally Posted by Weirdosport
When you say drop do you just mean disappear?
Yeah so it just dissapears
Reply
#4

I know its possible can someone who knows please tell me how to do it
Reply
#5

Anyone please reply sorry for double post
Reply
#6

you'd need to make a timer and every time the timer goes off (timer would be set to 5000 for 5 seconds) you would GivePlayerMoney as -10000

but I dont understand why you would want them to randomly lose 10k dollars every 5 seconds...
Reply
#7

Quote:
Originally Posted by Annihalation
you'd need to make a timer and every time the timer goes off (timer would be set to 5000 for 5 seconds) you would GivePlayerMoney as -10000

but I dont understand why you would want them to randomly lose 10k dollars every 5 seconds...
I want them to lose 10k everytime they have 1 million or over. I don't want them to be able to carry that much on them, so a Message displays to them, "You have dropped 10k Please deposit your money"
Reply
#8

Maybe something like this?

Код:
//Top
new bool:Set[200];
new Timer[200];

///OnGameModeInit
SetTimer("CheckCash", 2000, true);

//somewhere
forward CheckCash();
public CheckCash()
{
	for(new i=0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i) && GetPlayerMoney(i) >= 1000000)
	{
		if(!Set[i])
		{
			Set[i] = true;
			Timer[i] = SetTimerEx("GetCash", 5000, 1, "d", i);
		}
	}
	return 1;
}

forward GetCash(playerid);
public GetCash(playerid)
{
	if(!GetPlayerMoney(playerid)) // if moneys == 0, timer stop
	{
		KillTimer(Timer[playerid]);
		Timer[playerid] = 0;
		Set[playerid] = false;
		return 1;
	}
	//if(GetPlayerMoney(playerid) < 1000000) Set[playerid] = false;
	GivePlayerMoney(playerid, -10000);
	SendClientMessage(playerid, 0xFFFF00AA, "SERVER: You have dropped 10k Please deposit your money");
	return 1;
}
Reply
#9

Quote:
Originally Posted by Jefff
Maybe something like this?

Код:
//Top
new bool:Set[200];
new Timer[200];

///OnGameModeInit
SetTimer("CheckCash", 2000, true);

//somewhere
forward CheckCash();
public CheckCash()
{
	for(new i=0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i) && GetPlayerMoney(i) >= 1000000)
	{
		if(!Set[i])
		{
			Set[i] = true;
			Timer[i] = SetTimerEx("GetCash", 5000, 1, "d", i);
		}
	}
	return 1;
}

forward GetCash(playerid);
public GetCash(playerid)
{
	if(!GetPlayerMoney(playerid)) // if moneys == 0, timer stop
	{
		KillTimer(Timer[playerid]);
		Timer[playerid] = 0;
		Set[playerid] = false;
		return 1;
	}
	//if(GetPlayerMoney(playerid) < 1000000) Set[playerid] = false;
	GivePlayerMoney(playerid, -10000);
	SendClientMessage(playerid, 0xFFFF00AA, "SERVER: You have dropped 10k Please deposit your money");
	return 1;
}
That only dropped money once...then after that it didnt drop it again. How do i fix this
Reply
#10

edited version UP :P
SetTimerEx("GetCash", 5000, 0,"d", i);
to
SetTimerEx("GetCash", 5000, 1, "d", i);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)