FlacoBey

Untitled

May 22nd, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include sdkhooks
  4.  
  5. #pragma tabsize 0
  6.  
  7. Handle sdkCallPushPlayer;
  8.  
  9. public OnPluginStart()
  10. {
  11.     Handle GameConf = LoadGameConfigFile("MolotovGame");  
  12.            
  13.     if(GameConf == INVALID_HANDLE)
  14.     {
  15.         SetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
  16.     }
  17.        
  18.     StartPrepSDKCall(SDKCall_Static);
  19.     PrepSDKCall_SetFromConf(GameConf, SDKConf_Signature, "SpawnTank");
  20.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  21.     PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
  22.     sdkCallPushPlayer = EndPrepSDKCall();
  23.    
  24.     RegConsoleCmd("sm_tank", iTank)
  25. }
  26.  
  27. public Action iTank(client, args)
  28. {
  29.     if(!IsValidClient(client)) return;
  30.     float pos[3];
  31.     GetEntPropVector(client, PropType:0, "m_vecOrigin", pos, 0);
  32.     int tank = SDKCall(sdkCallPushPlayer, pos, pos)
  33.     DispatchSpawn(tank);
  34.     TeleportEntity(tank, pos, NULL_VECTOR, NULL_VECTOR)
  35. }
  36.  
  37. stock bool:IsValidClient( client )
  38. {
  39.     if ( client < 1 || client > MaxClients ) return false;
  40.     if ( !IsClientConnected( client )) return false;
  41.     if ( !IsClientInGame( client )) return false;
  42.     if ( GetClientTeam( client ) != 2 ) return false;
  43.     return true;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment