Guest User

[FS] Skate

a guest
Mar 13th, 2017
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. # Criado Por: OTACON
  2. # Traduzido Por: Roger_Sobral
  3. # Postado Por: Roger_Sobral
  4. # Créditos Total à Equipe: Releases-SAMP
  5. ______________________________________________________________________________________________________________________________________
  6.  
  7. /*
  8. *_______________________________________________________________________
  9. * Informações
  10. * Criado Por: OTACON.
  11. * Traduzido Por: Roger_Sobral.
  12. * Postado na Release-SAMP Por: Roger_Sobral
  13. *_______________________________________________________________________
  14. * Comando
  15. * /skate - Pega/Guarda o Skate
  16. *_______________________________________________________________________
  17. * Release-SAMP
  18. * •´Tudo para seu SAMP •
  19. * •´GameModes •
  20. * •´FilterScripts •
  21. * •´Mapas •
  22. * •´Xat Ativo •
  23. * •´Vagas para Mod's e Owners •
  24. * •´Vagas para Postadores •
  25. * •´O Maior Blog de SAMP •
  26. * •´VISITE-NOS •
  27. * (•-•)´http://releases-samp.com (•-•)
  28. *_______________________________________________________________________
  29. */
  30.  
  31.  
  32. #include <a_samp>
  33. #include <zcmd>
  34.  
  35. #define MODE_SKATE (0) // 0 - medium speed | 1 - fast speed
  36. #define TYPE_SKATE (0) // 0 - the skate is placed on the right arm | 1 - the skate is placed in the back
  37. #define INDEX_SKATE (0) //is the slot that used SetPlayerAttachedObject
  38. enum skate{
  39. bool:sActive,
  40. sSkate,
  41. };
  42. new InfoSkate[MAX_PLAYERS][skate];
  43.  
  44. COMMAND:skate(playerid,params[]){
  45. if(!IsPlayerInAnyVehicle(playerid)){
  46. ApplyAnimation(playerid, "CARRY","null",0,0,0,0,0,0,0);
  47. ApplyAnimation(playerid, "SKATE","null",0,0,0,0,0,0,0);
  48. ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
  49. SetPlayerArmedWeapon(playerid,0);
  50. if(!InfoSkate[playerid][sActive]){
  51. InfoSkate[playerid][sActive] = true;
  52. DestroyObject(InfoSkate[playerid][sSkate]);
  53. RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  54. #if TYPE_SKATE == 0
  55. // the skate is placed on the right arm
  56. SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
  57. #else
  58. // the skate is placed in the back
  59. SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,1,0.055999,-0.173999,-0.007000,-95.999893,-1.600010,24.099992,1.000000,1.000000,1.000000);
  60. #endif
  61. PlayerPlaySound(playerid,21000,0,0,0);
  62. SendClientMessage(playerid,-1,"{FFFFFF}Skate: {00B100}Você Pegou o seu Skate{FFFFFF}!.");
  63. }else{
  64. InfoSkate[playerid][sActive] = false;
  65. DestroyObject(InfoSkate[playerid][sSkate]);
  66. RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  67. PlayerPlaySound(playerid,21000,0,0,0);
  68. SendClientMessage(playerid,-1,"{FFFFFF}Skate: {B00000}Você Guardou o seu Skate{FFFFFF}!.");
  69. }
  70. }else SendClientMessage(playerid,-1,"{FFFFFF}Skate: {00B7FF}Você não Pode pegar o seu Skate dentro de um Veículo{FFFFFF}!.");
  71. return true;
  72. }
  73.  
  74. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
  75. if(InfoSkate[playerid][sActive] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT){
  76. static bool:act;
  77. SetPlayerArmedWeapon(playerid,0);
  78. if(newkeys & KEY_HANDBRAKE){
  79. #if MODE_SKATE == 0
  80. // medium speed
  81. ApplyAnimation(playerid, "SKATE","skate_run",4.1,1,1,1,1,1,1);
  82. #else
  83. // fast speed
  84. ApplyAnimation(playerid, "SKATE","skate_sprint",4.1,1,1,1,1,1,1);
  85. #endif
  86. if(!act){
  87. act = true;
  88. RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  89. DestroyObject(InfoSkate[playerid][sSkate]);
  90. InfoSkate[playerid][sSkate] = CreateObject(19878,0,0,0,0,0,0);
  91. AttachObjectToPlayer(InfoSkate[playerid][sSkate],playerid, -0.2,0,-0.9,0,0,90);
  92. }
  93. }
  94. if(oldkeys & KEY_HANDBRAKE){
  95. ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
  96. if(act){
  97. act = false;
  98. DestroyObject(InfoSkate[playerid][sSkate]);
  99. RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  100. #if TYPE_SKATE == 0
  101. // the skate is placed on the right arm
  102. SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
  103. #else
  104. // the skate is placed in the back
  105. SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,1,0.055999,-0.173999,-0.007000,-95.999893,-1.600010,24.099992,1.000000,1.000000,1.000000);
  106. #endif
  107. }
  108. }
  109. }
  110. return true;
  111. }
  112.  
  113. public OnFilterScriptInit(){
  114. AddPlayerClass(23,1916.1304,-1367.8215,13.6492,99.3507,0,0,0,0,0,0); //
  115. return true;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment