+ & - Confusion
#1

Hello guys, so I'm trying to configure a code it, I'm asking you guys how do you detect for example like if you're decreasing the player's money, using
pawn Код:
GivePlayerMoneyEx(playerid, -5000);
and if you like increase the player's money you're using
pawn Код:
GivePlayerMoneyEx(playerid, 5000);
Since the +(plus) sign is already on the stock I made, does any one have an idea, like detecting the player's money if it is decrasing or increasing, this is a quick sketch or example of it

pawn Код:
stock GivePlayerMoneyEx(playerid, ammount)
{
    new string[24];
    OldMoney[playerid] = GetPlayerMoney(playerid);
    NewMoney[playerid] += ammount;
    GivePlayerMoney(playerid, ammount);

    //if it is +(plus) sign
    format(string, sizeof(string), "+%d", ammount);
    // else
    // if it is -(minus) sign
    format(string, sizeof(string), "-%d", ammount);
    GameTextForPlayer(playerid, string, 2000, 1);
    return 1;
}
Reply


Messages In This Thread
+ & - Confusion - by Patrick - 18.09.2013, 21:45
Re: + & - Confusion - by Konstantinos - 18.09.2013, 21:49
Re: + & - Confusion - by Patrick - 18.09.2013, 21:55

Forum Jump:


Users browsing this thread: 1 Guest(s)