How can i change money
#1

How can i change that. They are in that style.
pawn Код:
GivePlayerMoney(giveplayerid, -fine);
pawn Код:
GivePlayerMoney(i, money);
pawn Код:
GivePlayerMoney(playa, money);
pawn Код:
GivePlayerMoney(suspect, -moneys);
pawn Код:
GivePlayerMoney(playerid, -JailPrice[playerid]);
pawn Код:
GivePlayerMoney(playerid, (0 - moneys));
pawn Код:
GivePlayerMoney(giveplayerid, moneys);
pawn Код:
GivePlayerMoney(i, price / 2);
pawn Код:
GivePlayerMoney(playerid, - price);
How they must be in that style : What that i'll give you one Example

pawn Код:
GivePlayerMoney(i, 5000);
Become
pawn Код:
PlayerInfo[playerid][pCash] += 5000;
How must become these top ? Please help me.Thanks in advance
Reply
#2

From what i understood, you want this:

stock C_GivePlayerMoney(playerid,cash)
{
GivePlayerMoney(playerid,cash);
PlayerInfo[playerid][pCash] += cash;
return 1;
}

#if defined _ALS_GivePlayerMoney
#undef GivePlayerMoney
#else
#define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney C_GivePlayerMoney

Put this to the top of your script. Hope i helped
Reply
#3

No bro i just want to help me to converte these top in my topic. like that
pawn Код:
GivePlayerMoney(playerid,cash);
PlayerInfo[playerid][pCash] += cash;
Reply
#4

top? what to convert? from what to what?
Reply
#5

read my topic again
Reply
#6

you can use giveplayermoney(playerid, and here goes any number or variable where number is saved)
so you can write -500 or,
new money = -500;
same thing
Reply
#7

Bro i use GivePlayerMoney but i want to delete GivePlayerMoney and to convert in PlayerInfo[playerid][pCash]
Reply
#8

PlayerInfo[playerid][pCash] is saved into player's file, and its loaded later on. You must use GivePlayerMoney and pCash so you can save and show player his current money.
EDIT: here is simple example to show you.
Код:
CMD:buy(playerid, params[])
{
      //player buys some thing
      GivePlayerMoney(playerid, -500);   // changes player's current money on the server
      PlayerInfo[playerid][pCash] -= 500; // changes player money info, which is saved when player disconnects



}
Reply
#9

Yes bro i know i have Giveplayermoney and pCash but i dont how to become these top in my topic in pCash. And i need help to show me how they must become
Reply
#10

with money are easy but without money i dont know they must become
like that

pawn Код:
GivePlayerMoney(giveplayerid, moneys);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)