Quote:
Originally Posted by HondaCBR
right cheers, i will defenitly use this, but the 0.5s money update, will this not lag the server when we get involved with a lot of people playing?
And why are you updating score? Is there a score cheat too?
EDIT: right I tried it, and when I used a command to give me money without doing pCash, just giving me money GivePlayerMoney, it gave me it. :/
|
Your timer isn't running in that case.
Just tested the same thing here with giving myself $1000.
The money was counting up, but immediately went down again to the money I had before.
So the timer is resetting my money to the value stored on the server.
Have you started the timer properly? The code I provided used OnfilterscriptInit, but you might be using it in your gamemode, so you need to use OnGameModeInit to start the timer.
You could debug the timer by adding a print statement to see if it runs.
There might be a score cheat (I'm not sure), but I added it anyway just in case.
Your server won't be lagging because of the 0.5s timer. It's only setting 2 values per player, that's not much.
European Trucking has the same timer and it runs smooth with 75 players online.
That server also runs a BIG speedometer-timer every 0.5s for all players too, and still no lag.
That timer updates the speed-readout and fuel-status textdraws, does anti-hack stuff, does 100 distance-checks on speed-camera's to see if a player is speeding and alot more). And that runs for all players too every 0.5s.
And several other timers as well (1s timers).
Quote:
Originally Posted by Basssiiie
The timer is useless.
|
Why would the timer be useless?
It runs perfectly on all servers that use PPC_Trucking.
What if a hacker would succeed in hacking his money and freezing his money onscreen?
When he wants to buy something, he'll always get the message that he doesn't have enough money (as the script checks the server-sided money).
He won't know how much money he really has, since he hacked the money and the value on his screen is incorrect.
The timer just makes sure that he sees the correct amount of money all the time.