PDA

View Full Version : houses.


MarioCremades
24/11/2012, 06:11 AM
Hi, I have the system modified Sandra properties ladmin my system, the problem is that to buy a property takes money from everyone, and when it is given at home five minutes, gives all, meaning that when buying a home purchased for all players not able to get Right eh Any solution? ;) ..

DaRk_RaiN
24/11/2012, 08:46 AM
You must have used foreach or something like this
for(new i = 0; i < MAX_PLAYERS; i++)
That will take money from all the players.
Show me the part of code that takes money from the player i can't tell..

MarioCremades
24/11/2012, 10:47 AM
it is this feature?...
forward PropertyPayout();
public PropertyPayout()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerProps[i] > 0)
{
GivePlayerMoney(i, EarningsForPlayer[i]);
}
}
}
}
just as I said, is that when buying a buy for all ..
Here's the system admin who has: http://www.solidfiles.com/d/1fd0dcd1ea/

Jordan98
24/11/2012, 01:13 PM
This put it up at all:
forward PropertyPayout();

This put it in OnGamemodeInit:
SetTimer("PropertyPayout", 60000, 1);

This put it down at all:
public PropertyPayout()
{
new str[64];
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerProps[i] > 0)
{
GivePlayerMoney(i, EarningsForPlayer[i]);
format(str, 64, "You won $%d of its properties!", EarningsForPlayer[i]);
SendClientMessage(i, 0xFFFF00AA, str);
}
}
}
}