Would this work?
#1

I want to increase a variable value, I made the following code:

pawn Код:
public GivePlayerMoneyEx(playerid, money)
{
    GivePlayerMoney(playerid, money);
    pInfo[playerid][pMoney] += money;
    return 1;  
}
Will the pInfo[playerid][pMoney] variable be increased with the value of "money" ? Or do I have to use:

pawn Код:
public GivePlayerMoneyEx(playerid, money)
{
    GivePlayerMoney(playerid, money);
    pInfo[playerid][pMoney] = pInfo[playerid][pMoney] + money;
    return 1;  
}
Thanks for help.
Reply
#2

Yes, that would work. It's the exact same thing without the extra variable.
Reply
#3

Okay, thank. I was a bit suspicious about it, never used it in that way and I don't want to mess up my gamemode. I hate when I change one thing, and then ten other things mess up lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)