/text dra OnGameModeInit....
Textdraw91 = TextDrawCreate(592.000000, 321.000000, "000");
TextDrawBackgroundColor(Textdraw91, 255);
TextDrawFont(Textdraw91, 1);
TextDrawLetterSize(Textdraw91, 0.259999, 1.799999);
TextDrawColor(Textdraw91, -16776961);
TextDrawSetOutline(Textdraw91, 0);
TextDrawSetProportional(Textdraw91, 1);
TextDrawSetShadow(Textdraw91, 1);
Textdraw101 = TextDrawCreate(593.000000, 338.000000, "000");
TextDrawBackgroundColor(Textdraw101, 255);
TextDrawFont(Textdraw101, 1);
TextDrawLetterSize(Textdraw101, 0.300000, 1.600000);
TextDrawColor(Textdraw101, -16776961);
TextDrawSetOutline(Textdraw101, 0);
TextDrawSetProportional(Textdraw101, 1);
TextDrawSetShadow(Textdraw101, 1);
Textdraw131 = TextDrawCreate(586.000000, 353.000000, "000");
TextDrawBackgroundColor(Textdraw131, 255);
TextDrawFont(Textdraw131, 1);
TextDrawLetterSize(Textdraw13, 0.300000, 1.600000);
TextDrawColor(Textdraw131, -16776961);
TextDrawSetOutline(Textdraw131, 0);
TextDrawSetProportional(Textdraw131, 1);
TextDrawSetShadow(Textdraw131, 1);
Textdraw141 = TextDrawCreate(586.000000, 369.000000, "000");
TextDrawBackgroundColor(Textdraw141, 255);
TextDrawFont(Textdraw141, 1);
TextDrawLetterSize(Textdraw141, 0.300000, 1.600000);
TextDrawColor(Textdraw141, -16776961);
TextDrawSetOutline(Textdraw141, 0);
TextDrawSetProportional(Textdraw141, 1);
TextDrawSetShadow(Textdraw141, 1);
//OnPlayerStateChange
if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid, Textdraw91);
TextDrawShowForPlayer(playerid, Textdraw101);
TextDrawShowForPlayer(playerid, Textdraw131);
TextDrawShowForPlayer(playerid, Textdraw141);
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid, Textdraw91);
TextDrawHideForPlayer(playerid, Textdraw101);
TextDrawHideForPlayer(playerid, Textdraw131);
TextDrawHideForPlayer(playerid, Textdraw141);
}
// Public para Getar a as informaзхes no velocнmetro
public Speedo()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
//CHECAR VELOCIDADE
new string[228];
format(string,sizeof(string),"%dKM/H", VelocidadeKM(playerid));
TextDrawSetString(Text:Textdraw91, string);
TextDrawShowForPlayer(playerid, Textdraw91);
//CHECAR LATARIA
GetVehicleHealth(GetPlayerVehicleID(playerid), Lataria);
format(string,sizeof(string),"Lataria: %0.0f%%", Lataria);
TextDrawSetString(Textdraw131, string);
//CHECAR VEICULO
format(string,sizeof(string),"Veiculo: %s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Textdraw141, string);
// Checar gasolina
format(string,sizeof(string),"Gasolina: %d%", Gas[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw101, string);
}
}
}
public Speedo()
{
static
playerid
;
playerid = GetMaxPlayers();
for( ; playerid > -1; --playerid){
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
//CHECAR VELOCIDADE
new string[128];
format(string,sizeof(string),"%dKM/H", VelocidadeKM(playerid));
TextDrawSetString(Text:Textdraw91, string);
TextDrawShowForPlayer(playerid, Textdraw91);
//CHECAR LATARIA
GetVehicleHealth(GetPlayerVehicleID(playerid), Lataria);
format(string,sizeof(string),"Lataria: %0.0f%%", Lataria);
TextDrawSetString(Textdraw131, string);
//CHECAR VEICULO
format(string,sizeof(string),"Veiculo: %s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Textdraw141, string);
// Checar gasolina
format(string,sizeof(string),"Gasolina: %d%", Gas[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw101, string);
}
}
}
public Speedo()
{
static
playerid
;
playerid = GetMaxPlayers();
for( ; playerid > -1; --playerid){
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
//CHECAR VELOCIDADE
new string[128];
format(string,sizeof(string),"%dKM/H", VelocidadeKM(playerid));
TextDrawSetString(Text:Textdraw91, string);
TextDrawShowForPlayer(playerid, Textdraw91);
//CHECAR LATARIA
GetVehicleHealth(GetPlayerVehicleID(playerid), Lataria);
format(string,sizeof(string),"Lataria: %0.0f%%", Lataria);
TextDrawSetString(Textdraw131, string);
TextDrawShowForPlayer(playerid, Textdraw131);
//CHECAR VEICULO
format(string,sizeof(string),"Veiculo: %s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Textdraw141, string);
TextDrawShowForPlayer(playerid, Textdraw141);
// Checar gasolina
format(string,sizeof(string),"Gasolina: %d%", Gas[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw101, string);
TextDrawShowForPlayer(playerid, Textdraw101);
}
}
public Speedo()
{
static
playerid
;
playerid = GetMaxPlayers();
for( ; playerid > -1; --playerid){
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
//CHECAR VELOCIDADE
new string[128];
format(string,sizeof(string),"%dKM/H", VelocidadeKM(playerid));
TextDrawSetString(Text:Textdraw91, string);
TextDrawShowForPlayer(playerid, Textdraw91);
//CHECAR LATARIA
GetVehicleHealth(GetPlayerVehicleID(playerid), Lataria);
format(string,sizeof(string),"Lataria: %0.0f%%", Lataria);
TextDrawSetString(Textdraw131, string);
TextDrawShowForPlayer(playerid, Textdraw131);
//CHECAR VEICULO
format(string,sizeof(string),"Veiculo: %s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Textdraw141, string);
TextDrawShowForPlayer(playerid, Textdraw141);
// Checar gasolina
format(string,sizeof(string),"Gasolina: %d%", Gas[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw101, string);
TextDrawShowForPlayer(playerid, Textdraw101);
}
}
return SetTimer("Speedo", 1000, true);
}
Speedo();
public Speedo()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
//CHECAR VELOCIDADE
new string[228];
format(string,sizeof(string),"%02d Km/H",GetVehicleSpeed(playervehicle));
TextDrawSetString(Text:Textdraw91, string);
TextDrawShowForPlayer(playerid, Textdraw91);
//CHECAR LATARIA
GetVehicleHealth(GetPlayerVehicleID(playerid), Lataria);
format(string,sizeof(string),"Lataria: %0.0f%%", Lataria);
TextDrawSetString(Textdraw131, string);
//CHECAR VEICULO
format(string,sizeof(string),"Veiculo: %s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Textdraw141, string);
// Checar gasolina
format(string,sizeof(string),"Gasolina: %d%", Gas[GetPlayerVehicleID(playerid)]);
TextDrawSetString(Textdraw101, string);
}
}
}
stock GetVehicleSpeed(vehicleid)
{
new Float:xPos[3];
GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}
|
PHP код:
|
O tуpico й de 2012 cara.