Advertisement
FlacoBey

Untitled

Jun 6th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. #pragma semicolon 1
  2. #pragma newdecls required
  3.  
  4. #include <sourcemod>
  5. #include <sdktools>
  6.  
  7. Handle SDK_SetNextShoveTime;
  8.  
  9. public void OnPluginStart()
  10. {
  11.     RegAdminCmd("sm_test", sm_test, ADMFLAG_ROOT);
  12.  
  13.     Handle hGameConf = LoadGameConfigFile("CSetVic");
  14.     if( hGameConf == null )
  15.         SetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
  16.     StartPrepSDKCall(SDKCall_Entity);
  17.     if( PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CSetVic") == false )
  18.         SetFailState("Could not load the \"CTerrorPlayer::CSetVic\" gamedata signature.");
  19.     PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
  20.     SDK_SetNextShoveTime = EndPrepSDKCall();
  21.     if( SDK_SetNextShoveTime == null )
  22.         SetFailState("Could not prep the \"CTerrorPlayer::CSetVic\" function.");
  23. }
  24.  
  25. public Action sm_test(int client, int args)
  26. {
  27.     for(int i = 1; i <= 32; i++)
  28.     {
  29.         if(IsValid(i))
  30.         {
  31.             SDKCall(SDK_SetNextShoveTime);
  32.             return Plugin_Handled;
  33.         }
  34.     }
  35.     return Plugin_Handled;
  36. }
  37.  
  38. stock bool IsValid(int client)
  39. {
  40.     return client > 0 && client <= MaxClients && IsClientInGame(client) && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement