Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text:R[MAX_PLAYERS];
- new Text:S[MAX_PLAYERS];
- new Text:S2[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- #endif
- forward SPED(playerid);
- public SPED(playerid)
- {
- new car, Float:x, Float:y, Float:z, Float:speed, str[256], init;
- car = GetPlayerVehicleID(playerid);
- if(car != 0)
- {
- GetVehicleVelocity(car, x, y, z);
- speed = floatsqroot(((x*x)+(y*y))+(z*z))*175.4445;
- init = floatround(speed, floatround_round);
- format(str, 256, "KM/H: %i", init);
- TextDrawSetString(S[playerid], str);
- }
- else
- {
- TextDrawSetString(S[playerid], " ");
- }
- return 1;
- }
- forward SPED2(playerid);
- public SPED2(playerid)
- {
- new car, Float:x, Float:y, Float:z, Float:speed, str[256], init;
- car = GetPlayerVehicleID(playerid);
- if(car != 0)
- {
- GetVehicleVelocity(car, x, y, z);
- speed = floatsqroot(((x*x))+((y*y))+(z*z))*96.77745;
- init = floatround(speed, floatround_round);
- format(str, 256, "MP/H: %i", init);
- TextDrawSetString(S2[playerid], str);
- }
- else
- {
- TextDrawSetString(S2[playerid], " ");
- }
- return 1;
- }
- forward RP(playerid);
- public RP(playerid)
- {
- new car, Float:x, Float:y, Float:z, Float:speed, str[256], init;
- car = GetPlayerVehicleID(playerid);
- if(car != 0)
- {
- GetVehicleVelocity(car, x, y, z);
- speed = floatsqroot((x*x)+((y*y))+(z*z))*4.454;
- init = floatround(speed, floatround_round);
- format(str, 256, "RMP/H: %i", init);
- TextDrawSetString(R[playerid], str);
- }
- else
- {
- TextDrawSetString(R[playerid], " ");
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- SetTimer("SPED", 5, true);
- SetTimer("SPED2", 5, true);
- SetTimer("RP", 5, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- S[playerid] = TextDrawCreate(250.0, 405.0, " ");
- TextDrawLetterSize(S[playerid], 0.6, 0.8);
- TextDrawSetOutline(S[playerid], 1);
- TextDrawColor(S[playerid], 0x00FFFFFF);
- TextDrawShowForPlayer(playerid, S[playerid]);
- R[playerid] = TextDrawCreate(250.0, 385.0, " ");
- TextDrawLetterSize(R[playerid], 0.6, 0.8);
- TextDrawSetOutline(R[playerid], 1);
- TextDrawColor(R[playerid], 0x0080C0FF);
- TextDrawShowForPlayer(playerid, R[playerid]);
- S2[playerid] = TextDrawCreate(250.0, 425.0, " ");
- TextDrawLetterSize(S2[playerid], 0.6, 0.8);
- TextDrawColor(S2[playerid], 0xFFFF00FF);
- TextDrawSetOutline(S2[playerid], 1);
- TextDrawShowForPlayer(playerid, S2[playerid]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- TextDrawDestroy(S[playerid]);
- TextDrawDestroy(S2[playerid]);
- TextDrawDestroy(R[playerid]);
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- new playerid;
- TextDrawDestroy(S[playerid]);
- TextDrawDestroy(S2[playerid]);
- TextDrawDestroy(R[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement