Advertisement
Guest User

GodmodeV5

a guest
Oct 19th, 2013
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. #include <a_samp>
  2. // Advanced God-mode by Evan Abagail!
  3. // Version 4
  4.  
  5. #include <zcmd>
  6. #include sscanf
  7.  
  8. new IsInGod[MAX_PLAYERS];
  9. new IsInCarGod[MAX_PLAYERS];
  10.  
  11. CMD:god(playerid, params[])
  12. {
  13. if(IsPlayerAdmin(playerid))
  14. {
  15. if(IsInGod[playerid] == 0)
  16. {
  17. IsInGod[playerid] = 1;
  18. SetPlayerHealth(playerid, 99999);
  19. SendClientMessage(playerid, 0xFFFFFFFF, "Godmode activated.");
  20. }
  21. else if(IsInGod[playerid] == 1)
  22. {
  23. IsInGod[playerid] = 0;
  24. SetPlayerHealth(playerid, 100);
  25. SendClientMessage(playerid, 0xFFFFFFFF, "Godmode de-activated.");
  26. }
  27.  
  28. }
  29. else SendClientMessage(playerid, 0xFFFFFFFF, "You are not authorized to use this command.");
  30. return 1;
  31. }
  32.  
  33. CMD:givegod(playerid, params[])
  34. {
  35. if(IsPlayerAdmin(playerid))
  36. {
  37.  
  38. new string[128], giveplayerid, statcode, amount;
  39. if(sscanf(params, "u", giveplayerid))
  40. {
  41. SendClientMessage(playerid, 0xFFFFFFFF, "You must enter a PLAYERID!");
  42. return 1;
  43. }
  44.  
  45. if(IsPlayerConnected(giveplayerid))
  46. {
  47. if(IsInGod[playerid] == 0)
  48. {
  49.  
  50. SendClientMessage(playerid, 0xFFFFFFFF, "You have given the indicated player god-mode!");
  51. SendClientMessage(giveplayerid, 0xFFFFFFFF, "An Administrator has given you god-mode!");
  52. IsInGod[playerid] = 1;
  53. SetPlayerHealth(giveplayerid, 100000);
  54. SetPlayerArmour(giveplayerid, 100000);
  55. new string[128];
  56. }
  57. else if(IsInGod[playerid] == 1)
  58. {
  59. SendClientMessage(playerid, 0xFFFFFFFF, "You have turned off the indicated players god-mode.");
  60. SendClientMessage(giveplayerid, 0xFFFFFFFF, "An Administrator has removed your god-mode!");
  61. IsInGod[playerid] = 0;
  62. SetPlayerHealth(giveplayerid, 100);
  63. SetPlayerArmour(giveplayerid, 100);
  64. }
  65. }
  66. }
  67. return 1;
  68. }
  69.  
  70. CMD:cargod(playerid, params[])
  71. {
  72. if(IsPlayerAdmin(playerid))
  73. {
  74. if(IsInCarGod[playerid] == 0)
  75. {
  76. IsInCarGod[playerid] = 1;
  77. new vehicle;
  78. vehicle = GetPlayerVehicleID(playerid);
  79. {
  80. SetVehicleHealth(vehicle, 99999999);
  81. }
  82. SendClientMessage(playerid, 0xFFFFFFFF, "Car Godmode activated.");
  83. }
  84. else if(IsInCarGod[playerid] == 1)
  85. {
  86. IsInCarGod[playerid] = 0;
  87. SetPlayerHealth(playerid, 100);
  88. SendClientMessage(playerid, 0xFFFFFFFF, "Car Godmode de-activated.");
  89. }
  90.  
  91. }
  92. else SendClientMessage(playerid, 0xFFFFFFFF, "You are not authorized to use this command.");
  93. return 1;
  94. }
  95.  
  96. public OnPlayerUpdate(playerid)
  97. {
  98. if(IsInGod[playerid] == 1) SetPlayerHealth(playerid, 99999);
  99. else if(IsInCarGod[playerid] == 1) CarGod(playerid);
  100. return 1;
  101. }
  102.  
  103. public CarGod(playerid)
  104. {
  105. IsInCarGod[playerid] = 1;
  106. new vehicle;
  107. vehicle = GetPlayerVehicleID(playerid);
  108. {
  109. SetVehicleHealth(vehicle, 99999999);
  110. }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement