Advertisement
OtaconEvil

[FS] System 'Skate' | By OTACON

Jul 2nd, 2015
8,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.66 KB | None | 0 0
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                        FULLY spaces Theft Credit or
  33.     *                 Publication of this FILTERSCRIPT without my permission.
  34. */
  35.  
  36.  
  37. #include <a_samp>
  38. #include <zcmd>
  39.  
  40. #define MODE_SKATE (0)        // 0 - medium speed | 1 - fast speed
  41. #define TYPE_SKATE (0)        // 0 - the skate is placed on the right arm | 1 - the skate is placed in the back
  42. #define INDEX_SKATE (0)       //is the slot that used SetPlayerAttachedObject
  43. enum skate{
  44.     bool:sActive,
  45.     sSkate,
  46. };
  47. new InfoSkate[MAX_PLAYERS][skate];
  48.  
  49. COMMAND:skate(playerid,params[]){
  50.     if(!IsPlayerInAnyVehicle(playerid)){
  51.         ApplyAnimation(playerid, "CARRY","null",0,0,0,0,0,0,0);
  52.         ApplyAnimation(playerid, "SKATE","null",0,0,0,0,0,0,0);
  53.         ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
  54.         SetPlayerArmedWeapon(playerid,0);
  55.         if(!InfoSkate[playerid][sActive]){
  56.             InfoSkate[playerid][sActive] = true;
  57.             DestroyObject(InfoSkate[playerid][sSkate]);
  58.             RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  59.             #if TYPE_SKATE == 0
  60.             // the skate is placed on the right arm
  61.             SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
  62.             #else
  63.             // the skate is placed in the back
  64.             SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,1,0.055999,-0.173999,-0.007000,-95.999893,-1.600010,24.099992,1.000000,1.000000,1.000000);
  65.             #endif
  66.             PlayerPlaySound(playerid,21000,0,0,0);
  67.             SendClientMessage(playerid,-1,"{FFFFFF}INFO: {00B100}modo skate encendido{FFFFFF}!.");
  68.         }else{
  69.             InfoSkate[playerid][sActive] = false;
  70.             DestroyObject(InfoSkate[playerid][sSkate]);
  71.             RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  72.             PlayerPlaySound(playerid,21000,0,0,0);
  73.             SendClientMessage(playerid,-1,"{FFFFFF}INFO: {B00000}modo skate apagado{FFFFFF}!.");
  74.         }
  75.     }else SendClientMessage(playerid,-1,"{FFFFFF}INFO: {00B7FF}no puedes usar el skate desde un vehiculo{FFFFFF}!.");
  76.     return true;
  77. }
  78.  
  79. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
  80.     if(InfoSkate[playerid][sActive] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT){
  81.         static bool:act;
  82.         SetPlayerArmedWeapon(playerid,0);
  83.         if(newkeys & KEY_HANDBRAKE){
  84.             #if MODE_SKATE == 0
  85.             // medium speed
  86.             ApplyAnimation(playerid, "SKATE","skate_run",4.1,1,1,1,1,1,1);
  87.             #else
  88.             // fast speed
  89.             ApplyAnimation(playerid, "SKATE","skate_sprint",4.1,1,1,1,1,1,1);
  90.             #endif
  91.             if(!act){
  92.                 act = true;
  93.                 RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  94.                 DestroyObject(InfoSkate[playerid][sSkate]);
  95.                 InfoSkate[playerid][sSkate] = CreateObject(19878,0,0,0,0,0,0);
  96.                 AttachObjectToPlayer(InfoSkate[playerid][sSkate],playerid, -0.2,0,-0.9,0,0,90);
  97.             }
  98.         }
  99.         if(oldkeys & KEY_HANDBRAKE){
  100.             ApplyAnimation(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0);
  101.             if(act){
  102.                 act = false;
  103.                 DestroyObject(InfoSkate[playerid][sSkate]);
  104.                 RemovePlayerAttachedObject(playerid,INDEX_SKATE);
  105.                 #if TYPE_SKATE == 0
  106.                 // the skate is placed on the right arm
  107.                 SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000);
  108.                 #else
  109.                 // the skate is placed in the back
  110.                 SetPlayerAttachedObject(playerid,INDEX_SKATE,19878,1,0.055999,-0.173999,-0.007000,-95.999893,-1.600010,24.099992,1.000000,1.000000,1.000000);
  111.                 #endif
  112.             }
  113.         }
  114.     }
  115.     return true;
  116. }
  117.  
  118. public OnFilterScriptInit(){
  119.     AddPlayerClass(23,1916.1304,-1367.8215,13.6492,99.3507,0,0,0,0,0,0); //
  120.     return true;
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement