Problem with giveplayerMoney to right person
#5

I'm not sure about this part:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
  {
    new robcash = GetPlayerMoney(i)/i; // < untested never did it like this b4 but it is suppose to work......
    GivePlayerMoney(playerid, 10000000/robcash);
  }
Firstly if the player was ID 0 and they had more than 10 million in cash, not to mention, why are you getting the money from other players anyway? :S
You started a loop, so that if there is like 10 people connected, it is going to give a certain amount to the player from each players 10 times. So they may end up getting 100 million. I would recommend testing a code if you don't understand it, and if you're certain it works, then you can feel confident that it works. Other than that tiny flaw, good effort.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)