Advertisement
Guest User

Untitled

a guest
May 27th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4. #include <sdkhooks>
  5.  
  6. int g_fLastButtons[MAXPLAYERS + 1];
  7. int g_fLastFlags[MAXPLAYERS + 1];
  8. int g_iJumps[MAXPLAYERS + 1];
  9.  
  10. public Plugin:myinfo =
  11. {
  12. name = "VIP Generator",
  13. author = "mastah7991",
  14. description = "Automatycznie wygenerowany VIP",
  15. version = "1.0",
  16. url = "MYGO.PL"
  17. }
  18.  
  19. public OnPluginStart()
  20. {
  21. HookEvent("player_spawn", Event_PlayerSpawn);
  22. }
  23.  
  24. public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  25. {
  26. int client = GetClientOfUserId(GetEventInt(event, "attacker"));
  27. if (IsValidPlayer(client) && GetUserFlagBits(client) & (1 << ADMFLAG_CUSTOM2))
  28. {
  29. GivePlayerItem(client, "weapon_flashbang");
  30. GivePlayerItem(client, "weapon_molotov");
  31. SetEntProp(i, Prop_Send, "m_ArmorValue", 100);
  32. SetEntProp(i, Prop_Send, "m_bHasHelmet", 1);
  33. GivePlayerItem(client, "weapon_hegrenade");
  34. GivePlayerItem(client, "weapon_flashbang");
  35. SetEntityHealth(client, GetEntProp(client, Prop_Send, "m_iHealth") + 150);
  36. GivePlayerItem(client, "weapon_deagle");
  37. }
  38. }
  39. public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
  40. {
  41. if (IsValidPlayer(client) && GetUserFlagBits(client) & (1 << ADMFLAG_CUSTOM2))
  42. {
  43. int fCurFlags = GetEntityFlags(client);
  44. int fCurButtons = GetClientButtons(client);
  45.  
  46. if (g_fLastFlags[client] & FL_ONGROUND)
  47. {
  48. if (!(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
  49. {
  50. g_iJumps[client]++;
  51. }
  52. }
  53. else if (fCurFlags & FL_ONGROUND)
  54. {
  55. g_iJumps[client] = 0;
  56. }
  57. else if (!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
  58. {
  59. if (1 <= g_iJumps[client] <= 2)
  60. {
  61. g_iJumps[client]++;
  62. float vVel[3];
  63. GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);
  64.  
  65. vVel[2] = 250.0;
  66. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);
  67. }
  68. }
  69.  
  70. g_fLastFlags[client] = fCurFlags;
  71. g_fLastButtons[client] = fCurButtons;
  72. }
  73.  
  74. }
  75.  
  76. stock bool IsValidPlayer(client)
  77. {
  78. if (client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client))
  79. return true;
  80.  
  81. return false;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement