Advertisement
Guest User

Seif

a guest
Aug 22nd, 2008
3,407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 25.70 KB | None | 0 0
  1. //-------------------------------------------------
  2. //
  3. // Seifanimations - Perfect for role playing servers
  4. // Based on kyeman's vactions script
  5. //
  6. //-------------------------------------------------
  7.  
  8. #include <a_samp>
  9. #include <core>
  10. #include <float>
  11.  
  12. #define GREEN 0x21DD00FF
  13. #define RED 0xE60000FF
  14. #define ADMIN_RED 0xFB0000FF
  15. #define YELLOW 0xFFFF00FF
  16. #define ORANGE 0xF97804FF
  17. #define LIGHTRED 0xFF8080FF
  18. #define LIGHTBLUE 0x00C2ECFF
  19. #define PURPLE 0xB360FDFF
  20. #define PLAYER_COLOR 0xFFFFFFFF
  21. #define BLUE 0x1229FAFF
  22. #define LIGHTGREEN 0x38FF06FF
  23. #define DARKPINK 0xE100E1FF
  24. #define DARKGREEN 0x008040FF
  25. #define ANNOUNCEMENT 0x6AF7E1FF
  26. #define COLOR_SYSTEM 0xEFEFF7AA
  27. #define GREY 0xCECECEFF
  28. #define PINK 0xD52DFFFF
  29. #define DARKGREY    0x626262FF
  30. #define AQUAGREEN   0x03D687FF
  31. #define NICESKY 0x99FFFFAA
  32. #define WHITE           0xFFFFFFFF
  33.  
  34. #define SPECIAL_ACTION_PISSING      68
  35. //#define DISALLOW_ANIMS_INVEHICLES   //Uncomment if you don't want animations inside vehicles
  36.  
  37. new gPlayerUsingLoopingAnim[MAX_PLAYERS];
  38. new gPlayerAnimLibsPreloaded[MAX_PLAYERS];
  39. new animation[200];
  40. new Text:txtAnimHelper;
  41.  
  42. //-------------------------------------------------
  43.  
  44. // ********** INTERNAL FUNCTIONS **********
  45.  
  46. strtok(const string[], &index)
  47. {
  48.     new length = strlen(string);
  49.     while ((index < length) && (string[index] <= ' '))
  50.     {
  51.         index++;
  52.     }
  53.  
  54.     new offset = index;
  55.     new result[20];
  56.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  57.     {
  58.         result[index - offset] = string[index];
  59.         index++;
  60.     }
  61.     result[index - offset] = EOS;
  62.     return result;
  63. }
  64.  
  65. //------------------------------------------------
  66.  
  67. IsKeyJustDown(key, newkeys, oldkeys)
  68. {
  69.     if((newkeys & key) && !(oldkeys & key)) return 1;
  70.     return 0;
  71. }
  72.  
  73. //-------------------------------------------------
  74.  
  75. OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  76. {
  77.     if (gPlayerUsingLoopingAnim[playerid] == 1) TextDrawHideForPlayer(playerid,txtAnimHelper);
  78.     ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  79.     animation[playerid]++;
  80. }
  81.  
  82. //-------------------------------------------------
  83.  
  84. LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  85. {
  86.     if (gPlayerUsingLoopingAnim[playerid] == 1) TextDrawHideForPlayer(playerid,txtAnimHelper);
  87.     gPlayerUsingLoopingAnim[playerid] = 1;
  88.     ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  89.     TextDrawShowForPlayer(playerid,txtAnimHelper);
  90.     animation[playerid]++;
  91. }
  92.  
  93. //-------------------------------------------------
  94.  
  95. StopLoopingAnim(playerid)
  96. {
  97.     gPlayerUsingLoopingAnim[playerid] = 0;
  98.     ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  99. }
  100.  
  101. //-------------------------------------------------
  102.  
  103. PreloadAnimLib(playerid, animlib[])
  104. {
  105.     ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  106. }
  107.  
  108. //-------------------------------------------------
  109.  
  110. // ********** CALLBACKS **********
  111.  
  112. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  113. {
  114.     if(!gPlayerUsingLoopingAnim[playerid]) return;
  115.    
  116.     //SendClientInt(playerid, RED, "ID: %d", newkeys);
  117.  
  118.     if(IsKeyJustDown(KEY_HANDBRAKE,newkeys,oldkeys)) {
  119.         StopLoopingAnim(playerid);
  120.         TextDrawHideForPlayer(playerid,txtAnimHelper);
  121.         animation[playerid] = 0;
  122.     }
  123. }
  124.  
  125. //------------------------------------------------
  126. public OnPlayerDeath(playerid, killerid, reason)
  127. {
  128.     // if they die whilst performing a looping anim, we should reset the state
  129.     if(gPlayerUsingLoopingAnim[playerid]) {
  130.         gPlayerUsingLoopingAnim[playerid] = 0;
  131.         TextDrawHideForPlayer(playerid,txtAnimHelper);
  132.     }
  133.     return 1;
  134. }
  135. //-------------------------------------------------
  136.  
  137. public OnPlayerSpawn(playerid)
  138. {
  139.     if(!gPlayerAnimLibsPreloaded[playerid]) {
  140.         PreloadAnimLib(playerid,"BOMBER");
  141.         PreloadAnimLib(playerid,"RAPPING");
  142.         PreloadAnimLib(playerid,"SHOP");
  143.         PreloadAnimLib(playerid,"BEACH");
  144.         PreloadAnimLib(playerid,"SMOKING");
  145.         PreloadAnimLib(playerid,"FOOD");
  146.         PreloadAnimLib(playerid,"ON_LOOKERS");
  147.         PreloadAnimLib(playerid,"DEALER");
  148.         PreloadAnimLib(playerid,"CRACK");
  149.         PreloadAnimLib(playerid,"CARRY");
  150.         PreloadAnimLib(playerid,"COP_AMBIENT");
  151.         PreloadAnimLib(playerid,"PARK");
  152.         PreloadAnimLib(playerid,"INT_HOUSE");
  153.         PreloadAnimLib(playerid,"FOOD");
  154.         PreloadAnimLib(playerid,"PED");
  155.         gPlayerAnimLibsPreloaded[playerid] = 1;
  156.     }
  157.     return 1;
  158. }
  159.  
  160. //-------------------------------------------------
  161.  
  162. public OnPlayerConnect(playerid)
  163. {
  164.     gPlayerUsingLoopingAnim[playerid] = 0;
  165.     gPlayerAnimLibsPreloaded[playerid] = 0;
  166.     return 1;
  167. }
  168.  
  169. //-------------------------------------------------
  170.  
  171. public OnFilterScriptInit()
  172. {
  173.     // Init our text display
  174.     txtAnimHelper = TextDrawCreate(610.0, 400.0,
  175.     "~b~~k~~PED_LOCK_TARGET~ ~w~to stop the animation");
  176.     TextDrawUseBox(txtAnimHelper, 0);
  177.     TextDrawFont(txtAnimHelper, 2);
  178.     TextDrawSetShadow(txtAnimHelper,0); // no shadow
  179.     TextDrawSetOutline(txtAnimHelper,1); // thickness 1
  180.     TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
  181.     TextDrawColor(txtAnimHelper,0xFFFFFFFF);
  182.     TextDrawAlignment(txtAnimHelper,3); // align right
  183. }
  184.  
  185. public OnFilterScriptExit()
  186. {
  187.     TextDrawDestroy(txtAnimHelper);
  188. }
  189.  
  190. //-------------------------------------------------
  191.  
  192. public OnPlayerCommandText(playerid, cmdtext[])
  193. {
  194.     new cmd[256];
  195.     new tmp[256];
  196.     new idx;
  197.     new dancestyle;
  198.     cmd = strtok(cmdtext, idx);
  199.  
  200.     if(strcmp(cmd,"/animlist",true)==0)
  201.     {
  202.         SendClientMessage(playerid, YELLOW, "________________________________________________________________________________________________________________________");
  203.         SendClientMessage(playerid,RED,"-Available Animations:");
  204.         SendClientMessage(playerid,WHITE,"/fall - /fallback - /injured - /akick - /push - /lowbodypush - /handsup - /bomb - /drunk - /getarrested - /laugh - /sup");
  205.         SendClientMessage(playerid,WHITE," /basket - /headbutt - /medic - /spray - /robman - /taichi - /lookout - /kiss - /cellin - /cellout - /crossarms - /lay");
  206.         SendClientMessage(playerid,WHITE,"/deal - /crack - /smoke - /groundsit - /chat - /dance - /fucku - /strip - /hide - /vomit - /eat - /chairsit - /reload");
  207.         SendClientMessage(playerid,WHITE,"/koface - /kostomach - /rollfall - /carjacked1 - /carjacked2 - /rcarjack1 - /rcarjack2 - /lcarjack1 - /lcarjack2 - /bat");
  208.         SendClientMessage(playerid,WHITE,"/lifejump - /exhaust - /leftslap - /carlock - /hoodfrisked - /lightcig - /tapcig - /box - /lay2 - /chant - finger");
  209.         SendClientMessage(playerid,WHITE,"/shouting - /knife - /cop - /elbow - /kneekick - /airkick - /gkick - /gpunch - /fstance - /lowthrow - /highthrow - /aim");
  210.         SendClientMessage(playerid,WHITE,"/pee - /lean - /run");
  211.         SendClientMessage(playerid, YELLOW, "");
  212.         return true;
  213.     }
  214.    
  215.     // carjacked
  216.     if(strcmp(cmd, "/carjacked1", true) == 0) {
  217.          LoopingAnim(playerid,"PED","CAR_jackedLHS",4.0,0,1,1,1,0);
  218.          return 1;
  219.     }
  220.    
  221.     // carjacked
  222.     if(strcmp(cmd, "/carjacked2", true) == 0) {
  223.          LoopingAnim(playerid,"PED","CAR_jackedRHS",4.0,0,1,1,1,0);
  224.          return 1;
  225.     }
  226.  
  227.     #if defined DISALLOW_ANIMS_INVEHICLES
  228.         if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, RED, "You are not allowed to use animations inside a vehicle");
  229.     #endif
  230.  
  231.     // HANDSUP
  232.     if(strcmp(cmd, "/handsup", true) == 0) {
  233.         //SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
  234.         LoopingAnim(playerid, "ROB_BANK","SHP_HandsUp_Scr", 4.0, 0, 1, 1, 1, 0);
  235.         return 1;
  236.     }
  237.  
  238.     // CELLPHONE IN
  239.     if(strcmp(cmd, "/cellin", true) == 0) {
  240.         SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
  241.         return 1;
  242.     }
  243.  
  244.     // CELLPHONE OUT
  245.     if(strcmp(cmd, "/cellout", true) == 0) {
  246.         SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
  247.         return 1;
  248.     }
  249.  
  250.     // Drunk
  251.     if(strcmp(cmd, "/drunk", true) == 0) {
  252.         LoopingAnim(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
  253.         return 1;
  254.     }
  255.  
  256.     // Place a Bomb
  257.     if (strcmp("/bomb", cmdtext, true) == 0) {
  258.         ClearAnimations(playerid);
  259.         LoopingAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0); // Place Bomb
  260.         return 1;
  261.     }
  262.     // Police Arrest
  263.     if (strcmp("/getarrested", cmdtext, true) == 0) {
  264.           LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
  265.           return 1;
  266.     }
  267.     // Laugh
  268.     if (strcmp("/laugh", cmdtext, true) == 0) {
  269.           OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
  270.           return 1;
  271.     }
  272.     // Rob Lookout
  273.     if (strcmp("/lookout", cmdtext, true) == 0) {
  274.           OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
  275.           return 1;
  276.     }
  277.     // Rob Threat
  278.     if (strcmp("/robman", cmdtext, true) == 0) {
  279.           LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
  280.           return 1;
  281.     }
  282.     // Arms crossed
  283.     if (strcmp("/crossarms", cmdtext, true) == 0) {
  284.           LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
  285.           return 1;
  286.     }
  287.     // Lay Down
  288.     if (strcmp("/lay", cmdtext, true) == 0) {
  289.           LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
  290.           return 1;
  291.     }
  292.     // Take Cover
  293.     if (strcmp("/hide", cmdtext, true) == 0) {
  294.           LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
  295.           return 1;
  296.     }
  297.     // Vomit
  298.     if (strcmp("/vomit", cmdtext, true) == 0) {
  299.           OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
  300.           return 1;
  301.     }
  302.     // Eat Burger
  303.     if (strcmp("/eat", cmdtext, true) == 0) {
  304.           OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
  305.           return 1;
  306.     }
  307.     // Wave
  308.     if (strcmp("/wave", cmdtext, true) == 0) {
  309.           LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
  310.           return 1;
  311.     }
  312.     // Slap Ass
  313.     if (strcmp("/slapass", cmdtext, true) == 0) {
  314.         OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
  315.         return 1;
  316.     }
  317.     // Dealer
  318.     if (strcmp("/deal", cmdtext, true) == 0) {
  319.           OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
  320.           return 1;
  321.     }
  322.     // Crack Dieing
  323.     if (strcmp("/crack", cmdtext, true) == 0) {
  324.           LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
  325.           return 1;
  326.     }
  327.     // Smoking animations
  328.     if(strcmp(cmd, "/smoke", true) == 0)
  329.     {
  330.         if (!strlen(cmdtext[7])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /smoke [1-4]");
  331.         switch (cmdtext[7])
  332.         {
  333.             case '1': LoopingAnim(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0); // male
  334.             case '2': LoopingAnim(playerid,"SMOKING", "F_smklean_loop", 4.0, 1, 0, 0, 0, 0); //female
  335.             case '3': LoopingAnim(playerid,"SMOKING","M_smkstnd_loop", 4.0, 1, 0, 0, 0, 0); // standing-fucked
  336.             case '4': LoopingAnim(playerid,"SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0); // standing
  337.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /smoke [1-4]");
  338.         }
  339.         return 1;
  340.     }
  341.     // Sit
  342.     if (strcmp("/groundsit", cmdtext, true) == 0 || strcmp("/gro", cmdtext, true) == 0) {
  343.           LoopingAnim(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
  344.           return 1;
  345.     }
  346.     // Idle Chat
  347.     if(strcmp(cmd, "/chat", true) == 0) {
  348.          LoopingAnim(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1);
  349.          return 1;
  350.     }
  351.     // Fucku
  352.     if(strcmp(cmd, "/fucku", true) == 0) {
  353.          OnePlayAnim(playerid,"PED","fucku",4.0,0,0,0,0,0);
  354.          return 1;
  355.     }
  356.     // TaiChi
  357.     if(strcmp(cmd, "/taichi", true) == 0) {
  358.          LoopingAnim(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
  359.          return 1;
  360.     }
  361.  
  362.     // ChairSit
  363.     if(strcmp(cmd, "/chairsit", true) == 0) {
  364.          LoopingAnim(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
  365.          return 1;
  366.     }
  367.  
  368.     // Fall on the ground
  369.     if(strcmp(cmd, "/fall", true) == 0) {
  370.          LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
  371.          return 1;
  372.     }
  373.  
  374.     // Fall
  375.     if(strcmp(cmd, "/fallback", true) == 0) {
  376.          LoopingAnim(playerid, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
  377.          return 1;
  378.     }
  379.  
  380.     // kiss
  381.     if(strcmp(cmd, "/kiss", true) == 0) {
  382.          LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0);
  383.          return 1;
  384.     }
  385.  
  386.     // Injujred
  387.     if(strcmp(cmd, "/injured", true) == 0) {
  388.          LoopingAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
  389.          return 1;
  390.     }
  391.  
  392.     // Homie animations
  393.     if(strcmp(cmd, "/sup", true) == 0)
  394.     {
  395.         if (!strlen(cmdtext[5])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /sup [1-3]");
  396.         switch (cmdtext[5])
  397.         {
  398.             case '1': OnePlayAnim(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
  399.             case '2': OnePlayAnim(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
  400.             case '3': OnePlayAnim(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
  401.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /sup [1-3]");
  402.         }
  403.         return 1;
  404.     }
  405.    
  406.     // Rap animations
  407.     if(strcmp(cmd, "/rap", true) == 0)
  408.     {
  409.         if (!strlen(cmdtext[5])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /rap [1-4]");
  410.         switch (cmdtext[5])
  411.         {
  412.             case '1': LoopingAnim(playerid,"RAPPING","RAP_A_Loop",4.0,1,0,0,0,0);
  413.             case '2': LoopingAnim(playerid,"RAPPING","RAP_C_Loop",4.0,1,0,0,0,0);
  414.             case '3': LoopingAnim(playerid,"GANGS","prtial_gngtlkD",4.0,1,0,0,0,0);
  415.             case '4': LoopingAnim(playerid,"GANGS","prtial_gngtlkH",4.0,1,0,0,1,1);
  416.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /rap [1-4]");
  417.         }
  418.         return 1;
  419.     }
  420.    
  421.     // Violence animations
  422.     if(strcmp(cmd, "/push", true) == 0) {
  423.          OnePlayAnim(playerid,"GANGS","shake_cara",4.0,0,0,0,0,0);
  424.          return 1;
  425.     }
  426.  
  427.     if(strcmp(cmd, "/akick", true) == 0) {
  428.          OnePlayAnim(playerid,"POLICE","Door_Kick",4.0,0,0,0,0,0);
  429.          return 1;
  430.     }
  431.    
  432.     if(strcmp(cmd, "/lowbodypush", true) == 0) {
  433.          OnePlayAnim(playerid,"GANGS","shake_carSH",4.0,0,0,0,0,0);
  434.          return 1;
  435.     }
  436.    
  437.     // Spray
  438.     if(strcmp(cmd, "/spray", true) == 0) {
  439.          OnePlayAnim(playerid,"SPRAYCAN","spraycan_full",4.0,0,0,0,0,0);
  440.          return 1;
  441.     }
  442.    
  443.     // Headbutt
  444.     if(strcmp(cmd, "/headbutt", true) == 0) {
  445.          OnePlayAnim(playerid,"WAYFARER","WF_Fwd",4.0,0,0,0,0,0);
  446.          return 1;
  447.     }
  448.    
  449.     // Medic
  450.     if(strcmp(cmd, "/medic", true) == 0) {
  451.          OnePlayAnim(playerid,"MEDIC","CPR",4.0,0,0,0,0,0);
  452.          return 1;
  453.     }
  454.    
  455.     // KO Face
  456.     if(strcmp(cmd, "/koface", true) == 0) {
  457.          LoopingAnim(playerid,"PED","KO_shot_face",4.0,0,1,1,1,0);
  458.          return 1;
  459.     }
  460.    
  461.     // KO Stomach
  462.     if(strcmp(cmd, "/kostomach", true) == 0) {
  463.          LoopingAnim(playerid,"PED","KO_shot_stom",4.0,0,1,1,1,0);
  464.          return 1;
  465.     }
  466.    
  467.     // Jump for your life!
  468.     if(strcmp(cmd, "/lifejump", true) == 0) {
  469.          LoopingAnim(playerid,"PED","EV_dive",4.0,0,1,1,1,0);
  470.          return 1;
  471.     }
  472.    
  473.     // Exhausted
  474.     if(strcmp(cmd, "/exhaust", true) == 0) {
  475.          LoopingAnim(playerid,"PED","IDLE_tired",3.0,1,0,0,0,0);
  476.          return 1;
  477.     }
  478.    
  479.     // Left big slap
  480.     if(strcmp(cmd, "/leftslap", true) == 0) {
  481.          OnePlayAnim(playerid,"PED","BIKE_elbowL",4.0,0,0,0,0,0);
  482.          return 1;
  483.     }
  484.    
  485.     // Big fall
  486.     if(strcmp(cmd, "/rollfall", true) == 0) {
  487.          LoopingAnim(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0);
  488.          return 1;
  489.     }
  490.    
  491.     // Locked
  492.     if(strcmp(cmd, "/carlock", true) == 0) {
  493.          OnePlayAnim(playerid,"PED","CAR_doorlocked_LHS",4.0,0,0,0,0,0);
  494.          return 1;
  495.     }
  496.    
  497.     // carjack
  498.     if(strcmp(cmd, "/rcarjack1", true) == 0) {
  499.          OnePlayAnim(playerid,"PED","CAR_pulloutL_LHS",4.0,0,0,0,0,0);
  500.          return 1;
  501.     }
  502.  
  503.     // carjack
  504.     if(strcmp(cmd, "/lcarjack1", true) == 0) {
  505.          OnePlayAnim(playerid,"PED","CAR_pulloutL_RHS",4.0,0,0,0,0,0);
  506.          return 1;
  507.     }
  508.    
  509.     // carjack
  510.     if(strcmp(cmd, "/rcarjack2", true) == 0) {
  511.          OnePlayAnim(playerid,"PED","CAR_pullout_LHS",4.0,0,0,0,0,0);
  512.          return 1;
  513.     }
  514.  
  515.     // carjack
  516.     if(strcmp(cmd, "/lcarjack2", true) == 0) {
  517.          OnePlayAnim(playerid,"PED","CAR_pullout_RHS",4.0,0,0,0,0,0);
  518.          return 1;
  519.     }
  520.    
  521.     // Hood frisked
  522.     if(strcmp(cmd, "/hoodfrisked", true) == 0) {
  523.          LoopingAnim(playerid,"POLICE","crm_drgbst_01",4.0,0,1,1,1,0);
  524.          return 1;
  525.     }
  526.    
  527.     // Lighting cigarette
  528.     if(strcmp(cmd, "/lightcig", true) == 0) {
  529.          OnePlayAnim(playerid,"SMOKING","M_smk_in",3.0,0,0,0,0,0);
  530.          return 1;
  531.     }
  532.    
  533.     // Tap cigarette
  534.     if(strcmp(cmd, "/tapcig", true) == 0) {
  535.          OnePlayAnim(playerid,"SMOKING","M_smk_tap",3.0,0,0,0,0,0);
  536.          return 1;
  537.     }
  538.    
  539.     // Bat stance
  540.     if(strcmp(cmd, "/bat", true) == 0) {
  541.          LoopingAnim(playerid,"BASEBALL","Bat_IDLE",4.0,1,1,1,1,0);
  542.          return 1;
  543.     }
  544.    
  545.     // Boxing
  546.     if(strcmp(cmd, "/box", true) == 0) {
  547.          LoopingAnim(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0);
  548.          return 1;
  549.     }
  550.    
  551.     // Lay 2
  552.     if(strcmp(cmd, "/lay2", true) == 0) {
  553.          LoopingAnim(playerid,"SUNBATHE","Lay_Bac_in",3.0,0,1,1,1,0);
  554.          return 1;
  555.     }
  556.    
  557.     // Gogogo
  558.     if(strcmp(cmd, "/chant", true) == 0) {
  559.          LoopingAnim(playerid,"RIOT","RIOT_CHANT",4.0,1,1,1,1,0);
  560.          return 1;
  561.     }
  562.    
  563.     // Finger
  564.     if(strcmp(cmd, "/finger", true) == 0) {
  565.          OnePlayAnim(playerid,"RIOT","RIOT_FUKU",2.0,0,0,0,0,0);
  566.          return 1;
  567.     }
  568.    
  569.     // Shouting
  570.     if(strcmp(cmd, "/shouting", true) == 0) {
  571.          LoopingAnim(playerid,"RIOT","RIOT_shout",4.0,1,0,0,0,0);
  572.          return 1;
  573.     }
  574.    
  575.     // Cop stance
  576.     if(strcmp(cmd, "/cop", true) == 0) {
  577.          OnePlayAnim(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
  578.          return 1;
  579.     }
  580.    
  581.     // Elbow
  582.     if(strcmp(cmd, "/elbow", true) == 0) {
  583.          OnePlayAnim(playerid,"FIGHT_D","FightD_3",4.0,0,1,1,0,0);
  584.          return 1;
  585.     }
  586.  
  587.     // Knee kick
  588.     if(strcmp(cmd, "/kneekick", true) == 0) {
  589.          OnePlayAnim(playerid,"FIGHT_D","FightD_2",4.0,0,1,1,0,0);
  590.          return 1;
  591.     }
  592.  
  593.     // Fight stance
  594.     if(strcmp(cmd, "/fstance", true) == 0) {
  595.          LoopingAnim(playerid,"FIGHT_D","FightD_IDLE",4.0,1,1,1,1,0);
  596.          return 1;
  597.     }
  598.    
  599.     // Ground punch
  600.     if(strcmp(cmd, "/gpunch", true) == 0) {
  601.          OnePlayAnim(playerid,"FIGHT_B","FightB_G",4.0,0,0,0,0,0);
  602.          return 1;
  603.     }
  604.    
  605.     // Air kick
  606.     if(strcmp(cmd, "/airkick", true) == 0) {
  607.          OnePlayAnim(playerid,"FIGHT_C","FightC_M",4.0,0,1,1,0,0);
  608.          return 1;
  609.     }
  610.    
  611.     // Ground kick
  612.     if(strcmp(cmd, "/gkick", true) == 0) {
  613.          OnePlayAnim(playerid,"FIGHT_D","FightD_G",4.0,0,0,0,0,0);
  614.          return 1;
  615.     }
  616.    
  617.     // Low throw
  618.     if(strcmp(cmd, "/lowthrow", true) == 0) {
  619.          OnePlayAnim(playerid,"GRENADE","WEAPON_throwu",3.0,0,0,0,0,0);
  620.          return 1;
  621.     }
  622.    
  623.     // Ground kick
  624.     if(strcmp(cmd, "/highthrow", true) == 0) {
  625.          OnePlayAnim(playerid,"GRENADE","WEAPON_throw",4.0,0,0,0,0,0);
  626.          return 1;
  627.     }
  628.    
  629.     // Deal stance
  630.     if(strcmp(cmd, "/dealstance", true) == 0) {
  631.          LoopingAnim(playerid,"DEALER","DEALER_IDLE",4.0,1,0,0,0,0);
  632.          return 1;
  633.     }
  634.    
  635.     // Deal stance
  636.     if(strcmp(cmd, "/pee", true) == 0) {
  637.          SetPlayerSpecialAction(playerid, SPECIAL_ACTION_PISSING);
  638.          return 1;
  639.     }
  640.  
  641.     // Knife animations
  642.     if(strcmp(cmd, "/knife", true) == 0)
  643.     {
  644.         if (!strlen(cmdtext[7])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /knife [1-4]");
  645.         switch (cmdtext[7])
  646.         {
  647.             case '1': LoopingAnim(playerid,"KNIFE","KILL_Knife_Ped_Damage",4.0,0,1,1,1,0);
  648.             case '2': LoopingAnim(playerid,"KNIFE","KILL_Knife_Ped_Die",4.0,0,1,1,1,0);
  649.             case '3': OnePlayAnim(playerid,"KNIFE","KILL_Knife_Player",4.0,0,0,0,0,0);
  650.             case '4': LoopingAnim(playerid,"KNIFE","KILL_Partial",4.0,0,1,1,1,1);
  651.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /knife [1-4]");
  652.         }
  653.         return 1;
  654.     }
  655.    
  656.     // Basket-ball
  657.     if(strcmp(cmd, "/basket", true) == 0)
  658.     {
  659.         if (!strlen(cmdtext[8])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /basket [1-6]");
  660.         switch (cmdtext[8])
  661.         {
  662.             case '1': LoopingAnim(playerid,"BSKTBALL","BBALL_idleloop",4.0,1,0,0,0,0);
  663.             case '2': OnePlayAnim(playerid,"BSKTBALL","BBALL_Jump_Shot",4.0,0,0,0,0,0);
  664.             case '3': OnePlayAnim(playerid,"BSKTBALL","BBALL_pickup",4.0,0,0,0,0,0);
  665.             case '4': LoopingAnim(playerid,"BSKTBALL","BBALL_run",4.1,1,1,1,1,1);
  666.             case '5': LoopingAnim(playerid,"BSKTBALL","BBALL_def_loop",4.0,1,0,0,0,0);
  667.             case '6': LoopingAnim(playerid,"BSKTBALL","BBALL_Dnk",4.0,1,0,0,0,0);
  668.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /basket [1-6]");
  669.         }
  670.         return 1;
  671.     }
  672.    
  673.     // Reloading guns
  674.     if(strcmp(cmd, "/reload", true) == 0)
  675.     {
  676.         if (!strlen(cmdtext[8])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /reload [deagle/smg/ak/m4]");
  677.         if (strcmp("deagle",cmdtext[8],true) == 0)
  678.         {
  679.             OnePlayAnim(playerid,"COLT45","colt45_reload",4.0,0,0,0,0,1);
  680.         }
  681.         else if (strcmp("smg",cmdtext[8],true) == 0 || strcmp("ak",cmdtext[8],true) == 0 || strcmp("m4",cmdtext[8],true) == 0)
  682.         {
  683.             OnePlayAnim(playerid,"UZI","UZI_reload",4.0,0,0,0,0,0);
  684.         }
  685.         else SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /reload [deagle/smg/ak/m4]");
  686.         return 1;
  687.     }
  688.    
  689.     if(strcmp(cmd, "/gwalk", true) == 0)
  690.     {
  691.         if (!strlen(cmdtext[6])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /gwalk [1/2]");
  692.         new style = strval(cmdtext[6]);
  693.         if (style == 1)
  694.         {
  695.             LoopingAnim(playerid,"PED","WALK_gang1",4.1,1,1,1,1,1);
  696.         }
  697.         else if (style == 2)
  698.         {
  699.             LoopingAnim(playerid,"PED","WALK_gang2",4.1,1,1,1,1,1);
  700.         }
  701.         else SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /gwalk [1/2]");
  702.         return 1;
  703.     }
  704.    
  705.     //Aiming animation
  706.     if(strcmp(cmd, "/aim", true) == 0)
  707.     {
  708.         if (!strlen(cmdtext[5])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /aim [1-.]");
  709.         switch (cmdtext[5])
  710.         {
  711.             case '1': LoopingAnim(playerid,"PED","gang_gunstand",4.0,1,1,1,1,1);
  712.             case '2': LoopingAnim(playerid,"PED","Driveby_L",4.0,0,1,1,1,1);
  713.             case '3': LoopingAnim(playerid,"PED","Driveby_R",4.0,0,1,1,1,1);
  714.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /aim [1-3]");
  715.         }
  716.         return 1;
  717.     }
  718.    
  719.     // Leaning animation
  720.     if(strcmp(cmd, "/lean", true) == 0)
  721.     {
  722.         if (!strlen(cmdtext[6])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /lean [1-2]");
  723.         switch (cmdtext[6])
  724.         {
  725.             case '1': LoopingAnim(playerid,"GANGS","leanIDLE",4.0,0,1,1,1,0);
  726.             case '2': LoopingAnim(playerid,"MISC","Plyrlean_loop",4.0,0,1,1,1,0);
  727.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /lean [1-2]");
  728.         }
  729.         return 1;
  730.     }
  731.    
  732.     if(strcmp(cmd, "/run", true) == 0)
  733.     {
  734.         LoopingAnim(playerid,"PED","sprint_civi",floatstr(cmdtext[5]),1,1,1,1,1);
  735.         printf("%f",floatstr(cmdtext[5]));
  736.         return 1;
  737.     }
  738.    
  739.     // Clear
  740.     if(strcmp(cmd, "/clear", true) == 0) {
  741.          //ClearAnimations(playerid);
  742.          ApplyAnimation(playerid, "CARRY", "crry_prtial", 1.0, 0, 0, 0, 0, 0);
  743.          return 1;
  744.     }
  745.  
  746.     // Strip
  747.     if(strcmp(cmd, "/strip", true) == 0)
  748.     {
  749.         if (!strlen(cmdtext[7])) return SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /strip [A-G]");
  750.         switch (cmdtext[7])
  751.         {
  752.             case 'a', 'A': LoopingAnim(playerid,"STRIP", "strip_A", 4.1, 1, 1, 1, 1, 1 );
  753.             case 'b', 'B': LoopingAnim(playerid,"STRIP", "strip_B", 4.1, 1, 1, 1, 1, 1 );
  754.             case 'c', 'C': LoopingAnim(playerid,"STRIP", "strip_C", 4.1, 1, 1, 1, 1, 1 );
  755.             case 'd', 'D': LoopingAnim(playerid,"STRIP", "strip_D", 4.1, 1, 1, 1, 1, 1 );
  756.             case 'e', 'E': LoopingAnim(playerid,"STRIP", "strip_E", 4.1, 1, 1, 1, 1, 1 );
  757.             case 'f', 'F': LoopingAnim(playerid,"STRIP", "strip_F", 4.1, 1, 1, 1, 1, 1 );
  758.             case 'g', 'G': LoopingAnim(playerid,"STRIP", "strip_G", 4.1, 1, 1, 1, 1, 1 );
  759.             default: SendClientMessage(playerid,0xEFEFF7AA,"USAGE: /strip [A-G]");
  760.         }
  761.         return 1;
  762.     }
  763.  
  764.     /* Would allow people to troll... but would be cool as a script
  765.        controlled function
  766.     // Bed Sleep R
  767.     if(strcmp(cmd, "/inbedright", true) == 0) {
  768.          LoopingAnim(playerid,"INT_HOUSE","BED_Loop_R",4.0,1,0,0,0,0);
  769.          return 1;
  770.     }
  771.     // Bed Sleep L
  772.     if(strcmp(cmd, "/inbedleft", true) == 0) {
  773.          LoopingAnim(playerid,"INT_HOUSE","BED_Loop_L",4.0,1,0,0,0,0);
  774.          return 1;
  775.     }*/
  776.  
  777.  
  778.     // START DANCING
  779.     if(strcmp(cmd, "/dance", true) == 0) {
  780.  
  781.             // Get the dance style param
  782.             tmp = strtok(cmdtext, idx);
  783.             if(!strlen(tmp)) {
  784.                 SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
  785.                 return 1;
  786.             }
  787.  
  788.             dancestyle = strval(tmp);
  789.             if(dancestyle < 1 || dancestyle > 4) {
  790.                 SendClientMessage(playerid,0xFF0000FF,"USAGE: /dance [style 1-4]");
  791.                 return 1;
  792.             }
  793.  
  794.             if(dancestyle == 1) {
  795.                 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
  796.             } else if(dancestyle == 2) {
  797.                 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
  798.             } else if(dancestyle == 3) {
  799.                 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
  800.             } else if(dancestyle == 4) {
  801.                 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4);
  802.             }
  803.             return 1;
  804.     }
  805.  
  806.     return 0;
  807. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement