Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new PlayerText:HudTextDraw[MAX_PLAYERS];
- HudTextDraw[playerid] = CreatePlayerTextDraw(playerid, 546.250000, 109.666664, "~b~Radio info~n~chan: ~g~0~n~~b~slot: ~g~1");
- PlayerTextDrawLetterSize(playerid, HudTextDraw[playerid], 0.474374, 1.197499);
- PlayerTextDrawAlignment(playerid, HudTextDraw[playerid], 2);
- PlayerTextDrawColor(playerid, HudTextDraw[playerid], -1);
- PlayerTextDrawSetShadow(playerid, HudTextDraw[playerid], 2);
- PlayerTextDrawSetOutline(playerid, HudTextDraw[playerid], 0);
- PlayerTextDrawBackgroundColor(playerid, HudTextDraw[playerid], 255);
- PlayerTextDrawFont(playerid, HudTextDraw[playerid], 3);
- PlayerTextDrawSetProportional(playerid, HudTextDraw[playerid], 1);
- PlayerTextDrawSetSelectable(playerid, HudTextDraw[playerid], true);
- IsABike(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- switch(model)
- {
- case 509, 481, 510: return 1;
- }
- return 0;
- }
- TextHud_Update(playerid)
- {
- if(!PlayerInfo[playerid][pHud]) return 1;
- PlayerTextDrawShow(playerid, HudTextDraw[playerid]);
- new slot = PlayerInfo[playerid][pRadioDefault], channel, string[300];
- new vehicleid = GetPlayerVehicleID(playerid);
- new speed = GetVehicleSpeed(vehicleid), fuel = VehicleInfo[vehicleid][vFuel];
- if(slot == -1 || !slot)
- {
- slot = 1;
- channel = 0;
- }
- else channel = PlayerInfo[playerid][pRadioSlot][slot - 1];
- if(!IsPlayerInAnyVehicle(playerid))
- {
- if(channel > 99999)
- {
- format(string, sizeof(string), "~b~Radio info~n~chan: ~g~~n~%d~n~~b~slot: ~g~%d", channel, slot);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- else
- {
- format(string, sizeof(string), "~b~Radio info~n~chan: ~g~%d~n~~b~slot: ~g~%d", channel, slot);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- }
- else
- {
- if(!IsABike(vehicleid))
- {
- if(channel > 99999)
- {
- 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);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- else
- {
- 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);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- }
- else
- {
- if(channel > 99999)
- {
- 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);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- else
- {
- 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);
- PlayerTextDrawSetString(playerid, HudTextDraw[playerid], string);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement