Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Car Health By UltraScripter / / / 1 / 1/1 /1 //1
- ////////////////////////////////////////////////////////////////
- #include <a_samp>
- new Text:Draw[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- #endif
- public OnFilterScriptInit()
- {
- print("\n-------------------------------------------------");
- print(" Car Health Bar By UltraScripter Loaded!!! !!! !!!");
- print("-------------------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Draw[playerid] = TextDrawCreate(181.561234634, 421.5531235567, " "); //546.0, 74.0 /// /// ///
- TextDrawAlignment(Draw[playerid], 1);
- TextDrawLetterSize(Draw[playerid], 0.75000500500, 0.9500500500);
- TextDrawFont(Draw[playerid], 1);
- TextDrawSetOutline(Draw[playerid], 1);
- TextDrawSetShadow(Draw[playerid], 1);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new Car, State, Float:Health;
- Car = GetPlayerVehicleID(playerid);
- State = GetPlayerState(playerid);
- GetVehicleHealth(Car, Health);
- if(State == PLAYER_STATE_DRIVER)
- {
- TextDrawShowForPlayer(playerid, Draw[playerid]);
- if(Health <= 1000)
- {
- TextDrawColor(Draw[playerid], 0x00FF00FF);
- TextDrawSetString(Draw[playerid], "..........");
- }
- if(Health <= 850)
- {
- TextDrawColor(Draw[playerid], 0x00FF00FF);
- TextDrawSetString(Draw[playerid], ".........");
- }
- if(Health <= 800)
- {
- TextDrawColor(Draw[playerid], 0x00FF00FF);
- TextDrawSetString(Draw[playerid], "........");
- }
- if(Health <= 750)
- {
- TextDrawColor(Draw[playerid], 0xD1C205FF);
- TextDrawSetString(Draw[playerid], ".......");
- }
- if(Health <= 700)
- {
- TextDrawColor(Draw[playerid], 0xD1C205FF);
- TextDrawSetString(Draw[playerid], "......");
- }
- if(Health <= 650)
- {
- TextDrawColor(Draw[playerid], 0xD1C205FF);
- TextDrawSetString(Draw[playerid], ".....");
- }
- if(Health <= 600)
- {
- TextDrawColor(Draw[playerid], 0xD1C205FF);
- TextDrawSetString(Draw[playerid], "....");
- }
- if(Health <= 550)
- {
- TextDrawColor(Draw[playerid], 0xFF0000FF);
- TextDrawSetString(Draw[playerid], "...");
- }
- if(Health <= 500)
- {
- TextDrawColor(Draw[playerid], 0xFF0000FF);
- TextDrawSetString(Draw[playerid], "..");
- }
- if(Health <= 450)
- {
- TextDrawColor(Draw[playerid], 0xFF0000FF);
- TextDrawSetString(Draw[playerid], ".");
- }
- if(Health <= 250)
- {
- TextDrawColor(Draw[playerid], 0xFFFF00FF);
- TextDrawSetString(Draw[playerid], "NONE!");
- }
- }
- else
- {
- TextDrawHideForPlayer(playerid, Draw[playerid]);
- }
- return 1;
- }
- //Car Health By UltraScripter / / / 1 / 1/1 /1 //1
- ////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment