Sistemas

Páginas: 4 (817 palabras) Publicado: 20 de septiembre de 2012
Quote: |
#include <windows.h>
#include <fstream>
#include <cstdarg>
#include <string>

// Comment the line below to not use voice
#define USE_VOICE
// I hate doingthis but it makes it clear what needs to be updated
#define KILL_HACK_ADDRESS 0x004C6CB0
#define MAIN_BASE_ADDRESS 0x00B72AEC

// If USE_VOICE is defined we will speak player names
#ifdef USE_VOICE#include <sapi.h>
#endif

void __cdecl Log(const char *format, ...);

void Speak(std::wstring text)
{
// This function does nothing if USE_VOICE is not defined
#ifdef USE_VOICE
staticISpVoice *voice = NULL;
// Only initialize our voice object if it has not been initialized
// Static is okay here since we are not multi threading
if (!voice)
{
// Initialize COM
HRESULT hr =CoInitialize(NULL);
if (FAILED(hr))
{
Log("CoInitialize failed! Speech is unavailable! (0x%08X)", hr);
return;
}
// Create an instance of our voice object
hr = CoCreateInstance(CLSID_SpVoice,NULL, CLSCTX_ALL, IID_ISpVoice, (void**)&voice);
if (FAILED(hr))
{
Log("CoCreateInstance failed! Speech is unavailable! (0x%08X)", hr);
return;
}
// Set the voice of the volumevoice->SetVolume(100);
}
// Speak our text asnychronously, interrupting anything currently being spoken
voice->Speak(text.c_str(), SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL);
#endif
}

// killer = theuser index of the killer
// victim = the user index of the victim
// gun = the id of the gun that the killer will use to kill victim
// not_headshot = false if it is a headshot, true if it is not aheadshot
void KillPlayer(int killer, int victim, int gun, int not_headshot)
{
// Set up a function pointer to the kill player function
typedef void (__stdcall *lpKillPlayer)(int killer, int victim,int gun, int not_headshot);
lpKillPlayer kill_player = (lpKillPlayer)KILL_HACK_ADDRESS;
// Call the function pointer (make killer kill victim with gun and headshot)
// Just in case anything goes...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Sistemas
  • Sistemas
  • Sistema
  • Sistemas
  • Sistemas
  • Sistemas
  • Sistemas
  • El sistema

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS