Advertisement
Graber

Untitled

Mar 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.28 KB | None | 0 0
  1. SetPlayerPoint_GPS_Map(index, playerid, icon[], color, Float:icon_size_X, Float:icon_size_Y, Float:x, Float:y)
  2. {
  3.     new Float:td_X, Float:td_Y;
  4.    
  5.     if(x > 3000.0) x = 3000.0;
  6.     else if(x < -3000.0) x = -3000.0;
  7.    
  8.     if(y > 3000.0) y = 3000.0;
  9.     else if(y < -3000.0) y = -3000.0;
  10.    
  11.     new
  12.         Float:converted_MAP_SIZE_X = floatdiv(map_td_SIZE_X, 2),
  13.         Float:converted_MAP_SIZE_Y = floatdiv(map_td_SIZE_Y, 2),
  14.         Float:converted_ICON_SIZE_X = floatdiv(icon_size_X, 2),
  15.         Float:converted_ICON_SIZE_Y = floatdiv(icon_size_Y, 2);
  16.        
  17.     td_X = map_td_X + floatmul(floatdiv(converted_MAP_SIZE_X, 3000), x) + converted_MAP_SIZE_X - converted_ICON_SIZE_X;
  18.     td_Y = map_td_Y + floatmul(floatdiv(-converted_MAP_SIZE_Y, 3000), y) + converted_MAP_SIZE_Y- converted_ICON_SIZE_Y;
  19.    
  20.     if(PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index] != PlayerText:INVALID_TEXT_DRAW)
  21.     {
  22.         PlayerTextDrawDestroy(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index]);
  23.         PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index] = PlayerText:INVALID_TEXT_DRAW;
  24.     }
  25.  
  26.     PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index] = CreatePlayerTextDraw(playerid, td_X, td_Y, icon);
  27.     PlayerTextDrawLetterSize(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 0.160333, 1.280592);
  28.     PlayerTextDrawTextSize(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], icon_size_X, icon_size_Y);
  29.     PlayerTextDrawAlignment(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 1);
  30.     PlayerTextDrawColor(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], color);
  31.     PlayerTextDrawSetShadow(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 0);
  32.     PlayerTextDrawSetOutline(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 0);
  33.     PlayerTextDrawBackgroundColor(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 255);
  34.     PlayerTextDrawFont(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 4);
  35.     PlayerTextDrawSetProportional(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 0);
  36.     PlayerTextDrawSetShadow(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index], 0);
  37.     PlayerTextDrawShow(playerid, PlayerTextdraws[playerid][ptextdraw_PLAYER_GPS_MAP][index]);
  38.     return 1;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement