Advertisement
Guest User

GOD

a guest
Dec 11th, 2013
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. //Defines
  5. #define GREEN 0x21DD00FF
  6. #define RED 0xE60000FF
  7. #define CO_RED 0xFF0000FF
  8.  
  9. //news
  10. new God[MAX_PLAYERS];
  11. new Text:godon;
  12. new Text:godoff;
  13. new Text3D:godtext[MAX_PLAYERS];
  14. stock Godon(playerid)
  15. {
  16. TextDrawShowForPlayer(playerid, godon);
  17. TextDrawHideForPlayer(playerid, godoff);
  18. }
  19. stock Godoff(playerid)
  20. {
  21. TextDrawShowForPlayer(playerid, godoff);
  22. TextDrawHideForPlayer(playerid, godon);
  23. }
  24.  
  25. public OnFilterScriptInit()
  26. {
  27. print("\n--------------------------------------");
  28. print(" God Textdraw Samp by commander_Limo ");
  29. print("--------------------------------------\n");
  30.  
  31. godon = TextDrawCreate(503, 123, "GodMode: ON");
  32. TextDrawBackgroundColor(godon, -1);
  33. TextDrawFont(godon, 3);
  34. TextDrawLetterSize(godon, 0.5, 3.5);
  35. TextDrawColor(godon, 0xFF2429FF);
  36. TextDrawSetOutline(godon, 1);
  37. TextDrawSetProportional(godon, 1);
  38. TextDrawSetSelectable(godon, 0);
  39.  
  40. godoff = TextDrawCreate(503, 123, "GodMode: OFF");
  41. TextDrawBackgroundColor(godoff, -1);
  42. TextDrawFont(godoff, 3);
  43. TextDrawLetterSize(godoff, 0.5, 3.5);
  44. TextDrawColor(godoff, 0xFF2429FF);
  45. TextDrawSetOutline(godoff, 1);
  46. TextDrawSetProportional(godoff, 1);
  47. TextDrawSetSelectable(godoff, 0);
  48. return 1;
  49. }
  50.  
  51. public OnFilterScriptExit()
  52. {
  53. return 1;
  54. }
  55. CMD:god(playerid, params[])
  56. {
  57. if(God[playerid] == 0)
  58. {
  59. new string[128];
  60. SetPlayerHealth(playerid, 99999999999.0);
  61. SetPlayerArmour(playerid, 99999999999.0);
  62. SendClientMessage(playerid, GREEN, "GodMode On You Will never Die!");
  63. God[playerid] = 1;
  64. Godon(playerid);
  65. format(string,sizeof(string)," %s : Enabled GodMode!",GetPlayerNameEx(playerid)); //Format string to send to players
  66. SendClientMessageToAll(RED,string); //send players string
  67. GameTextForPlayer(playerid,"~r~]GOD MODE ~g~ACTIVATED",4100,3);
  68. godtext[playerid] = Create3DTextLabel("GODMODE ENABLED",CO_RED,30.0,40.0,50.0,40.0,0);
  69. Attach3DTextLabelToPlayer(godtext[playerid], playerid, 0.0, 0.0, 0.7);
  70. }
  71. else if(God[playerid] == 1)
  72. {
  73. new string[128];
  74. SetPlayerHealth(playerid, 100.0); // set player health to infinite
  75. SetPlayerArmour(playerid, 0.0); // set player armour to infinite
  76. SendClientMessage(playerid, RED, "GodMode Off Health Restore :@!");
  77. Godoff(playerid);
  78. God[playerid] = 0;
  79. format(string,sizeof(string)," %s : Disabled GodMode!",GetPlayerNameEx(playerid)); //Format string to send to players
  80. SendClientMessageToAll(RED,string); //send players string
  81. GameTextForPlayer(playerid,"~r~]GOD MODE ~g~DEACTIVATED",4100,3);
  82. Delete3DTextLabel(Text3D:godtext[playerid]);
  83. }
  84. return 1;
  85. }
  86.  
  87. public OnPlayerConnect(playerid)
  88. {
  89. God[playerid] = 0;
  90. return 1;
  91. }
  92. public OnPlayerDisconnect(playerid, reason)
  93. {
  94. God[playerid] = 0;
  95. return 1;
  96. }
  97.  
  98. public OnPlayerDeath(playerid, killerid, reason)
  99. {
  100. God[playerid] = 0;
  101. return 1;
  102. }
  103. stock GetPlayerNameEx(playerid) //This is stock i made to make Getting players name easier
  104. {
  105. new Name[MAX_PLAYER_NAME];
  106. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  107. return Name;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement