Advertisement
exod182

e_specfix.inc

Jan 4th, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. //Include by Exod_Martinez
  2. #include <a_samp>
  3.  
  4. forward exd_ResetToggle(playerid);
  5.  
  6. enum exd_SpecEnum{
  7. Float:exd_SpecPos[4],
  8. exd_SpecInt,
  9. exd_SpecVW
  10. }
  11. new exd_Spec[MAX_PLAYERS][exd_SpecEnum];
  12.  
  13. stock exd_TogglePlayerSpectating(playerid, bool:toggle){
  14. if(toggle){
  15. exd_Spec[playerid][exd_SpecVW] = GetPlayerVirtualWorld(playerid);
  16. exd_Spec[playerid][exd_SpecInt] = GetPlayerInterior(playerid);
  17. GetPlayerPos(playerid, exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2]);
  18. GetPlayerFacingAngle(playerid, exd_Spec[playerid][exd_SpecPos][3]);
  19. // printf("Pos: %f %f %f %f INT: %i VW: %i", exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2], exd_Spec[playerid][exd_SpecPos][3], exd_Spec[playerid][exd_SpecInt], exd_Spec[playerid][exd_SpecVW]);
  20. }
  21. else if(!toggle){
  22. if(exd_Spec[playerid][exd_SpecPos][0] != 0.0 && exd_Spec[playerid][exd_SpecPos][1] != 0.0){
  23. SetTimerEx("exd_ResetToggle", 25, false, "i", playerid);
  24. }
  25. }
  26. return TogglePlayerSpectating(playerid, toggle);
  27. }
  28.  
  29. public exd_ResetToggle(playerid){
  30. SetPlayerVirtualWorld(playerid, exd_Spec[playerid][exd_SpecVW]);
  31. SetPlayerInterior(playerid, exd_Spec[playerid][exd_SpecInt]);
  32. SetPlayerPos(playerid, exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2]);
  33. SetPlayerFacingAngle(playerid, exd_Spec[playerid][exd_SpecPos][3]);
  34. SetCameraBehindPlayer(playerid);
  35. return 1;
  36. }
  37.  
  38. #if defined _ALS_TogglePlayerSpectating
  39. #undef TogglePlayerSpectating
  40. #else
  41. #define _ALS_TogglePlayerSpectating
  42. #endif
  43.  
  44. #define TogglePlayerSpectating exd_TogglePlayerSpectating
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement