Advertisement
Guest User

Untitled

a guest
May 14th, 2017
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.18 KB | None | 0 0
  1. script 7 open clientside{//Update Spectators position to the server
  2.     int ox,oy,oz;
  3.     int x,y,z;
  4.     ox = ACS_NamedExecuteWithResult("GetConsolePlayerCameraX");
  5.     oy = ACS_NamedExecuteWithResult("GetConsolePlayerCameraY");
  6.     oz = ACS_NamedExecuteWithResult("GetConsolePlayerCameraZ");
  7.     x = ox;
  8.     y = oy;
  9.     z = oz;
  10.     while(true){
  11.         x = ACS_NamedExecuteWithResult("GetConsolePlayerCameraX");
  12.         y = ACS_NamedExecuteWithResult("GetConsolePlayerCameraY");
  13.         z = ACS_NamedExecuteWithResult("GetConsolePlayerCameraZ");
  14.         if(x != ox || y != oy || z != oz){
  15.             ox = x;
  16.             oy = y;
  17.             oz = z;
  18.             RequestScriptPuke(8,consoleplayeRnumber(),x,y);
  19.             RequestScriptPuke(88,consoleplayeRnumber(),z,ACS_NamedExecuteWithResult("GetConsolePlayerCameraAngle"));
  20.             RequestScriptPuke(89,consoleplayeRnumber(),ACS_NamedExecuteWithResult("GetConsolePlayerCameraPitch"),0);
  21.         }
  22.         delay(1);
  23.     }
  24. }
  25.  
  26. script 8 (int activator,int x,int y) NET{// receive spectators position
  27.    // printbold(s:"activator 8:",d:activator, s:" X:",f:x,s:" y:",f:y);
  28.     PX[activator] = x;
  29.     PY[activator] = y;
  30. }
  31.  
  32. script 88 (int activator,int z,int angle) NET{// receive spectators position
  33.    // printbold(s:"activator 88:",d:activator,s:" Z:", f:z);
  34.     PZ[activator] = z;
  35.     PAngle[activator] = angle;
  36. }
  37.  
  38. script 89 (int activator,int pitch) NET{// receive spectators position
  39.  //   printbold(s:"activator 89:",d:activator,s:" Pitch:", f:pitch);
  40.     PPitch[activator] = pitch;
  41. }
  42.  
  43.  
  44. script 9 open{//update the spectator object coord
  45.     spawnforced("spectator_ghost",0,0,0,100,0);
  46.     spawnforced("spectator_ghost",0,0,0,101,0);
  47.     spawnforced("spectator_ghost",0,0,0,102,0);
  48.     spawnforced("spectator_ghost",0,0,0,103,0);
  49.     spawnforced("spectator_ghost",0,0,0,104,0);
  50.     while(true){
  51.         SetActorPosition(100,PX[0],PY[0],PZ[0]+10.0,false);
  52.         SetActorPosition(101,PX[1],PY[1],PZ[1]+10.0,false);
  53.         SetActorPosition(102,PX[2],PY[2],PZ[2]+10.0,false);
  54.         SetActorPosition(103,PX[3],PY[3],PZ[3]+10.0,false);
  55.         SetActorPosition(104,PX[4],PY[4],PZ[4]+10.0,false);
  56.         delay(1);
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement