Üdv írtam egy kis sebesség mérõ scriptet gondoltam valakinek hasznos lesz.
kép:
http://www.kepfeltoltes.hu/view/130602/screen_www.kepfeltoltes.hu_.pngbocs hogy angol de nem passzolt ide a magyar szöveg.-..-
Mérõ:
- sebesség
- Élet
.
#include <a_samp>
forward SpeedoUpdate();
new Text:box[MAX_VEHICLES],Text:speed[MAX_VEHICLES],Text:health[MAX_VEHICLES];
public OnFilterScriptInit()
{
SetTimer(\"SpeedoUpdate\",100,1);
return 1;
}
public OnPlayerConnect(playerid)
{
box[playerid] = TextDrawCreate(618,389,\"_\");
TextDrawLetterSize(box[playerid],0.5,2.599999);
TextDrawUseBox(box[playerid],1);
TextDrawBoxColor(box[playerid],0x00000060);
TextDrawTextSize(box[playerid],473,0);
speed[playerid] = TextDrawCreate(478,389,\"_\");
TextDrawLetterSize(speed[playerid],0.37,1.099999);
TextDrawSetOutline(speed[playerid],1);
health[playerid] = TextDrawCreate(478,401,\"_\");
TextDrawLetterSize(health[playerid],0.37,1.099999);
TextDrawSetOutline(health[playerid],1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(box[playerid]);
TextDrawDestroy(speed[playerid]);
TextDrawDestroy(health[playerid]);
return 1;
}
public SpeedoUpdate()
{
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new Float:x,Float:y,Float:z,Float:hp,string[24],vehicleid = GetPlayerVehicleID(i);
TextDrawShowForPlayer(i,box);
TextDrawShowForPlayer(i,speed);
TextDrawShowForPlayer(i,health);
GetVehicleVelocity(vehicleid,x,y,z);
GetVehicleHealth(vehicleid,hp);
format(string,sizeof(string),\"Speed: %dkph\",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*250.666667));
TextDrawSetString(speed,string);
format(string,sizeof(string),\"Health: %d\",floatround(hp));
TextDrawSetString(health,string);
}
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i,box);
TextDrawHideForPlayer(i,speed);
TextDrawHideForPlayer(i,health);
}
}
}