• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] add, subtract
#1
I haven't did any coding over 4-5 years now. Anyways I decided to start working on my gamemode again. I used to have an include to add, subtract, divide, multiply stocks. Does anyone has this include? I have to find all the plugins and includes but since the main forum is down everything is hard to find. Thanks.



Code:
subtract(cash, amount[1])



Code:
stock GivePlayerCash(playerid, amount[]) {

    static cash[256];

    GetPVarString(playerid, "pMoney", cash, 256);

    if(strfind(amount, "-") == 0) SetPVarString(playerid, "pMoney", subtract(cash, amount[1]));

    else SetPVarString(playerid, "pMoney", add(cash, amount));

    return 1;

}
  Reply
#2
What is the name of that include? Did you google it?

Anyway if?you do not find that include, create that function yourself using?strval.
  Reply
#3
This is just ``, `-`, etc. You don't need an include for maths.
  Reply


Forum Jump: