SA-MP Forums Archive
[FilterScript] Server-Sided Stunt Bonus - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Server-Sided Stunt Bonus (/showthread.php?tid=605516)



Server-Sided Stunt Bonus - NaS - 20.04.2016

Server-Sided Stunt Bonus detection v0.1
Hey!

Today I want to present you a small Filterscript I've made a few days ago.

It's really simple and may not work perfectly always due to the time that passes between two Timer calls.
However, it enables you rewarding players for actual stunts, without abusing (SP Stunt Rewards can be abused with Server Objects).
Thanks to ColAndreas, this works on both, the original map and any mappings you added to your server.

Your objects have to be added to ColAndreas of course.

A Stunt Reward looks like this:



Notes:

- Teleports are catched, you'll get no reward if you teleport mid-air.
- Now your friends (aka passengers) can see the awesome stunts you do too!
- Speedhack is catched too, there is a maximum speed a player can go while stunting.
- All legit ground vehicles are possible to use for stunting.
- The Stunting Rewards are calculated from:
-> Time
-> Distance
-> Num. of Saltos
-> Num. of Barrel Rolls
-> Num. of 360-Turns
- You can do combos of Stunts which add to the reward too. This will be extended to some kind of Stunt Challenge.

Now if you don't want players to farm Money with Stunts, you can add a custom reward too.
For example Stunt Points or a Stunt High Score. Be creative!

In the next versions I'll add a callback for Stunts, so you can handle them in your GM for example. Also some Stunts for Planes (like flying a Loop, Barrel Rolling etc).

Also look at the defines, they let you config some stuff you might want to change (Rewards, Timer Interval, etc).

Collision detection is now using all rotation axes.

Issues:

- Not sure how laggy this can get. You may want to add fewer GroundContact checks or lower the Timer interval. I can give you more info on that if needed.
- The History length (used for efficient rotation processing) does NOT affect the performance - only the memory!

Download:

GitHub - (Click!)

What you also need

- ColAndreas
- Quaternion Stuff Plugin
- foreach

Credits

ProRakNet - Thanks for reminding me of this again :P
Gamer_Z - QuaternionStuff Plugin
Pottus, Slice, Chris42O, uint32 - ColAndreas
ZeeX, Slice, Kar (standalone-version) - foreach
SA-MP Team - SA-MP


Re: Server-Sided Stunt Bonus - Kar - 20.04.2016

I've always wanted to be able to manipulate GTA stunts.. nice! (PS check my pull request!)


Re: Server-Sided Stunt Bonus - Crayder - 20.04.2016

CheckVehicleGroundContact could be drastically improved. The point of it is to check if the wheels are on the ground, but it doesn't. You are already getting the vehicle's quaternion rotation so why aren't you using rX and rY in the CheckVehicleGroundContact function? With that you could easily get the actual wheel position of each wheel and cast rays from the tires away from the bottom of the vehicle (in the actual direction it they should be going)! Plus, this way you would only need 2 or 4 rays, and if those don't detect the wheels on the ground you can check for the rest of the things (in GCRayMatrix).

Other than that, I love it.


Re: Server-Sided Stunt Bonus - NaS - 20.04.2016

Quote:
Originally Posted by Crayder
View Post
CheckVehicleGroundContact could be drastically improved. The point of it is to check if the wheels are on the ground, but it doesn't. You are already getting the vehicle's quaternion rotation so why aren't you using rX and rY in the CheckVehicleGroundContact function? With that you could easily get the actual wheel position of each wheel and cast rays from the tires away from the bottom of the vehicle (in the actual direction it they should be going)! Plus, this way you would only need 2 or 4 rays, and if those don't detect the wheels on the ground you can check for the rest of the things (in GCRayMatrix).

Other than that, I love it.
Yea I know it's not really good (As I noted above I'll extend it to not only rotate around 1 axis). Already started that.
I'll add that landing on wheels gives more money, after adding the "preferred" wheel check.

However I could reduce the number of rays for the Matrix. Instead of casting to every point, I can cast along the sides (a line which catches 3 points at the sides for example). So it would reduce from 18 to 6 or 8.

Thanks for the suggestion.

EDIT: Added correct rotation (x,y,z), will do the wheel checking when I have time again.


Re: Server-Sided Stunt Bonus - Pottus - 21.04.2016

Good idea I am sure you can expand on this further!


Re: Server-Sided Stunt Bonus - ProRakNet - 22.04.2016

That's perfect design, thanks again for your interest.


Re: Server-Sided Stunt Bonus - Amunra - 25.04.2016

Very Simple But Usefull...
Love It