This topic was marked solved by its starter, on September 26th, 07:23 PM
Cash Amount at Player Spawn! It is possible?

JhonDude

  • Newbie
  • Posts: 6
Cash Amount at Player Spawn! It is possible?
«  »
Hello Guys! Im new here!
Starting to create a DM server.
The question is: Is there a way for the character to start with some money?
The ideia is to start with $250 or $500.
How can i do that? Is a simple class edit? Or the scripts are the only way?

EnForcer

  • Newbie
  • Posts: 26

JhonDude

  • Newbie
  • Posts: 6
Re: Cash Amount at Player Spawn! It is possible?
« Reply #3,  »
Quote from EnForcer on September 15th, 01:11 PM
use onplayerrequestspawn event and add the requirement of cash like:
Code: [Select]
if ( player.Cash < 250 ) return false;
else return true;
Hello again!
The script didn't work for me.
I dont know wy.

So, i made this in a simple way:
Just add: player.Cash +=500; in the event: onPlayerJoin
Like this:
==================
onPlayerJoin
{
    player.Cash +=500;
}
==================
Now i want to add a timer on this.
Each player must earn the amount of 500 for every 15 minutes of play.

Thanks in advance for any help!

PSL

  • Newbie
  • Posts: 3
Re: Cash Amount at Player Spawn! It is possible?
« Reply #4,  »
This function should help you:
Put the GiveCash(player.ID); in onPlayerJoin.
Code: [Select]
function GiveCash(ID)
{
    local player=FindPlayer(ID);
    if(player)
    {
        player.Cash+=500;
        NewTimer("GiveCash",900000,1,player.ID);
    }
}

JhonDude

  • Newbie
  • Posts: 6
Re: Cash Amount at Player Spawn! It is possible?
« Reply #5,  »
Quote from PSL on September 21st, 11:00 AM
This function should help you:
Put the GiveCash(player.ID); in onPlayerJoin.
Code: [Select]
function GiveCash(ID)
{
    local player=FindPlayer(ID);
    if(player)
    {
        player.Cash+=500;
        NewTimer("GiveCash",900000,1,player.ID);
    }
}
Thanks for the help man!
I tryed the script, but withouth sucsses.
Server starts, and crash on me when "GiveCash" function starts.

So i changed the initial idea to a simple one.
Just add some cash pickups over the map. With a respawntime set on 5min.

this will make the player go around the map looking for these points,
if he wants to have some money at the beginning.

So, tnx for the help!