Author Topic: How to make cash system?  (Read 754 times)

0 Members and 1 Guest are viewing this topic.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
How to make cash system?
« on: July 28, 2008, 10:10:58 am »
How to make cash system?

Like when you kill someone, you are awarded some money for the team, and for this money, you can buy things.

I just need an explanation and meaby a bit of a script, i will do the rest myself.

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: How to make cash system?
« Reply #1 on: July 28, 2008, 10:45:04 am »
How to make cash system? I just need an explanation and meaby a bit of a script, i will do the rest myself.
... Um. Right.

Have an array of integers, let's call it, say, money, add however much you see fit to money[Killer] in OnPlayerKill. Make sure to properly reset it if a player would leave the game as well in OnLeaveGame. Implement some sort of /buy command using OnPlayerCommand, checking and decreasing the player's money as you see fit.

For further reference, you could check out either of the two Counter-Strike scripts around, which both have a money system implemented (s'if a single variable would be enough to call it a system though).

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: How to make cash system?
« Reply #2 on: July 28, 2008, 10:46:36 am »
You already kinda explain it by yourself i guess

Kill someone ---> onplayerkill ---> give money
Create a integer that contains the teams money. Sth like alphaMoney := alphaMoney + 10;
or learn how to use arrays which would be better. I don't bother if you hit me up on IRC.
Good luck!

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: How to make cash system?
« Reply #3 on: July 28, 2008, 10:50:32 am »
If you want a basic shop script , here it goes. This script created by Curt(DorkeyDear)