Topic: [PROBLEM] Only one person can gain bonus from a tile
Hi!
Yes it's me again
I've created a new tile that gives a player some money.
switch(GameServer()->Collision()->GetTile(m_Pos.x, m_Pos.y))
{
case CCollision::COLFLAG_MONEY50:
if(Server()->Tick() > lastMoney + Server()->TickSpeed())
{
// ccity.pMoney[m_pPlayer->GetCID()] += 50;
m_Money += 50;
char Buf[128];
// str_format(Buf, sizeof(Buf), "Your money: %d $", ccity.pMoney[m_pPlayer->GetCID()]);
str_format(Buf, sizeof(Buf), "Your money: %d $", m_Money);
GameServer()->SendBroadcast(Buf, m_pPlayer->GetCID());
lastMoney = Server()->Tick();
}
break;
}
If one player stands on the tile, he/she can earn money. But if someone stands on the same tile too (but in another place), he/she can't earn money (a player who joined the latest can do it).
Can someone help me with this problem?