#define FILTERSCRIPT
//-------------------------------------------------------
#include <a_samp>
//-------------------------------------------------------
new Text:SPEEDOS[MAX_PLAYERS];
//-------------------------------------------------------
forward Speedometer(playerid);
//-------------------------------------------------------
public OnFilterScriptInit()
{
SetTimer("Speedometer", 100, true);
return 1;
}
//-------------------------------------------------------
public OnPlayerConnect(playerid)
{
SPEEDOS[playerid] = TextDrawCreate(500.0,400.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
return 1;
}
//-------------------------------------------------------
public Speedometer(playerid)
{
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != 0)
{
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph
final_speed_int = floatround(final_speed,floatround_round);
format(speed_string,256,"%i km/h",final_speed_int);
TextDrawSetString(SPEEDOS[playerid], speed_string);
}
else
{
TextDrawSetString(SPEEDOS[playerid], " ");
}
return 1;
}
//-------------------------------------------------------
SetTimerEx("Speedometer", 100, true,"i",playerid);
C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(17) : warning 213: tag mismatch C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(18) : warning 213: tag mismatch
#define FILTERSCRIPT //------------------------------------------------------- #include <a_samp> //------------------------------------------------------- new Text:SPEEDOS[MAX_PLAYERS]; //------------------------------------------------------- forward Speedometer(playerid); //------------------------------------------------------- public OnFilterScriptInit() { SetTimer("Speedometer", 100, true); return 1; } //------------------------------------------------------- public OnPlayerConnect(playerid) { SPEEDOS[playerid] = CreatePlayerTextDraw(playerid, 500.0, 400.0, " "); PlayerTextDrawShow(playerid, SPEEDOS[playerid]); return 1; } //------------------------------------------------------- public Speedometer(playerid) { new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int; vehicleid = GetPlayerVehicleID(playerid); if(vehicleid != 0) { GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph final_speed_int = floatround(final_speed,floatround_round); format(speed_string,256,"%i km/h",final_speed_int); TextDrawSetString(SPEEDOS[playerid], speed_string); } else { TextDrawSetString(SPEEDOS[playerid], " "); } return 1; } //-------------------------------------------------------
#define FILTERSCRIPT //------------------------------------------------------- #include <a_samp> //------------------------------------------------------- new Text:SPEEDOS[MAX_PLAYERS]; //------------------------------------------------------- forward Speedometer(playerid); //------------------------------------------------------- public OnFilterScriptInit() { SetTimer("Speedometer", 100, true); return 1; } //------------------------------------------------------- public OnPlayerConnect(playerid) { SPEEDOS[playerid] = CreatePlayerTextDraw(playerid, 500.0, 400.0, " "); PlayerTextDrawShow(playerid, SPEEDOS[playerid]); return 1; } //------------------------------------------------------- public Speedometer(playerid) { new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int; vehicleid = GetPlayerVehicleID(playerid); if(vehicleid != 0) { GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*250.666667; // 250.666667 = kmph // 199,4166672= mph final_speed_int = floatround(final_speed,floatround_round); format(speed_string,256,"%i km/h",final_speed_int); PlayerTextDrawSetString(playerid, SPEEDOS[playerid], speed_string); } else { PlayerTextDrawSetString(playerid, SPEEDOS[playerid], " "); } return 1; } //-------------------------------------------------------
C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(17) : warning 213: tag mismatch C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(18) : warning 213: tag mismatch C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(32) : warning 213: tag mismatch C:\Users\Ruud\Documents\Samp\RP alles in 1\filterscripts\speedometer.pwn(36) : warning 213: tag mismatch
and https://sampwiki.blast.hk/wiki/VectorSize instead of floatsqroot
|