Mathematical functions? - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mathematical functions? (
/showthread.php?tid=287770)
Mathematical functions? -
knackworst - 04.10.2011
I got a little mathematical question:
Is it possible to make a math function to be used in samp?
Example: f(x) = X^2
In wich f(x) represents fe: the z position of a vehicle
And the x represents the time?
Re: Mathematical functions? -
sherlock - 04.10.2011
What do you mean exactly?? I know that you can make a calculator ingame if thats what you meant.
Re: Mathematical functions? -
knackworst - 04.10.2011
Hmmm u need a real life calculator and type the function
F(x)=x^2
If u look the Y stuff as the samp height and x stuff as ingame time u can create some awesome stuff...
The function x^2 would make a vehicle go very high in the air, then the vh would go down in an increasing speed until he reached point 0 tyen it goes back up for example...
Re: Mathematical functions? -
GrimR - 04.10.2011
Well you can do simple math and use AND, OR etc....
You can also make functions....
So my initial guess would be absolutely, why not?
.
Re: Mathematical functions? -
cessil - 05.10.2011
yeah use GetVehiclePos for the z value and gettime for time
Re: Mathematical functions? -
knackworst - 05.10.2011
So it should be somethikg like this:
GetVehiclePos = timevalue^2
Setvehiclepos(result)
in wich timevaleu gets +1 every 500 ms f.e?