Swit_Cj

[FS] Camera ao Conectar

Jun 2nd, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.00 KB | None | 0 0
  1. /* Use e abuse retire os creditos q nao tem kkkkkk
  2. faça o que quiser flw*/
  3.  
  4.  
  5. #include <a_samp>
  6.  
  7.  
  8. enum pInfo
  9. {
  10.     bool:SpawnDance,
  11.     Float:SpawnAngle,
  12.     SpawnTimer
  13. };
  14. new PlayerInfo[MAX_PLAYERS][pInfo];
  15. new ClosedSelection[MAX_PLAYERS];
  16. new Float:cordinatex,Float:cordinatey,Float:cordinatez,Float:cordinateangle;
  17. new Float:RequestCamera[10][4] =
  18. { //PosX      PosY        PosZ    PosAngulo
  19.     {2750.9370,-2233.9905,61.7276,236.9652},
  20.     {1296.4391,1583.2622,50.2969,317.8491},
  21.     {1054.8481,1019.7778,57.3438,95.0108},  //troque esssa posiçoes para quais vc
  22.     {1452.0229,750.9430,32.6900,88.4309},   // quiser
  23.     {2213.8701,1679.2406,57.3038,91.4144},
  24.     {746.1910,740.3755,29.1076,24.4488},
  25.     {199.7275,1393.2085,47.8297,179.5663},
  26.     {596.4931,1502.9486,9.0578,29.4318},
  27.     {-207.8227,1901.1121,128.4624,68.0533},
  28.     {-2387.3440,2401.0579,20.7627,240.9129}
  29. };
  30.  
  31. forward MoveCamera(playerid,rand);
  32.  
  33. public OnFilterScriptInit()
  34. {
  35.     print("\n--------------------------------------");
  36.     print("       [FS] Camera em movimento.        ");
  37.     print("--------------------------------------\n");
  38.     return 1;
  39. }
  40.  
  41. public OnFilterScriptExit()
  42. {
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerRequestClass(playerid, classid)
  47. {
  48.     if(ClosedSelection[playerid] == 0)
  49.     {
  50.         new rand = random(sizeof(RequestCamera));
  51.         cordinatex = RequestCamera[rand][0];
  52.         cordinatey = RequestCamera[rand][1];
  53.         cordinatez = RequestCamera[rand][2];
  54.         cordinateangle = RequestCamera[rand][3];
  55.         SetPlayerPos(playerid,cordinatex,cordinatey,cordinatez);
  56.         SetPlayerFacingAngle(playerid, cordinateangle);
  57.         SetPlayerCameraPos(playerid,cordinatex+(3.8*floatsin(-cordinateangle,degrees)),cordinatey+(3.8*floatcos(-cordinateangle,degrees)),cordinatez);
  58.         SetPlayerCameraLookAt(playerid, cordinatex,cordinatey,cordinatez);
  59.         PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238);
  60.         if(PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", 50, true, "i", playerid);
  61.         PlayerInfo[playerid][SpawnDance] = false;
  62.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
  63.     }
  64.     return 1;
  65. }
  66.  
  67. public OnPlayerConnect(playerid)
  68. {
  69.     PlayerInfo[playerid][SpawnDance] = true;
  70.     SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
  71.     return 1;
  72. }
  73.  
  74.  
  75. public OnPlayerSpawn(playerid)
  76. {
  77.     ClosedSelection[playerid] = 0;
  78.     PlayerInfo[playerid][SpawnAngle] = 0.0;
  79.     PlayerInfo[playerid][SpawnDance] = true;
  80.     KillTimer(PlayerInfo[playerid][SpawnTimer]);
  81.     PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0);
  82.     SetCameraBehindPlayer(playerid);
  83.     SetPlayerSkin(playerid, 23);
  84.     return 1;
  85. }
  86.  
  87. public MoveCamera(playerid,rand)
  88. {
  89.     SetPlayerCameraPos(playerid, cordinatex - 2 * floatsin(-PlayerInfo[playerid][SpawnAngle], degrees), cordinatey - 10 * floatcos(-PlayerInfo[playerid][SpawnAngle], degrees), cordinatez + 3);
  90.     SetPlayerCameraLookAt(playerid, cordinatex, cordinatey, cordinatez + 0.5);
  91.     PlayerInfo[playerid][SpawnAngle] += 0.5;
  92.     if(PlayerInfo[playerid][SpawnAngle] >= 360.0)
  93.     PlayerInfo[playerid][SpawnAngle] = 0.0;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment