SA-MP Forums Archive
[FilterScript] Xeon's Speedometer (Analog Speedmeter) - 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] Xeon's Speedometer (Analog Speedmeter) (/showthread.php?tid=641735)

Pages: 1 2


Xeon\'s Speedometer (Analog Speedometer) - Xeon™ - 19.09.2017

Xeon Speedmeter


Introduction:


Hello,


This is another speedo filterscript, just like others but this one uses analogic speed counter instead of numeric one.

this fs has been done using 18 Global textdraws and 4 Player textdraws and it was optimized so much, testing/recording was done by Abyss Morgan (Big Thanks!) and let\'s not forget BigETI for his major update to this project!, hope you have fun by doing it. for future versions of this speedmeter I\'m gonna add fuel support and nitros. you can find source code here.

Screenshots:

Click Here!
Click Here!


(The pictures resolutions is too big, sorry about that)

Video:

https://*********/_I5l2s974xM

How to install?:


- Download xspeedo.pwn and foreach.inc

- C&P foreach in the include folder at your pawn directory

- Edit "Xeon Test Server" & MAX_SLOTS onto anything you want.

- Press F5 (Compile the script)

- Copy output file name (xspeedo.amx) to filterscripts folder on your server root directory.

- Add it on server.cfg

- Restart your server and you are done!

Download:

Click on me!

Credits:


*SA:MP Team (a_samp)

*foreach (Kar)

*Abyss Morgan (Testing, Recording, Supporting, Hosting)

*BigETI (Major Update 3.0)

*Kar (Reserve detection)

*Michael (GetPlayerSpeed)


Re: Xeon\'s Speedometer (Analog Speedmeter) - SonnyGamer - 19.09.2017

Good Job!
Thanks for sharing. You totally deserve +rep


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 19.09.2017

Quote:
Originally Posted by SonnyGamer
View Post
Good Job!

Thanks for sharing. You totally deserve +rep
Thank you for your feedback! hope you like it.


Re: Xeon\'s Speedometer (Analog Speedmeter) - Meller - 19.09.2017

Looks great for only 17 textdraws, well done.


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 19.09.2017

Quote:
Originally Posted by Meller
View Post
Looks great for only 17 textdraws, well done.
Thanks!


Re: Xeon\'s Speedometer (Analog Speedmeter) - J0sh... - 19.09.2017

welcome back to the 1950s


Re: Xeon\'s Speedometer (Analog Speedmeter) - R4nd4ll - 19.09.2017

That\'s ma\' boy !

Good job nigga +Rep


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 19.09.2017

Thank you! both of you!


Re: Xeon\'s Speedometer (Analog Speedmeter) - DonaldDuck - 20.09.2017

Nice work bro i like the textdraws.


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 20.09.2017

Thank you!


Re: Xeon\'s Speedometer (Analog Speedmeter) - Paulice - 20.09.2017

PHP Code:
for(new 0GetMaxPlayers(); i++) // looping through connected players 
GetPlayerPoolSize exists, use it (note: making it a plug n\' play script for any "SA-MP version" is not a valid excuse to not use the relatively new function)!

PHP Code:
for(new 04i++) // new PlayerText:p_Speedo[MAX_PLAYERS][4];
for(new 018i++) // new Text:g_Speedo[18]; 
Have you never heard of "sizeof"?

PHP Code:
new speed;
speed GetPlayerSpeed(playerid); 
Can you not do "new speed = GetPlayerSpeed(playerid);"?

PHP Code:
if(speed == 0)
{

}
else
{
    if(
speed 0Gear[playerid] = "D";

The second if-then is useless. Speed will obviously always be over 0 (note: there\'s no negative speed)!


-_-

PHP Code:
if(speed 0Gear[playerid] = "D";
if(
IsVehicleDrivingBackwards(GetPlayerVehicleID(playerid))) Gear[playerid] = "R"
Have you never heard of "else if"? Guess not.

PHP Code:
if(speed 200speed 205
Your system supports up to 200. By setting it to 205 when it\'s over 200 tells us either the representation is inaccurate or you know what.


-----

https://cdn.discordapp.com/attachmen.../sa-mp-087.png


- Speed will never go over 999, the extra zero (0) in "0099 KM/H" is useless.

- "Test Server Name" is not centered.

- The alignment of the bar is terrible and inaccurate.

- I have no idea why "Gear:" is in a different font than the speed.

- The number in the middle is just horrendous.


Overall, 2 stars. And I don\'t see why you feel the need to reply "thanks" or "thank you" to every positive post.


Re: Xeon\'s Speedometer (Analog Speedmeter) - Mr.Vince™ - 20.09.2017

Can I Change Position Of Speedmeter To center of the screen


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 20.09.2017

Quote:
Originally Posted by Paulice
View Post
PHP Code:
for(new 0GetMaxPlayers(); i++) // looping through connected players 
GetPlayerPoolSize exists, use it (note: making it a plug n\' play script for any "SA-MP version" is not a valid excuse to not use the relatively new function)!
EDIT: Good Point, i was doing it wrrong

Quote:
Originally Posted by Paulice
View Post
PHP Code:
for(new 04i++) // new PlayerText:p_Speedo[MAX_PLAYERS][4];
for(new 018i++) // new Text:g_Speedo[18]; 
Have you never heard of "sizeof"?
Yes i did heared of it. but in this case its constant. so there no need to wast more ms for a const var.

Quote:
Originally Posted by Paulice
View Post
PHP Code:
new speed;

speed GetPlayerSpeed(playerid); 
Can you not do "new speed = GetPlayerSpeed(playerid);"?
This is under scripter style. its doesn\'t matter in this point. but declaring variable before setting the var is better.

Quote:
Originally Posted by Paulice
View Post
PHP Code:
if(speed == 0)
{

}
else
{
    if(
speed 0Gear[playerid] = "D";

The second if-then is useless. Speed will obviously always be over 0 (note: there\'s no negative speed)!


-_-
if you did notice. i did used "else" without specifing what it should it check. 1 line for checking doesn\'t matter. also its gonna be checked anyway if you do or not, Gear "D" need to be attached.

Quote:
Originally Posted by Paulice
View Post
PHP Code:
if(speed 0Gear[playerid] = "D";
if(
IsVehicleDrivingBackwards(GetPlayerVehicleID(playerid))) Gear[playerid] = "R"


Have you never heard of "else if"? Guess not.
i did heared of it too! but the speed is always positive, so if i used "else" the script won\'t count the reserve gear.

Quote:
Originally Posted by Paulice
View Post
PHP Code:
if(speed 200speed 205
Your system supports up to 200. By setting it to 205 when it\'s over 200 tells us either the representation is inaccurate or you know what.
after i did counted x and y, i did found after 195 the arrow miss 2.0 of x. so i did added 5 to make it right on 200! also the max of speed is 210

Quote:
Originally Posted by Paulice
View Post
https://cdn.discordapp.com/attachmen.../sa-mp-087.png


- Speed will never go over 999, the extra zero (0) in "0099 KM/H" is useless.

- "Test Server Name" is not centered.

- The alignment of the bar is terrible and inaccurate.

- I have no idea why "Gear:" is in a different font than the speed.

- The number in the middle is just horrendous.
- Helicopters goes more than 999km/h

- Finally you did find something useful. i will edit on next update!

- that your opinion, thanks

- Because its Gear. on real cars Gear haven\'ts same font as speed counter.

- Nice to know.

Quote:
Originally Posted by Paulice
View Post
Overall, 2 stars. And I don\'t see why you feel the need to reply "thanks" or "thank you" to every positive post.
Thanks for feedback.


Note: god fathers alraedy checked the script before it goes released. i did worked hard to make opitimzed and clean. their opinion was +4 reps from everyone. and they confirmed to me that\'s a clean script.


Can\'t you stop being like that SickAttack?

Quote:
Originally Posted by Mr.Vince™
View Post
Can I Change Position Of Speedmeter To center of the screen
Yes you can you need only to minus the x values from the real positions


401.etc - 10.0 per textdraw


Re: Xeon\'s Speedometer (Analog Speedmeter) - AbyssMorgan - 20.09.2017

Simple tutorial: How to use GetPlayerPoolSize
PHP Code:
for(new 0GetPlayerPoolSize(); <= ji++){
    if(
IsPlayerConnected(i)){
    
    }




Re: Xeon\'s Speedometer (Analog Speedmeter) - Jayse - 20.09.2017

Quote:
Originally Posted by Paulice
View Post
[..]
5 stars to the thread because you don\'t like it.

Quote:
Originally Posted by AbyssMorgan
View Post
Simple tutorial: How to use GetPlayerPoolSize
PHP Code:
for(new 0GetPlayerPoolSize(); <= ji++){
    if(
IsPlayerConnected(i)){
    
    }

PHP Code:
for( new GetPlayerPoolSize( ); > -1i-- ) 



Re: Xeon\'s Speedometer (Analog Speedmeter) - Paulice - 20.09.2017

Quote:
Originally Posted by Jayse
View Post
PHP Code:
for( new GetPlayerPoolSize( ); > -1i-- ) 
Useless "optimization".

Quote:
Originally Posted by Jayse
View Post
5 stars to the thread because you don\'t like it.
"GetPlayerPoolSize not always working (its kind bugged)"


I may consider doing what you told me earlier XD


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 20.09.2017

Update 2.0:

Features:


- Adding Timers Supports.


Now you can use timers instand of OnPlayerUpdate

HOW? you need only to define USE_TIMERS & UPDATE_DELAY!

Bug Fixes & Optimizations:


- Replaced GetMaxPlayers() with GetPlayerPoolSize thanks to Abyss (again)!


- Changed SERVER_NAME Position to be quite centred!


You can find the progress out here!


Re: Xeon\'s Speedometer (Analog Speedmeter) - Paulice - 20.09.2017

Quote:
Originally Posted by Xeon™
View Post
Bug Fixes & Optimizations:


- Replaced GetMaxPlayers() with GetPlayerPoolSize thanks to Abyss (again)!
Brah, wiki tells you how: https://sampwiki.blast.hk/wiki/GetPlayerPoolSize


Re: Xeon\'s Speedometer (Analog Speedmeter) - Xeon™ - 20.09.2017

Quote:
Originally Posted by Paulice
View Post
didn\'t know about it! too bad.


Re: Xeon\'s Speedometer (Analog Speedmeter) - vassilis - 22.09.2017

That\'s a nice job, Xeon!