Advertisement
YoUnGZz

Selfie FilterScript

May 20th, 2014
1,225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. new takingselfie[MAX_PLAYERS];
  7.  
  8. #define COLOR_WHITE 0xFFFFFFAA
  9. #define COLOR_RED 0xFF0000AA
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. new Text:Textdraw2;
  14. new Float:x[MAX_PLAYERS],Float:y[MAX_PLAYERS],Float:z[MAX_PLAYERS],Float:a[MAX_PLAYERS];
  15. new Float:nx[MAX_PLAYERS],Float:ny[MAX_PLAYERS],Float:nz[MAX_PLAYERS];
  16. new right[MAX_PLAYERS];
  17. new left[MAX_PLAYERS];
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. print("\n--------------------------------------");
  22. print(" Selfie FilterScript By: JFF");
  23. print("--------------------------------------\n");
  24. for(new i =0; i<MAX_PLAYERS;i++)
  25. takingselfie[i] = 0;
  26. Textdraw2 = TextDrawCreate(227.000000, 10.000000, "~r~Press F8 to take a selfie.~n~~n~~y~Num 6/Num 4 to move the camera.~n~~n~~g~/selfie to stop taking selfies.");
  27. TextDrawBackgroundColor(Textdraw2, 255);
  28. TextDrawFont(Textdraw2, 1);
  29. TextDrawLetterSize(Textdraw2, 0.500000, 1.300000);
  30. TextDrawColor(Textdraw2, -16776961);
  31. TextDrawSetOutline(Textdraw2, 0);
  32. TextDrawSetProportional(Textdraw2, 1);
  33. TextDrawSetShadow(Textdraw2, 1);
  34. TextDrawSetSelectable(Textdraw2, 0);
  35. return 1;
  36. }
  37.  
  38. public OnFilterScriptExit()
  39. {
  40. for(new i =0; i<MAX_PLAYERS;i++)
  41. takingselfie[i] = 0;
  42. return 1;
  43. }
  44.  
  45. #else
  46.  
  47. main()
  48. {
  49. print("\n--------------------------------------");
  50. print(" Selfie FilterScript By: JFF");
  51. print("--------------------------------------\n");
  52. }
  53.  
  54. #endif
  55.  
  56. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  57. {
  58. if(takingselfie[playerid] == 1)
  59. {
  60. if(newkeys & KEY_ANALOG_RIGHT)
  61. {
  62. if(right[playerid] < 4)
  63. {
  64. InterpolateCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid],nx[playerid],ny[playerid] + 0.1,nz[playerid], 1000,CAMERA_MOVE);
  65. ny[playerid] = ny[playerid] + 0.1;
  66. right[playerid] ++;
  67. left[playerid] --;
  68. }
  69. }
  70. if(newkeys & KEY_ANALOG_LEFT)
  71. {
  72. if(left[playerid] < 7)
  73. {
  74. InterpolateCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid],nx[playerid],ny[playerid] - 0.1,nz[playerid], 1000,CAMERA_MOVE);
  75. ny[playerid] = ny[playerid] - 0.1;
  76. right[playerid] --;
  77. left[playerid] ++;
  78. }
  79. }
  80. }
  81. return 1;
  82. }
  83.  
  84. CMD:selfie(playerid,params[])
  85. {
  86. if(takingselfie[playerid] == 0)
  87. {
  88. TogglePlayerControllable(playerid,0);
  89. GetPlayerPos(playerid, x[playerid], y[playerid], z[playerid]);
  90. SetPlayerFacingAngle(playerid,269.9766);
  91. GetPlayerFacingAngle(playerid, a[playerid]);
  92. nx[playerid] = x[playerid]+1.4;
  93. ny[playerid] = y[playerid];
  94. nz[playerid] = z[playerid]+1;
  95. SetPlayerCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid]);
  96. SetPlayerCameraLookAt(playerid,x[playerid],y[playerid],z[playerid]+1);
  97. ApplyAnimation(playerid, "PED", "gang_gunstand", 4.1, 1, 1, 1, 1, 1, 1);
  98. TextDrawShowForPlayer(playerid,Textdraw2);
  99. takingselfie[playerid] = 1;
  100. right[playerid] = 0;
  101. left[playerid] = 0;
  102. return 1;
  103. }
  104. if(takingselfie[playerid] == 1)
  105. {
  106. TogglePlayerControllable(playerid,1);
  107. SetCameraBehindPlayer(playerid);
  108. TextDrawHideForPlayer(playerid,Textdraw2);
  109. takingselfie[playerid] = 0;
  110. ClearAnimations(playerid);
  111. return 1;
  112. }
  113. return 1;
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement