|
|
#1 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2011
Posts: 348
Reputation: 0
|
Hello.
I, a few days ago, saw a speedometer that inftead to have the text to show the speed, had a real speedometer. I mean numbers (0, 20, 40 ...) arranged in a circle and a needle that moves depending on speed. If you know or have a way to do it, I take. Thank you! |
|
|
|
|
|
#2 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2011
Posts: 590
Reputation: 2
|
use search there is lots of them
http://forum.sa-mp.com/showthread.php?t=128157 <<-- there is one i found Last edited by [LHT]Bally; 18/09/2011 at 12:46 PM. Reason: wrong answer |
|
|
|
|
|
#3 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: May 2010
Posts: 756
Reputation: 25
|
no he doesnt need ****** and its possible to script
|
|
|
|
|
|
#4 |
|
Banned
![]() Join Date: Apr 2009
Location: Sofia, Bulgaria
Posts: 2,409
Reputation: 106
|
No, he doesn't need any hack to have the speedometer - it is a script, search around and you will find it.
|
|
|
|
|
|
#5 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Aug 2011
Posts: 590
Reputation: 2
|
use search there is lots of them
http://forum.sa-mp.com/showthread.php?t=128157 <<-- there is one i found Last edited by [LHT]Bally; 18/09/2011 at 12:47 PM. Reason: wrong answer |
|
|
|
|
|
#6 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2011
Posts: 348
Reputation: 0
|
Thanks.
My final code is this : Code:
#include <a_samp>
#include <colors>
enum td
{
Text:TDSpeedClock[13]
}
new TextDraws[td];
new Text:TextDrawsd[MAX_PLAYERS];
public OnFilterScriptInit()
{
TextDraws[TDSpeedClock][0] = TextDrawCreate(496.000000,400.000000,"~g~20");
TextDraws[TDSpeedClock][1] = TextDrawCreate(487.000000,388.000000,"~g~40");
TextDraws[TDSpeedClock][2] = TextDrawCreate(483.000000,375.000000,"~g~60");
TextDraws[TDSpeedClock][3] = TextDrawCreate(488.000000,362.000000,"~g~80");
TextDraws[TDSpeedClock][4] = TextDrawCreate(491.000000,349.000000,"~g~100");
TextDraws[TDSpeedClock][5] = TextDrawCreate(508.000000,336.500000,"~y~120");
TextDraws[TDSpeedClock][6] = TextDrawCreate(536.000000,332.000000,"~y~140");
TextDraws[TDSpeedClock][7] = TextDrawCreate(567.000000,337.000000,"~y~160");
TextDraws[TDSpeedClock][8] = TextDrawCreate(584.000000,348.000000,"~r~180");
TextDraws[TDSpeedClock][9] = TextDrawCreate(595.000000,360.000000,"~r~200");
TextDraws[TDSpeedClock][10] = TextDrawCreate(603.000000,374.000000,"~r~220");
TextDraws[TDSpeedClock][11] = TextDrawCreate(594.000000,386.000000,"~r~240");
TextDraws[TDSpeedClock][12] = TextDrawCreate(585.000000,399.000000,"~r~260");
for(new i = 0; i < 13; i++)
TextDrawSetShadow(TextDraws[TDSpeedClock][i], 1);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i; i < 13; i++)
TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);
TextDrawsd[playerid] = TextDrawCreate(555.0, 402.0, "~b~.");
}
else
{
TextDrawHideForPlayer(playerid, TextDrawsd[playerid]);
for(new i; i < 13; i++)
TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
new
Float:fPos[3],
Float:Pos[2],
Float:fSpeed;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +
floatpower(fPos[2], 2)) * 100;
new Float:alpha = 640 - fSpeed;
TextDrawHideForPlayer(playerid, TextDrawsd[playerid]);
TextDrawDestroy(TextDrawsd[playerid]);
GetDotXY(548, 401, Pos[0], Pos[1], alpha, 32);
TextDrawsd[playerid] = TextDrawCreate(Pos[0], Pos[1], "~w~.");
TextDrawLetterSize(TextDrawsd[playerid], 0.73, -2.60);
TextDrawSetOutline(TextDrawsd[playerid], 0);
TextDrawSetShadow(TextDrawsd[playerid], 1);
TextDrawShowForPlayer(playerid, TextDrawsd[playerid]);
new string[400];
format(string, 400, "fSpeed : %f - alpha : %f - Pos[0] : %f - Pos[1] : %f", fSpeed, alpha, Pos[0], Pos[1]);
SendClientMessageToAll(ORANGE, string);
}
return 1;
}
stock GetDotXY(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:alpha, Float:dist)
{
NewX = StartPosX + (dist * floatsin(alpha, degrees));
NewY = StartPosY + (dist * floatcos(alpha, degrees));
}
Code:
GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]); fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) + floatpower(fPos[2], 2)) * 100; new Float:alpha = 640 - fSpeed; TextDrawHideForPlayer(playerid, TextDrawsd[playerid]); TextDrawDestroy(TextDrawsd[playerid]); GetDotXY(548, 401, Pos[0], Pos[1], alpha, 32); Code:
stock GetDotXY(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:alpha, Float:dist)
{
NewX = StartPosX + (dist * floatsin(alpha, degrees));
NewY = StartPosY + (dist * floatcos(alpha, degrees));
}
Except that if such because, I remain at 50km / h, the speed is really slow ... So I try to reduce some of the counter. If I chance '* 200' to '* 100', the counter is not going further than 140/160 km / h. If I spend 320 to 640, the meter starts at 40 ... In short, I do not know how to get a more realistic speed: / Thank you in advance! |
|
|
|
|
|
#7 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2011
Posts: 348
Reputation: 0
|
Up !
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [HELP] My speedometer | Yuval_Baruch | Scripting Help | 2 | 15/12/2011 10:51 AM |
| speedometer? | swieberdevos | Help Archive | 5 | 31/03/2011 12:55 PM |
| Speedometer..... | Gh0sT_ | Help Archive | 8 | 14/11/2010 09:32 PM |
| SpeedoMeter Help | Proteine | Help Archive | 7 | 15/10/2010 03:38 PM |
| Speedometer and Name car | icebox10 | Help Archive | 0 | 30/07/2009 02:05 PM |