Advertisement
Nyft_

Base de Celular em Textdraw ~Nyft

Jul 5th, 2021 (edited)
1,081
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 13.90 KB | None | 0 0
  1. #include a_samp
  2. #include pawn.cmd
  3.  
  4. #define function%0(%1) \
  5.     forward%0(%1); public%0(%1)
  6.  
  7. static PhoneHudTimer[MAX_PLAYERS];
  8. static PlayerText:PhoneTextDraw[MAX_PLAYERS][16];
  9. static const PhoneMonthNames[] = {"JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"};
  10.  
  11. main(){}
  12.  
  13. public OnPlayerConnect(playerid)
  14. {
  15.     PhoneTextDraw[playerid][0] = CreatePlayerTextDraw(playerid, 273.874969, 253.582992, "_");
  16.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][0], 0.000000, 16.000000);
  17.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][0], 361.500000, 0.000000);
  18.     PlayerTextDrawUseBox(playerid, PhoneTextDraw[playerid][0], 1);
  19.     PlayerTextDrawBoxColor(playerid, PhoneTextDraw[playerid][0], 421075455);
  20.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][0], 0);
  21.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][0], 1);
  22.  
  23.     PhoneTextDraw[playerid][1] = CreatePlayerTextDraw(playerid, 273.750000, 253.583465, "LD_DUAL:backgnd");
  24.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][1], 0.000000, 0.000000);
  25.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][1], 88.500000, 144.000000);
  26.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][1], 1);
  27.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][1], -16776961);
  28.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][1], 0);
  29.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][1], 0);
  30.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][1], 255);
  31.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][1], 4);
  32.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][1], 0);
  33.  
  34.     PhoneTextDraw[playerid][2] = CreatePlayerTextDraw(playerid, 310.000000, 375.000000, "LD_POOL:ball");
  35.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][2], 0.000000, 0.000000);
  36.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][2], 15.000000, 15.000000);
  37.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][2], 1);
  38.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][2], -1);
  39.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][2], 0);
  40.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][2], 0);
  41.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][2], 255);
  42.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][2], 4);
  43.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][2], 0);
  44.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][2], true);
  45.  
  46.     PhoneTextDraw[playerid][3] = CreatePlayerTextDraw(playerid, 318.000000, 264.000000, "00:00~n~0 JAN");
  47.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][3], 0.300000, 1.750000);
  48.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][3], 2);
  49.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][3], -1);
  50.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][3], 1);
  51.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][3], 0);
  52.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][3], 255);
  53.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][3], 2);
  54.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][3], 1);
  55.  
  56.     PhoneTextDraw[playerid][4] = CreatePlayerTextDraw(playerid, 283.000000, 305.000000, "hud:radar_cash");
  57.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][4], 0.000000, 0.000000);
  58.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][4], 15.000000, 15.000000);
  59.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][4], 1);
  60.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][4], -1);
  61.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][4], 0);
  62.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][4], 0);
  63.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][4], 255);
  64.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][4], 4);
  65.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][4], 0);
  66.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][4], true);
  67.  
  68.     PhoneTextDraw[playerid][5] = CreatePlayerTextDraw(playerid, 279.649291, 320.633209, "Banco");
  69.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][5], 0.251248, 1.226665);
  70.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][5], 1);
  71.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][5], -1);
  72.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][5], 1);
  73.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][5], 0);
  74.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][5], 255);
  75.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][5], 1);
  76.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][5], 1);
  77.  
  78.     PhoneTextDraw[playerid][6] = CreatePlayerTextDraw(playerid, 312.000000, 305.000000, "hud:radar_waypoint");
  79.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][6], 0.000000, 0.000000);
  80.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][6], 15.000000, 15.000000);
  81.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][6], 1);
  82.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][6], -1);
  83.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][6], 0);
  84.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][6], 0);
  85.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][6], 255);
  86.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][6], 4);
  87.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][6], 0);
  88.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][6], true);
  89.  
  90.     PhoneTextDraw[playerid][7] = CreatePlayerTextDraw(playerid, 312.000000, 320.000000, "GPS");
  91.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][7], 0.251248, 1.226665);
  92.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][7], 1);
  93.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][7], -1);
  94.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][7], 1);
  95.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][7], 0);
  96.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][7], 255);
  97.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][7], 1);
  98.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][7], 1);
  99.  
  100.     PhoneTextDraw[playerid][8] = CreatePlayerTextDraw(playerid, 339.000000, 306.000000, "LD_CHAT:goodcha");
  101.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][8], 0.000000, 0.000000);
  102.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][8], 15.000000, 15.000000);
  103.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][8], 1);
  104.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][8], -65281);
  105.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][8], 0);
  106.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][8], 0);
  107.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][8], 255);
  108.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][8], 4);
  109.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][8], 0);
  110.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][8], true);
  111.  
  112.     PhoneTextDraw[playerid][9] = CreatePlayerTextDraw(playerid, 337.000000, 320.000000, "SMS");
  113.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][9], 0.251248, 1.226665);
  114.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][9], 1);
  115.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][9], -1);
  116.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][9], 1);
  117.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][9], 0);
  118.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][9], 255);
  119.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][9], 1);
  120.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][9], 1);
  121.  
  122.     PhoneTextDraw[playerid][10] = CreatePlayerTextDraw(playerid, 283.000000, 340.500000, "LD_CHAT:thumbdn");
  123.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][10], 0.000000, 0.000000);
  124.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][10], 15.000000, 15.000000);
  125.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][10], 1);
  126.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][10], 16711935);
  127.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][10], 0);
  128.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][10], 0);
  129.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][10], 255);
  130.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][10], 4);
  131.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][10], 0);
  132.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][10], true);
  133.  
  134.     PhoneTextDraw[playerid][11] = CreatePlayerTextDraw(playerid, 282.000000, 357.500000, "OLX");
  135.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][11], 0.251248, 1.226665);
  136.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][11], 1);
  137.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][11], -1);
  138.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][11], 1);
  139.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][11], 0);
  140.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][11], 255);
  141.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][11], 1);
  142.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][11], 1);
  143.  
  144.     PhoneTextDraw[playerid][12] = CreatePlayerTextDraw(playerid, 311.500000, 339.500000, "hud:radar_police");
  145.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][12], 0.000000, 0.000000);
  146.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][12], 15.000000, 15.000000);
  147.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][12], 1);
  148.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][12], -1);
  149.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][12], 0);
  150.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][12], 0);
  151.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][12], 255);
  152.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][12], 4);
  153.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][12], 0);
  154.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][12], true);
  155.  
  156.     PhoneTextDraw[playerid][13] = CreatePlayerTextDraw(playerid, 305.500000, 357.500000, "Policia");
  157.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][13], 0.251248, 1.226665);
  158.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][13], 1);
  159.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][13], -1);
  160.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][13], 1);
  161.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][13], 0);
  162.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][13], 255);
  163.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][13], 1);
  164.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][13], 1);
  165.  
  166.     PhoneTextDraw[playerid][14] = CreatePlayerTextDraw(playerid, 340.000000, 340.000000, "hud:radar_hostpital");
  167.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][14], 0.000000, 0.000000);
  168.     PlayerTextDrawTextSize(playerid, PhoneTextDraw[playerid][14], 15.000000, 15.000000);
  169.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][14], 1);
  170.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][14], -1);
  171.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][14], 0);
  172.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][14], 0);
  173.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][14], 255);
  174.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][14], 4);
  175.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][14], 0);
  176.     PlayerTextDrawSetSelectable(playerid, PhoneTextDraw[playerid][14], true);
  177.  
  178.     PhoneTextDraw[playerid][15] = CreatePlayerTextDraw(playerid, 336.000000, 357.000000, "SAMU");
  179.     PlayerTextDrawLetterSize(playerid, PhoneTextDraw[playerid][15], 0.251248, 1.226665);
  180.     PlayerTextDrawAlignment(playerid, PhoneTextDraw[playerid][15], 1);
  181.     PlayerTextDrawColor(playerid, PhoneTextDraw[playerid][15], -1);
  182.     PlayerTextDrawSetShadow(playerid, PhoneTextDraw[playerid][15], 1);
  183.     PlayerTextDrawSetOutline(playerid, PhoneTextDraw[playerid][15], 0);
  184.     PlayerTextDrawBackgroundColor(playerid, PhoneTextDraw[playerid][15], 255);
  185.     PlayerTextDrawFont(playerid, PhoneTextDraw[playerid][15], 1);
  186.     PlayerTextDrawSetProportional(playerid, PhoneTextDraw[playerid][15], 1);
  187.     return 1;
  188. }
  189.  
  190. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  191. {
  192.     if(playertextid == PhoneTextDraw[playerid][2])
  193.         HidePhoneTextDraw(playerid), KillTimer(PhoneHudTimer[playerid]), CancelSelectTextDraw(playerid);
  194.  
  195.     if(playertextid == PhoneTextDraw[playerid][4])
  196.         SendClientMessage(playerid, -1, "* Banco");
  197.  
  198.     if(playertextid == PhoneTextDraw[playerid][6])
  199.         SendClientMessage(playerid, -1, "* GPS");
  200.  
  201.     if(playertextid == PhoneTextDraw[playerid][8])
  202.         SendClientMessage(playerid, -1, "* SMS");
  203.  
  204.     if(playertextid == PhoneTextDraw[playerid][10])
  205.         SendClientMessage(playerid, -1, "* OLX");
  206.  
  207.     if(playertextid == PhoneTextDraw[playerid][12])
  208.         SendClientMessage(playerid, -1, "* Policia");
  209.  
  210.     if(playertextid == PhoneTextDraw[playerid][14])
  211.         SendClientMessage(playerid, -1, "* SAMU");
  212.  
  213.     return 1;
  214. }
  215.  
  216. function OnPhoneHudUpdate(playerid)
  217.     return PlayerTextDrawSetString(playerid, PhoneTextDraw[playerid][3], GetPhoneHudFormatted(playerid));
  218.  
  219. GetPhoneHudFormatted(playerid)
  220. {
  221.     new string[16], hour[3], date[3];
  222.     gettime(hour[0], hour[1], hour[2]), getdate(date[2], date[1], date[0]);
  223.     format(string, sizeof(string), "%02d:%02d~n~%d %s", hour[0], hour[1], date[0], PhoneMonthNames[date[1] - 1]);
  224.     PlayerTextDrawSetString(playerid, PhoneTextDraw[playerid][3], string);
  225.     return string;
  226. }
  227.  
  228. ShowPhoneTextDraw(playerid)
  229.     for(new i; i < sizeof(PhoneTextDraw[]); i++)
  230.         PlayerTextDrawShow(playerid, PhoneTextDraw[playerid][i]);
  231.  
  232. HidePhoneTextDraw(playerid)
  233.     for(new i; i < sizeof(PhoneTextDraw[]); i++)
  234.         PlayerTextDrawHide(playerid, PhoneTextDraw[playerid][i]);
  235.  
  236. CMD:celular(playerid)
  237. {
  238.     ShowPhoneTextDraw(playerid);
  239.     SelectTextDraw(playerid, 0xFFFFFFAA);
  240.     PhoneHudTimer[playerid] = SetTimerEx("OnPhoneHudUpdate", 1000, true, "i", playerid);
  241.     PlayerTextDrawSetString(playerid, PhoneTextDraw[playerid][3], GetPhoneHudFormatted(playerid));
  242.     return 1;
  243. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement