Author Topic: Stop allowing negative score  (Read 2651 times)

In my NFS server you can go to the casino to earn points (leaderboard score), which can be exchanged for money.
The only problem with this is that incScore will keep removing score even if it is negative.
Can someone make an event that can check if your points are negative, and then have two new conditions (onScorePositive and onScoreNegative) for events?

For example, using MoneyMod (mngScore means manage score):

0 - onActivate > Client > mngScore [-1000] [1,2] (Here the first box is the amount of score to add or remove, and the second box is which events to affect)
1 - onScorePositive > Self > MM_addMoney [500]
2 - onScoreNegative > Client > ChatMessage [<color:ffffff>You don't have enough points.]

Onactivate > client > vceifvariable score => 1
Onvariabletrue > whatever your money events are
Onvariabletrue > client > incScore > -1
Onvariablefalse > whatever

Yeah except that’s VCE and forget that

I suppose somebody could probably just package setScore to set it to 0 whenever it's set below 0

Yeah except that’s VCE and forget that
What is wrong with VCE?

Yeah except that’s VCE and forget that
You wanted a solution, this is the easiest one.

I suppose somebody could probably just package setScore to set it to 0 whenever it's set below 0
Problem would still exist. He says people are getting into negatives and still able to convert money. Remaking setscore would still allow people to convert points, get below 0, get set back to 0, convert points again; free money. He needs something to check and prevent going below 0 while also preventing infinite money, hence VCE.
« Last Edit: December 03, 2017, 09:09:03 AM by Blockhead31735 »

You wanted a solution, this is the easiest one.
Wtf no it isn't?
The easiest solution would be to give him a new output event (this is the S&R forum afterall) that falls if there isn't enough score.
That way he just has one event he has to put in instead of a whole mess of VCE nastiness

Wtf no it isn't?
The easiest solution would be to give him a new output event (this is the S&R forum afterall) that falls if there isn't enough score.
That way he just has one event he has to put in instead of a whole mess of VCE nastiness
If it is so easy go ahead

If it is so easy go ahead

I only have my phone available to me currently so I can't do it 100% but it would basically just be like

Code: [Select]
function GameConnection::incScore2(%cl,%score)
{
    if((%cl.score - %score) < 0)
        %cl.centerprint("You don't have enough score!", 3);
    else
        %cl.incScore(%cl,%score);
}

Since I only have my phone this is obviously completely untested, and is also missing the registerOutputEvent call. Anyone else is welcome to take this code, finish it up and package it as an add-on for op


Edit: of course I'm realizing now that OP needs a two part event thing, that also adds some money, only if the subtract score is successful?
In that case either VCE or modify the above code to call the MM_addMoney event?
« Last Edit: December 03, 2017, 12:46:20 PM by Headcrab Zombie »

Wtf no it isn't?
The easiest solution would be to give him a new output event (this is the S&R forum afterall) that falls if there isn't enough score.
That way he just has one event he has to put in instead of a whole mess of VCE nastiness
4 already made events is more time consuming than making and testing your own event?

Suggestions and requests isn't the place for giving people workarounds. Especially if the requester has already rejected it.
If you don't like the fact that he doesn't want VCE, then stop posting in here.

Suggestions and requests isn't the place for giving people workarounds. Especially if the requester has already rejected it.
If you don't like the fact that he doesn't want VCE, then stop posting in here.
It's not a workaround. It fixes his problem completely. One event checks score (ifvariablescore) and the positive and negatives (variabletrue/false) do exactly that.

sounds like he's asking for a stripped down version of VCE

what's wrong with using VCE?

I'll just make it when I get home, then.

4 already made events is more time consuming than making and testing your own event?
Yes.
This is the S&R forum, where people can request things to be made for them.
Him throwing one event on a brick is easier than him throwing several events on a brick. There are no other factors involved in measuring complexity than what the OP has to do to use it.
And the code for the event is simple enough that I was able to type it on a phone

If you don't like the fact that he doesn't want VCE, then stop posting in here.