Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. new PlayerText:HudTextDraw[MAX_PLAYERS];
  2.  
  3. HudTextDraw[playerid] = CreatePlayerTextDraw(playerid, 546.250000, 109.666664, "~b~Radio info~n~chan: ~g~0~n~~b~slot: ~g~1");
  4. PlayerTextDrawLetterSize(playerid, HudTextDraw[playerid], 0.474374, 1.197499);
  5. PlayerTextDrawAlignment(playerid, HudTextDraw[playerid], 2);
  6. PlayerTextDrawColor(playerid, HudTextDraw[playerid], -1);
  7. PlayerTextDrawSetShadow(playerid, HudTextDraw[playerid], 2);
  8. PlayerTextDrawSetOutline(playerid, HudTextDraw[playerid], 0);
  9. PlayerTextDrawBackgroundColor(playerid, HudTextDraw[playerid], 255);
  10. PlayerTextDrawFont(playerid, HudTextDraw[playerid], 3);
  11. PlayerTextDrawSetProportional(playerid, HudTextDraw[playerid], 1);
  12. PlayerTextDrawSetSelectable(playerid, HudTextDraw[playerid], true);
  13.  
  14. IsABike(vehicleid)
  15. {
  16. new model = GetVehicleModel(vehicleid);
  17.  
  18. switch(model)
  19. {
  20. case 509, 481, 510: return 1;
  21. }
  22.  
  23. return 0;
  24. }
  25.  
  26. TextHud_Update(playerid)
  27. {
  28. if(!PlayerInfo[playerid][pHud]) return 1;
  29.  
  30. PlayerTextDrawShow(playerid, HudTextDraw[playerid]);
  31.  
  32. new slot = PlayerInfo[playerid][pRadioDefault], channel, string[300];
  33. new vehicleid = GetPlayerVehicleID(playerid);
  34. new speed = GetVehicleSpeed(vehicleid), fuel = VehicleInfo[vehicleid][vFuel];
  35.  
  36. if(slot == -1 || !slot)
  37. {
  38. slot = 1;
  39. channel = 0;
  40. }
  41. else channel = PlayerInfo[playerid][pRadioSlot][slot - 1];
  42.  
  43. if(!IsPlayerInAnyVehicle(playerid))
  44. {
  45. if(channel > 99999)
  46. {
  47. format(string, sizeof(string), "~b~Radio info~n~chan: ~g~~n~%d~n~~b~slot: ~g~%d", channel, slot);
  48. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  49. }
  50. else
  51. {
  52. format(string, sizeof(string), "~b~Radio info~n~chan: ~g~%d~n~~b~slot: ~g~%d", channel, slot);
  53. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  54. }
  55. }
  56. else
  57. {
  58. if(!IsABike(vehicleid))
  59. {
  60. if(channel > 99999)
  61. {
  62. format(string, sizeof(string), "~b~Km/h: ~g~%d~n~~b~Fuel: ~g~%d~n~ ~n~~b~Radio info~n~chan: ~g~~n~%d~n~~b~slot: ~g~%d", speed, fuel, channel, slot);
  63. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  64. }
  65. else
  66. {
  67. format(string, sizeof(string), "~b~Km/h: ~g~%d~n~~b~Fuel: ~g~%d~n~ ~n~~b~Radio info~n~chan: ~g~%d~n~~b~slot: ~g~%d", speed, fuel, channel, slot);
  68. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  69. }
  70. }
  71. else
  72. {
  73. if(channel > 99999)
  74. {
  75. format(string, sizeof(string), "~b~Km/h: ~g~%d~n~~b~Fuel: ~g~--~n~ ~n~~b~Radio info~n~chan: ~g~~n~%d~n~~b~slot: ~g~%d", speed, channel, slot);
  76. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  77. }
  78. else
  79. {
  80. format(string, sizeof(string), "~b~Km/h: ~g~%d~n~~b~Fuel: ~g~--~n~ ~n~~b~Radio info~n~chan: ~g~%d~n~~b~slot: ~g~%d", speed, channel, slot);
  81. PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
  82. }
  83. }
  84. }
  85. return 1;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement