That code is wrong. XD
Are you trying to increment the current amount with 147480000? Or are you trying to see if it reaches the gold amount?
1). Are you trying to increment the current amount with 147480000? It would look like:
Code:
amount = amount + 147480000;
2). Or are you trying to see if it reaches the gold amount? It would look like:
Code:
if (amount >= GOLD_CAP)
{
// You have reached the gold cap
}
However, the above isn't needed seeing the 'else' is saying: "You're at the max gold cap" - The code should look like this: (overall)
Since you're in the player class, 'AddItem' is accessible without doing 'm_session->GetPlayer()'. Doing 'm_session->GetPlayer()' shouldn't be used in the player class.
Code:
else // Reached the cap
{
m_session->SendAreaTriggerMessage("You have reached the gold cap and..");
AddItem(100000, 1);
}
The string variable is pretty useless, just do: (without the variable)
Code:
m_session->SendAreaTriggerMessage("You have reached the gold cap and..");
Also, where are you getting 'd' from? It isn't declared at all. You can't use something that isn't declared. XD