BlackDonelly

BLACK DONELLY CLASS SELECTION CREATOR VERSÃO ZCMD

Jul 19th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // BLACK DONELLY CLASS SELECTION CREATOR VERSÃO ZCMD 18/07/2012
  4. ////////////////////////////////////////////////////////////////////////////////
  5. ////////////////////////////////////////////////////////////////////////////////
  6.  
  7. #include <a_samp>
  8. #include <zcmd>
  9. #include <sscanf2>
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" LACK DONELLY CLASS SELECTION CREATOR CARREGADO!");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. print("\n--------------------------------------");
  22. print(" LACK DONELLY CLASS SELECTION CREATOR DESCARREGADO!");
  23. print("--------------------------------------\n");
  24. return 1;
  25. }
  26.  
  27. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  28. {
  29. return 1;
  30. }
  31.  
  32. CMD:scs(playerid,params[])
  33. {
  34. static Float:pPos[6],string[320],distancia;
  35. if(sscanf(params,"d",distancia)) return SendClientMessage(playerid,-1,"USO: /scs [disctância entre 2 e 8]");
  36. GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
  37. GetPlayerFacingAngle(playerid,pPos[3]);
  38. GetXYInFrontOfPlayer(playerid, pPos[4], pPos[5], distancia);
  39. new File:filex = fopen("ClassPosions.txt", io_append);
  40. fwrite(filex,"//=============================================================== \r\n");
  41. fwrite(filex,"NA PUBLIC OnPlayerRequestClass COLE ISTO:\r\n");
  42. fwrite(filex,"//\r\n");
  43. format(string,sizeof(string),"SetPlayerPos(playerid, %f, %f, %f);\r\n",pPos[0],pPos[1],pPos[2]);
  44. fwrite(filex,string);
  45. format(string,sizeof(string),"SetPlayerCameraPos(playerid, %f, %f, %f);\r\n",pPos[4],pPos[5],pPos[2]);
  46. fwrite(filex,string);
  47. format(string,sizeof(string),"SetPlayerCameraLookAt(playerid, %f, %f, %f);\r\n",pPos[0],pPos[1],pPos[2]);
  48. fwrite(filex,string);
  49. format(string,sizeof(string),"SetPlayerFacingAngle(playerid, %f);\r\n",pPos[3]);
  50. fwrite(filex,string);
  51. if(GetPlayerInterior(playerid) != 0)
  52. {
  53. format(string,sizeof(string),"SetPlayerInterior(playerid,%d);\r\n",GetPlayerInterior(playerid));
  54. fwrite(filex,string);
  55. }
  56. fclose(filex);
  57. SendClientMessage(playerid,0x0080C0AA," ");
  58. SendClientMessage(playerid,0x0080C0AA,"|| Sua seleção de classe foi salva em 'ClassPosions.txt' na pasta scriptfiles ||");
  59. SendClientMessage(playerid,0x0080C0AA," ");
  60. return 1;
  61. }
  62.  
  63. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  64. {
  65. new Float:a;
  66. GetPlayerPos(playerid, x, y, a);
  67. GetPlayerFacingAngle(playerid, a);
  68. if (GetPlayerVehicleID(playerid))
  69. {
  70. GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  71. }
  72. x += (distance * floatsin(-a, degrees));
  73. y += (distance * floatcos(-a, degrees));
  74. }
Advertisement
Add Comment
Please, Sign In to add comment