Guest User

Julian

a guest
Aug 12th, 2008
1,856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.51 KB | None | 0 0
  1. //-------------------------------------------------
  2. //
  3. // Creating commands set set player's specials
  4. // actions.
  5. // kyeman 2007
  6. // Invisible put new animations in it
  7. //
  8. //-------------------------------------------------
  9.  
  10. #pragma tabsize 0
  11. #include <a_samp>
  12. #include <core>
  13. #include <float>
  14.  
  15. //-------------------------------------------------
  16.  
  17. strtok(const string[], &index)
  18. {
  19. new length = strlen(string);
  20. while ((index < length) && (string[index] <= ' '))
  21. {
  22. index++;
  23. }
  24.  
  25. new offset = index;
  26. new result[20];
  27. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  28. {
  29. result[index - offset] = string[index];
  30. index++;
  31. }
  32. result[index - offset] = EOS;
  33. return result;
  34. }
  35.  
  36. //-------------------------------------------------
  37.  
  38. public OnPlayerCommandText(playerid, cmdtext[])
  39. {
  40. new cmd[256];
  41. new idx;
  42. new dancestyle;
  43. cmd = strtok(cmdtext, idx);
  44.  
  45. // HANDSUP
  46. if(strcmp(cmd, "/surrender", true) == 0) {
  47. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
  48. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
  49. return 1;
  50. }
  51. }
  52. // Drunk
  53. if(strcmp(cmd, "/drunk", true) == 0) {
  54. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  55. {
  56. ApplyAnimation(playerid,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
  57. SendClientMessage(playerid, 0xFF0000FF, "You are now walking like a drunk man"); // Walk Drunk
  58. return 1;
  59. }
  60. }
  61. // Place a Bomb
  62. if (strcmp("/bomb", cmdtext, true) == 0) {
  63. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
  64. SendClientMessage(playerid, 0xFF0000FF, "You are planting a bomb");
  65. return 1;
  66. }
  67. // Police Arrest
  68. if (strcmp("/arrest", cmdtext, true, 7) == 0) {
  69. ApplyAnimation( playerid,"ped", "ARRESTgun", 4.0, 0, 0, 0, 0, 0); // Gun Arrest
  70. SendClientMessage(playerid, 0xFF0000FF, "You are arresting someone with your gun");
  71. return 1;
  72. }
  73. // Laugh
  74. if (strcmp("/laugh", cmdtext, true) == 0) {
  75. ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
  76. SendClientMessage(playerid, 0xFF0000FF, "You are laughing");
  77. return 1;
  78. }
  79. // Rob Lookout
  80. if (strcmp("/lookout", cmdtext, true) == 0) {
  81. ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
  82. SendClientMessage(playerid, 0xFF0000FF, "You are looking out for cops");
  83. return 1;
  84. }
  85. // Rob Threat
  86. if (strcmp("/rob", cmdtext, true) == 0) {
  87. ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 0); // Rob
  88. SendClientMessage(playerid, 0xFF0000FF, "You are robbing the place");
  89. return 1;
  90. }
  91. // Wank Out
  92. if (strcmp("/wankin", cmdtext, true) == 0) {
  93. ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.0, 0, 0, 0, 0, 0); // Wank In
  94. SendClientMessage(playerid, 0xFF0000FF, "You are wanking");
  95. return 1;
  96. }
  97. // Police Arrest
  98. if (strcmp("/coparrest", cmdtext, true) == 0) {
  99. ApplyAnimation(playerid, "POLICE", "plc_drgbst_01", 4.0, 0, 0, 0, 0, 0); // Arrest
  100. SendClientMessage(playerid, 0xFF0000FF, "You are arresting someone");
  101. return 1;
  102. }
  103. // Wank In
  104. if (strcmp("/wankout", cmdtext, true) == 0) {
  105. ApplyAnimation(playerid, "PAULNMAC", "wank_out", 4.0, 0, 0, 0, 0, 0); // Wank Out
  106. SendClientMessage(playerid, 0xFF0000FF, "You are wanking out");
  107. return 1;
  108. }
  109. // Arrested
  110. if (strcmp("/arrested", cmdtext, true) == 0) {
  111. ApplyAnimation(playerid, "POLICE", "crm_drgbst_01", 4.0, 0, 0, 0, 0, 0); // Arrested
  112. SendClientMessage(playerid, 0xFF0000FF, "You are getting arrested");
  113. return 1;
  114. }
  115. // Injury
  116. if (strcmp("/injured", cmdtext, true) == 0) {
  117. ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 0, 0, 0, 0, 0); // Injured
  118. SendClientMessage(playerid, 0xFF0000FF, "You are injured");
  119. return 1;
  120. }
  121. // Ass Slapped
  122. if (strcmp("/slapped", cmdtext, true) == 0) {
  123. ApplyAnimation(playerid, "SWEET", "ho_ass_slapped", 4.0, 0, 0, 0, 0, 0); // Ass Slapped
  124. SendClientMessage(playerid, 0xFF0000FF, "You are getting slapped");
  125. return 1;
  126. }
  127. // Female Smoking
  128. if (strcmp("/fsmoking", cmdtext, true) == 0) {
  129. ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.0, 0, 0, 0, 0, 0); // Female Smoking
  130. SendClientMessage(playerid, 0xFF0000FF, "You are smoking");
  131. return 1;
  132. }
  133. // Cop Look
  134. if (strcmp("/coplook", cmdtext, true) == 0) {
  135. ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 0, 0, 0, 0); // Cop Looking
  136. SendClientMessage(playerid, 0xFF0000FF, "You are looking");
  137. return 1;
  138. }
  139. // Lay Down
  140. if (strcmp("/lay", cmdtext, true, 6) == 0) {
  141. ApplyAnimation(playerid,"BEACH", "bather", 4.0, 0, 0, 0, 0, 0); // Lay down
  142. SendClientMessage(playerid, 0xFF0000FF, "You are laying down");
  143. return 1;
  144. }
  145. // Take Cover
  146. if (strcmp("/cover", cmdtext, true, 3) == 0) {
  147. ApplyAnimation(playerid, "ped", "cower", 3.0, 0, 0, 0, 0, 0); // Taking Cover
  148. SendClientMessage(playerid, 0xFF0000FF, "You are taking cover");
  149. return 1;
  150. }
  151. // Vomit
  152. if (strcmp("/vomit", cmdtext, true) == 0) {
  153. ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
  154. SendClientMessage(playerid, 0xFF0000FF, "You are puking :S");
  155. return 1;
  156. }
  157. // Eat Burger
  158. if (strcmp("/eat", cmdtext, true) == 0) {
  159. ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.00, 0, 0, 0, 0, 0); // Eat Burger
  160. SendClientMessage(playerid, 0xFF0000FF, "You are eating a burger");
  161. return 1;
  162. }
  163. // Wave
  164. if (strcmp("/wave", cmdtext, true) == 0) {
  165. ApplyAnimation(playerid, "KISSING", "BD_GF_Wave", 3.0, 0, 0, 0, 0, 0); // Wave
  166. SendClientMessage(playerid, 0xFF0000FF, "You are waving");
  167. return 1;
  168. }
  169. // Slap Ass
  170. if (strcmp("/slapass", cmdtext, true) == 0) {
  171. ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
  172. SendClientMessage(playerid, 0xFF0000FF, "You are slapping someone's ass");
  173. return 1;
  174. }
  175. // Death Crawling
  176. if (strcmp("/death", cmdtext, true) == 0) {
  177. ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 0, 0); // Dead Crawling
  178. SendClientMessage(playerid, 0xFF0000FF, "You are crawling dead");
  179. return 1;
  180. }
  181. // Dealer
  182. if (strcmp("/deal", cmdtext, true) == 0) {
  183. ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
  184. SendClientMessage(playerid, 0xFF0000FF, "You are drug dealing");
  185. return 1;
  186. }
  187. // Kiss
  188. if (strcmp("/kiss", cmdtext, true, 5) == 0) {
  189. ApplyAnimation(playerid, "KISSING", "Playa_Kiss_02", 3.0, 0, 0, 0, 0, 0); // Kiss
  190. SendClientMessage(playerid, 0xFF0000FF, "You are kissing someone");
  191. return 1;
  192. }
  193. // Crack Dieing
  194. if (strcmp("/crack", cmdtext, true, 6) == 0) {
  195. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0); // Dieing of Crack
  196. SendClientMessage(playerid, 0xFF0000FF, "You are trippin");
  197. return 1;
  198. }
  199. // Piss
  200. if (strcmp("/piss", cmdtext, true, 8) == 0) {
  201. ApplyAnimation(playerid, "PAULNMAC", "Piss_in", 3.0, 0, 0, 0, 0, 0); // Pissing
  202. SendClientMessage(playerid, 0xFF0000FF, "You are pissing");
  203. return 1;
  204. }
  205. // Male Smoking
  206. if (strcmp("/smoke", cmdtext, true, 4) == 0) {
  207. ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 0, 0, 0, 0, 0); // Smoke
  208. SendClientMessage(playerid, 0xFF0000FF, "You are smoking");
  209. return 1;
  210. }
  211. // Sit
  212. if (strcmp("/sit", cmdtext, true, 4) == 0) {
  213. ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 0, 0, 0, 0, 0); // Sit
  214. SendClientMessage(playerid, 0xFF0000FF, "You are sitting down");
  215. return 1;
  216. }
  217. // Fuck U
  218. if (strcmp("/fu", cmdtext, true, 2) == 0) {
  219. ApplyAnimation( playerid,"ped", "fucku", 4.1, 0, 1, 1, 1, 1 ); // Wave fist / Pull fingers (with block hands)
  220. SendClientMessage(playerid, 0xFF0000FF, "You are now pulling your fingers up");
  221. return 1;
  222. }
  223. // Strip-Tease
  224. if (strcmp("/strip", cmdtext, true, 6) == 0)
  225. {
  226. switch (cmdtext[7])
  227. {
  228. case 'a', 'A':{ ApplyAnimation( playerid,"STRIP", "strip_A", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  229. case 'b', 'B':{ ApplyAnimation( playerid,"STRIP", "strip_B", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  230. case 'c', 'C':{ ApplyAnimation( playerid,"STRIP", "strip_C", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  231. case 'd', 'D':{ ApplyAnimation( playerid,"STRIP", "strip_D", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  232. case 'e', 'E':{ ApplyAnimation( playerid,"STRIP", "strip_E", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  233. case 'f', 'F':{ ApplyAnimation( playerid,"STRIP", "strip_F", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  234. case 'g', 'G':{ ApplyAnimation( playerid,"STRIP", "strip_G", 4.1, 0, 1, 1, 1, 1 ); return 1; } // Strip
  235. } SendClientMessage(playerid, 0xFF0000FF, "You are now stripping you pervert");
  236. return 1;
  237. }
  238. // Idle Chat
  239. if(strcmp(cmd, "/chat", true) == 0)
  240. {
  241. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  242. {
  243. ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1,1,1,1);
  244. SendClientMessage(playerid, 0xFF0000FF, "You are now talking"); // Chat
  245. return 1;
  246. }
  247. }
  248. // SUICIDE COMMAND
  249. if(strcmp(cmd, "/kill", true) == 0) {
  250. SetPlayerHealth(playerid,0.0);
  251. return 1;
  252. }
  253.  
  254. // START DANCING
  255. if(strcmp(cmd, "/dance", true) == 0) {
  256. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
  257. new tmp[256];
  258.  
  259. // Get the dance style param
  260. tmp = strtok(cmdtext, idx);
  261. if(!strlen(tmp)) {
  262. SendClientMessage(playerid,0xFF0000FF,"Usage: /dance [style 1-3]");
  263. return 1;
  264. }
  265.  
  266. dancestyle = strval(tmp);
  267. if(dancestyle < 1 || dancestyle > 3) {
  268. SendClientMessage(playerid,0xFF0000FF,"Usage: /dance [style 1-3]");
  269. return 1;
  270. }
  271.  
  272. if(dancestyle == 1) {
  273. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1);
  274. } else if(dancestyle == 2) {
  275. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2);
  276. } else if(dancestyle == 3) {
  277. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
  278. }
  279. return 1;
  280. }
  281. }
  282. return 0;
  283. }
  284. //-------------------------------------------------
  285. // EOF
Advertisement
Add Comment
Please, Sign In to add comment