Jump to content

[REZOLVAT] Intrebare Checkvehinfo


TwEnZyAdv
 Share

Recommended Posts

  • Administrator

Poftim.

 

Ti-am si optimizat o.

function Checkvehinfo(playerid) 
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) 
	{
		if(InRaceArena[playerid] == 1 && !RaceStarted) return true;

		new engine, lights, alarm, doors, bonnet, boot, objective, string[256];
		GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);

		if(CarInfo[FindSpawnID(GetPlayerVehicleID(playerid))][cID] != -2 && FindSpawnID(GetPlayerVehicleID(playerid)) != 0 && !IsAPlane(GetPlayerVehicleID(playerid))) 
		{
			if(!IsABike(GetPlayerVehicleID(playerid)) && !IsAPlane(GetPlayerVehicleID(playerid))) 
			{
				format(string, sizeof string, "~%s~%d", (Carspeed(playerid) < 99) ? ("g") : ("r"), Carspeed(playerid));
				PlayerTextDrawSetString(playerid, Speedo[playerid][0], string)

				format(string, sizeof string, "Fuel: ~%s~%d~n~~w~~h~%s~n~Odometer: %0.2f", (Gas[GetPlayerVehicleID(playerid)] > 20) ? ("g") : ("r"), Gas[GetPlayerVehicleID(playerid)], (doors == 1) ? ("Doors: ~r~Locked~w~~h~") : ("Doors: ~g~Unlocked~w~~h~"), CarInfo[FindSpawnID(GetPlayerVehicleID(playerid))][KM]);
				PlayerTextDrawSetString(playerid, Speedo[playerid][2], string);
			}
		} 

		else 
		{
			if(!IsABike(GetPlayerVehicleID(playerid)) && !IsAPlane(GetPlayerVehicleID(playerid))) 
			{
				format(string, sizeof string, "~%s~%d", (Carspeed(playerid) < 99) ? ("g") : ("r"), Carspeed(playerid));
				PlayerTextDrawSetString(playerid, Speedo[playerid][0], string);

				format(string, sizeof string, "Fuel: ~%s~%d", (Gas[GetPlayerVehicleID(playerid)] > 20) ? ("g") : ("r"), Gas[GetPlayerVehicleID(playerid)]);
				PlayerTextDrawSetString(playerid, Speedo[playerid][2], string);
			}
		} 

		for(new i = 0; i < 3; i++)
		{
			PlayerTextDrawShow(playerid, Speedo[playerid][i]);
		}
	}

	return 1;
}
Link to comment
Share on other sites

  • Administrator

Poftim textdraw-ul in ordine:

Speedo[playerid][0] = CreatePlayerTextDraw(playerid, 510.333801, 342.652039, "~g~69");
PlayerTextDrawLetterSize(playerid, Speedo[playerid][0], 0.628332, 2.603848);
PlayerTextDrawTextSize(playerid, Speedo[playerid][0], 1280.000000, 1280.000000);
PlayerTextDrawAlignment(playerid, Speedo[playerid][0], 1);
PlayerTextDrawColor(playerid, Speedo[playerid][0], 0xFFFFFFFF);
PlayerTextDrawUseBox(playerid, Speedo[playerid][0], 0);
PlayerTextDrawBoxColor(playerid, Speedo[playerid][0], 0x80808080);
PlayerTextDrawSetOutline(playerid, Speedo[playerid][0], 1);
PlayerTextDrawBackgroundColor(playerid, Speedo[playerid][0], 0x00000083);
PlayerTextDrawFont(playerid, Speedo[playerid][0], 3);
PlayerTextDrawSetProportional(playerid, Speedo[playerid][0], 1);
PlayerTextDrawSetSelectable(playerid, Speedo[playerid][0], 0);

Speedo[playerid][1] = CreatePlayerTextDraw(playerid, 548.567993, 356.011230, "  KM/H");
PlayerTextDrawLetterSize(playerid, Speedo[playerid][1], 0.196666, 1.039999);
PlayerTextDrawTextSize(playerid, Speedo[playerid][1], 1280.000000, 1280.000000);
PlayerTextDrawAlignment(playerid, Speedo[playerid][1], 1);
PlayerTextDrawColor(playerid, Speedo[playerid][1], 0xFFFFFFFF);
PlayerTextDrawUseBox(playerid, Speedo[playerid][1], 0);
PlayerTextDrawBoxColor(playerid, Speedo[playerid][1], 0x80808080);
PlayerTextDrawSetShadow(playerid, Speedo[playerid][1], 1);
PlayerTextDrawSetOutline(playerid, Speedo[playerid][1], 1);
PlayerTextDrawBackgroundColor(playerid, Speedo[playerid][0], 0x00000067);
PlayerTextDrawFont(playerid, Speedo[playerid][1], 2);
PlayerTextDrawSetProportional(playerid, Speedo[playerid][1], 1);
PlayerTextDrawSetSelectable(playerid, Speedo[playerid][1], 0);

Speedo[playerid][2] = CreatePlayerTextDraw(playerid, 510.667145, 364.596436, "Fuel: ~r~100~w~~h~ (C: 2L)~n~Doors: ~g~Unlocked~w~~h~~n~Odometer: 69.69");
PlayerTextDrawLetterSize(playerid, Speedo[playerid][2], 0.218666, 1.185184);
PlayerTextDrawTextSize(playerid, Speedo[playerid][2], 1280.000000, 1280.000000);
PlayerTextDrawAlignment(playerid, Speedo[playerid][2], 1);
PlayerTextDrawColor(playerid, Speedo[playerid][2], 0xFFFFFFFF);
PlayerTextDrawUseBox(playerid, Speedo[playerid][2], 0);
PlayerTextDrawBoxColor(playerid, Speedo[playerid][2], 0x80808080);
PlayerTextDrawSetShadow(playerid, Speedo[playerid][2], 1);
PlayerTextDrawSetOutline(playerid, Speedo[playerid][2], 1);
PlayerTextDrawBackgroundColor(playerid, Speedo[playerid][2], 0x00000067);
PlayerTextDrawFont(playerid, Speedo[playerid][2], 2);
PlayerTextDrawSetProportional(playerid, Speedo[playerid][2], 1);
PlayerTextDrawSetSelectable(playerid, Speedo[playerid][2], 0);
Link to comment
Share on other sites

  • Administrator

La

PlayerTextDrawSetString(playerid, Speedo[playerid][0], string)

Pune un ;

 

-> 

PlayerTextDrawSetString(playerid, Speedo[playerid][0], string);

Ai definit variabila pe care ti-am zis o la inceputul gamemode-ului?

new Speedo[MAX_PLAYERS][3];
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...