killdahobo99
Unregistered
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
Posts: 1,293
Threads: 6
Joined: Jul 2008
Reputation:
0
When you say drop do you just mean disappear?
killdahobo99
Unregistered
Quote:
Originally Posted by Weirdosport
When you say drop do you just mean disappear?
|
Yeah so it just dissapears
killdahobo99
Unregistered
I know its possible can someone who knows please tell me how to do it
killdahobo99
Unregistered
Anyone please reply sorry for double post
Posts: 70
Threads: 16
Joined: Jul 2009
Reputation:
0
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...
killdahobo99
Unregistered
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"
Posts: 2,593
Threads: 34
Joined: Dec 2007
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;
}
killdahobo99
Unregistered
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
Posts: 2,593
Threads: 34
Joined: Dec 2007
edited version UP :P
SetTimerEx("GetCash", 5000, 0,"d", i);
to
SetTimerEx("GetCash", 5000, 1, "d", i);