Advertisement
Guest User

Untitled

a guest
Jan 17th, 2013
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.23 KB | None | 0 0
  1. //anybox 2013
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. #define FILTERSCRIPT
  7.  
  8. #undef MAX_PLAYERS
  9. #define MAX_PLAYERS 30
  10.  
  11. #define EXPLOSION_COUNT 12
  12. #define ACTION_SPEED 4
  13. #define HALF_ACTION_SPEED 2
  14. #define CAMERA_TIME 3000
  15.  
  16. new smActive[MAX_PLAYERS];
  17.  
  18. CMD:sman(playerid, params[])
  19. {
  20.     if (!IsPlayerAdmin(playerid)) return 1;
  21.     TogglePlayerControllable(playerid, 0);
  22.     new Float: x, Float: y, Float: z, Float: a;
  23.     GetPlayerPos(playerid,x,y,z);
  24.     GetPlayerFacingAngle(playerid,a);
  25.     a = a+90.0;
  26.     InterpolateCameraPos(playerid,x,y,z,x-floatcos(a, degrees)*10,
  27.     y-floatsin(a, degrees) * 10, z+2.0, CAMERA_TIME, CAMERA_MOVE);
  28.     InterpolateCameraLookAt(playerid,x,y,z,x,y,z,1000,CAMERA_CUT);
  29.     smActive[playerid] = ACTION_SPEED;
  30.     return 1;
  31. }
  32.  
  33.  
  34. forward checkSuperMan();
  35. public checkSuperMan()
  36. {
  37.     static Float: x, Float: y, Float: z, Float: a;
  38.     for (new i = 0; i < MAX_PLAYERS; i++) {
  39.         if (!IsPlayerConnected(i) || !smActive[i]) continue;
  40.  
  41.         if (smActive[i] == HALF_ACTION_SPEED || smActive[i] == 1) {
  42.             GetPlayerPos(i,x,y,z);
  43.             GetPlayerFacingAngle(i,a);
  44.         }
  45.        
  46.         if (smActive[i] == HALF_ACTION_SPEED) {
  47.             a = a+90.0;
  48.             InterpolateCameraPos(i,x-floatcos(a, degrees)*10,
  49.             y-floatsin(a, degrees) * 10, z+2.0, x, y, z+1, 1400, CAMERA_MOVE);
  50.            
  51.             InterpolateCameraLookAt(i,x,y,z,x,y,z,1000,CAMERA_CUT);
  52.         } else if (smActive[i] == 1) {
  53.             new Float: angle;
  54.             for (new j = 0; j < EXPLOSION_COUNT; j++) {
  55.                 angle = a+j*360/EXPLOSION_COUNT;
  56.                 CreateExplosion(x+floatcos(angle, degrees)*20, y+floatsin(angle, degrees)*20, z+0.3, 10, 20);
  57.             }
  58.             TogglePlayerControllable(i, 1);
  59.             SetCameraBehindPlayer(i);
  60.         }
  61.        
  62.         smActive[i]--;
  63.     }
  64. }
  65.  
  66. public OnFilterScriptInit()
  67. {
  68.     print("\n--------------------------------------");
  69.     print("\n--------------------------------------");
  70.     print("Power Man 1.0 by anybox");
  71.     print("--------------------------------------\n");
  72.     print("--------------------------------------\n");
  73.    
  74.     SetTimer("checkSuperMan", 1000, true);
  75.     return 1;
  76. }
  77.  
  78. public OnFilterScriptExit()
  79. {
  80.     return 1;
  81. }
  82.  
  83. public OnPlayerConnect(playerid)
  84. {
  85.     smActive[playerid] = 0;
  86.     return 1;
  87. }
  88.  
  89. public OnPlayerDisconnect(playerid, reason)
  90. {
  91.     return 1;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement