GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]); Problem
Hello all.

(pNovac means pMoney)

I'm having a problem.
When the player completes a job (like going through checkpoints) it is supposed to give him \$100:

Код:
```PlayerInfo[playerid][pNovac] = GetPlayerMoney(playerid) + 100;
GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);```

pNovac * 2 + 100

Could somebody help (if you understand)?

Also, when the player reconnects, it gives him the money like it's supposed to (\$1100 instead of \$2100)
That becoz u Gave money 2 times by 2 ways.
He have no money then u used first line to set PlayerInfo[playerid][pNovac] to 100\$ then again GivePlayerMoney PlayerInfo[playerid][pNovac]

Make it just
Код:
```new money;
GetPlayerMoney(playerid, money);
ResetPlayerMoney(playerid);
SetPlayerMoney(playerid, money+ 100); //replce 100 to how much money will u give
return 1;```
Код:
`SetPlayerMoney`
This function doesn't exist.
Sorry its my mistake
Код:
```new money;
GetPlayerMoney(playerid, money);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, money+ 100); //replce 100 to how much money will u give
return 1;```
Lmfao u can just make it
Код:
`GivePlayerMoney (playerid, 100); //replce 100 to how much money will u give`
If u want to make msg for that then use the 1st code
Oh, lmfao i'm dumb, thank you.
Quote:
 Originally Posted by Theepiccoder Oh, lmfao i'm dumb, thank you.
You are welcome.
To update pNovac, do this:
Код:
`PlayerInfo[playerid][pNovac] += money;`
+= -> Increase by
-= -> Decrease by
*= -> Multiply by
/= -> Divide by

Forum Jump:

Users browsing this thread: 1 Guest(s)