29.09.2011, 11:53
can you help me i wont to changethe textdraw
this is the code of the textdraw which i wont to change
this all to make it with this textdraw
this is the code of the textdraw which i wont to change
PHP код:
public Speedometer()
{
new vehicleid, Float:health;
new engine, lights, alarm, doors, bonnet, boot, objective;
new fstring[32], string[512];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
vehicleid = GetPlayerVehicleID(i);
GetVehicleHealth(vehicleid, health);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
string = "~b~~h~vehicle: ~w~";
strcat(string, VehicleNames[GetVehicleModel(vehicleid)-400], sizeof(string));
strcat(string, "~n~~b~~h~gps: ~w~", sizeof(string));
strcat(string, GetPlayer3DZone(i), sizeof(string));
strcat(string, "~n~~b~~h~health: ~g~", sizeof(string));
fstring = "iiiiiiiiii";
if(health > 1000.0) strins(fstring, "~r~", 10, sizeof(fstring));
else if(health < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
else strins(fstring, "~r~", floatround(health/100.0), sizeof(fstring));
strcat(string, fstring, sizeof(string));
strcat(string, " ~b~~h~fuel: ~g~", sizeof(string));
fstring = "iiiiiiiiii";
if(Fuel[vehicleid] > 100.0) strins(fstring, "~r~", 10, sizeof(fstring));
else if(Fuel[vehicleid] < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
else strins(fstring, "~r~", floatround(Fuel[vehicleid]/10.0), sizeof(fstring));
strcat(string, fstring, sizeof(string));
strcat(string, " ~b~~h~", sizeof(string));
if(GetPVarInt(i, "Speedo")) format(fstring,sizeof(fstring),"mph: ~w~%d", GetPlayerSpeed(i, false));
else format(fstring,sizeof(fstring),"kph: ~w~%d", GetPlayerSpeed(i, true));
strcat(string, fstring, sizeof(string));
strcat(string, "~n~~b~~h~engine: ", sizeof(string));
if(engine == 1) strcat(string, "~g~on", sizeof(string));
else strcat(string, "~r~off", sizeof(string));
strcat(string, " ~b~~h~alarm: ", sizeof(string));
if(VehicleSecurity[vehicleid] == 1) strcat(string, "~g~on", sizeof(string));
else strcat(string, "~r~off", sizeof(string));
strcat(string, " ~b~~h~doors: ", sizeof(string));
if(doors == 1) strcat(string, "~r~locked", sizeof(string));
else strcat(string, "~g~unlocked", sizeof(string));
TextDrawSetString(SpeedoText[i], string);
}
}
}
PHP код:
public OnFilterScriptInit()
{
print("\n------------------------------------------------");
print(" Vehicle System");
print("------------------------------------------------");
SpeedoBox = TextDrawCreate(345.000, 363.000, "~n~~n~~n~~n~");
TextDrawAlignment(SpeedoBox, 2);
TextDrawLetterSize(SpeedoBox, 0.500, 1.400);
TextDrawUseBox(SpeedoBox, 1);
TextDrawBoxColor(SpeedoBox, 153);
TextDrawTextSize(SpeedoBox, 0.000, 340.000);
PHP код:
public OnPlayerConnect(playerid)
{
SpeedoText[playerid] = TextDrawCreate(180.000, 362.000," ");
TextDrawAlignment(SpeedoText[playerid], 1);
TextDrawFont(SpeedoText[playerid],2);
TextDrawLetterSize(SpeedoText[playerid], 0.310, 1.400);
TextDrawSetShadow(SpeedoText[playerid],0);
return 1;
}
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(SpeedoText[playerid]);
return 1;
}
Код HTML:
<<<@!5!@>>>