Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI\y_commands>
  3. #include <YSI\y_master>
  4.  
  5. strtok(const string[], &index)
  6. {
  7. new length = strlen(string);
  8. while ((index < length) && (string[index] <= ' '))
  9. {
  10. index++;
  11. }
  12.  
  13. new offset = index;
  14. new result[20];
  15. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  16. {
  17. result[index - offset] = string[index];
  18. index++;
  19. }
  20. result[index - offset] = EOS;
  21. return result;
  22. }
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. AddStaticVehicle(579, 2043.7872, 1343.8685, 10.6719, 285.0782, 0, 1);
  27. ycmd("rigbomb");
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32. return 1;
  33. }
  34.  
  35. forward ycmd_rigbomb(playerid, params[]);
  36.  
  37.  
  38. YCMD:rigbomb(playerid, params[])
  39. {
  40. new string1[30], string2[30], idx;
  41. format(string1, 30, strtok(params, idx));
  42. format(string2, 30, strtok(params, idx));
  43.  
  44. if(strcmp(params, "help", true) == 0)
  45. {
  46. SendClientMessage(playerid, 0xFFFFFFFF, "|------------------BOMB USAGE------------------|");
  47. SendClientMessage(playerid, 0xFFFFFFFF, " Timer bomb: /rigbomb timer [seconds]");
  48. SendClientMessage(playerid, 0xFFFFFFFF, " Remote bomb: /rigbomb remote [plant/detonate]");
  49. SendClientMessage(playerid, 0xFFFFFFFF, " Speed bomb: /rigbomb speed [speed threshold]");
  50. SendClientMessage(playerid, 0xFFFFFFFF, " SMS bomb: /rigbomb SMS [plant/detonate]");
  51. SendClientMessage(playerid, 0xFFFFFFFF, " Chemical bomb: /rigbomb chemical [plant/detonate]");
  52. SendClientMessage(playerid, 0xFFFFFFFF, "|----------------------------------------------|");
  53. }
  54.  
  55. if(!IsPlayerInAnyVehicle(playerid))
  56. {
  57. SendClientMessage(playerid, 0xFF0000AA,"You need to be inside a vehicle to use this command.");
  58. return 1;
  59. }
  60.  
  61. if(strcmp(params, "timer", true) == 0)
  62. {
  63. SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Timer");
  64. return 1;
  65. }
  66.  
  67. if(strcmp(params, "remote", true) == 0)
  68. {
  69. SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Remote");
  70. if(strcmp(string2, "plant", true, 5) == 0)
  71. {
  72. SendClientMessage(playerid, 0xFF0000AA,"String confirmation: Plant");
  73. return 1;
  74. }
  75.  
  76. if(strcmp(string2, "detonate", true, 8) == 0)
  77. {
  78. SendClientMessage(playerid, 0xFF0000AA,"String confirmation: Detonate");
  79. return 1;
  80. }
  81. return 1;
  82. }
  83.  
  84. if(strcmp(params, "SMS", true) == 0)
  85. {
  86. SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: SMS");
  87. return 1;
  88. }
  89.  
  90. if(strcmp(params, "chemical", true) == 0)
  91. {
  92. SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Chemical");
  93. return 1;
  94. }
  95.  
  96.  
  97. return 1;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement