Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] add, subtract

 
  • 0 Vote(s) - 0 Average
Pawn add, subtract
ZyZu.
Offline

Burgershot Member
Posts: 17
Threads: 2
Joined: Apr 2019
Reputation: 0
Location: Canada
#1
2021-11-13, 01:22 AM
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;
}
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#2
2021-11-15, 02:01 PM
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.
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#3
2021-11-17, 09:00 PM
This is just `+`, `-`, etc. You don't need an include for maths.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode