FlacoBey

Untitled

Jan 7th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include sdktools
  2.  
  3. Handle sdkOnStaggered;
  4.  
  5. public OnPluginStart()
  6. {
  7.     Handle hGameConf = LoadGameConfigFile("l4d_direct");
  8.     if( hGameConf == null )
  9.     SetFailState("342423");
  10.    
  11.     HookEvent("player_shoved", EventShove);
  12.    
  13.     StartPrepSDKCall(SDKCall_Player);
  14.     PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CTerrorPlayer::OnStaggered");
  15.     PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
  16.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  17.     sdkOnStaggered = EndPrepSDKCall();
  18. }
  19.  
  20. public Action EventShove(Event event, const char[] name, bool dontBroadcast)
  21. {
  22.     int attacker = GetClientOfUserId(event.GetInt("attacker"));
  23.     int victim = GetClientOfUserId(event.GetInt("userid"));
  24.    
  25.     new Float:attacker_origin[3];
  26.     GetEntPropVector(attacker, Prop_Data, "m_vecOrigin", attacker_origin);
  27.     SDKCall(sdkOnStaggered, victim, attacker, attacker_origin);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment