HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  
  2. #include <sourcemod>
  3. #include <sdktools>
  4.  
  5. #pragma semicolon 1
  6.  
  7. // Declare offsets
  8.  
  9. new VelocityOffset_0;
  10. new VelocityOffset_1;
  11. new BaseVelocityOffset;
  12.  
  13. // Declare convar handles
  14.  
  15. new Handle:hPush;
  16. new Handle:hHeight;
  17.  
  18. public Plugin:myinfo =
  19. {
  20. name = "BunnyHop",
  21. author = "Soccerdude",
  22. description = "BunnyHoppolás",
  23. version = "1.0.1",
  24. url = "http://sourcemod.net/"
  25. };
  26.  
  27. public OnPluginStart()
  28. {
  29. PrintToServer("----------------| A BHOP Betöltve. |---------------");
  30. // Hook Events
  31. HookEvent("player_jump",PlayerJumpEvent);
  32. // Find offsets
  33. VelocityOffset_0=FindSendPropOffs("CBasePlayer","m_vecVelocity[0]");
  34. if(VelocityOffset_0==-1)
  35. SetFailState("[BunnyHop] Hiba: Nem Sikerult megtalani Velocity[0] t.");
  36. VelocityOffset_1=FindSendPropOffs("CBasePlayer","m_vecVelocity[1]");
  37. if(VelocityOffset_1==-1)
  38. SetFailState("[BunnyHop] Hiba: Nem Sikerult megtalani Velocity[1] t.");
  39. BaseVelocityOffset=FindSendPropOffs("CBasePlayer","m_vecBaseVelocity");
  40. if(BaseVelocityOffset==-1)
  41. SetFailState("[BunnyHop] Hiba: Nem Sikerult megtalani BaseVelocity-t.");
  42. // Create cvars
  43. hPush=CreateConVar("bunnyhop_push","1.0","bhop lokes");
  44. hHeight=CreateConVar("bunnyhop_height","1.0","bhop magassag");
  45. // Create config
  46. AutoExecConfig();
  47. // Public cvar
  48. CreateConVar("bunnyhop_version","1.0.1","[BunnyHop] Jelenlegi verziója a pluginnak",FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_UNLOGGED|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY);
  49. PrintToServer("----------------| A BHOP Betöltve. |---------------");
  50. }
  51.  
  52. public PlayerJumpEvent(Handle:event,const String:name[],bool:dontBroadcast)
  53. {
  54. new index=GetClientOfUserId(GetEventInt(event,"userid"));
  55. new Float:finalvec[3];
  56. finalvec[0]=GetEntDataFloat(index,VelocityOffset_0)*GetConVarFloat(hPush)/2.0;
  57. finalvec[1]=GetEntDataFloat(index,VelocityOffset_1)*GetConVarFloat(hPush)/2.0;
  58. finalvec[2]=GetConVarFloat(hHeight)*50.0;
  59. SetEntDataVector(index,BaseVelocityOffset,finalvec,true);
  60. }