Counter-Strike » Статьи для Counter-Strike 1.6 » Зомби не может атаковать во время заморозки ZP 4.3

Зомби не может атаковать во время заморозки ZP 4.3

30 июн

 

Как сделать чтобы зомби не мог атаковать во время заморозке?

 

 Ищем в зп:

// CS Player PData Offsets (win32)
const PDATA_SAFE = 2
const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
const OFFSET_CSTEAMS = 114
const OFFSET_CSMONEY = 115
const OFFSET_CSMENUCODE = 205
const OFFSET_FLASHLIGHT_BATTERY = 244
const OFFSET_CSDEATHS = 444
const OFFSET_MODELINDEX = 491 // Orangutanz


Вставляем оффсет

const OFFSET_NEXTATTACK = 83


Получется:

// CS Player PData Offsets (win32)
const PDATA_SAFE = 2
const OFFSET_PAINSHOCK = 108 // ConnorMcLeod
const OFFSET_CSTEAMS = 114
const OFFSET_CSMONEY = 115
const OFFSET_CSMENUCODE = 205
const OFFSET_FLASHLIGHT_BATTERY = 244
const OFFSET_CSDEATHS = 444
const OFFSET_MODELINDEX = 491 // Orangutanz
const OFFSET_NEXTATTACK = 83


------------------------------------------------------------
Ищем:

// Save player's old gravity and maxspeed (bugfix)
pev(victim, pev_gravity, g_frozen_gravity[victim])
pev(victim, pev_maxspeed, g_frozen_maxspeed[victim])

// Prevent from jumping
if (pev(victim, pev_flags) & FL_ONGROUND)
set_pev(victim, pev_gravity, 999999.9) // set really high
else
set_pev(victim, pev_gravity, 0.000001) // no gravity

// Prevent from moving
set_pev(victim, pev_maxspeed, 1.0)

// Set a task to remove the freeze
g_frozen[victim] = true;
set_task(get_pcvar_float(cvar_freezeduration), "remove_freeze", victim)


Добавляем

set_pdata_float(id, OFFSET_NEXTATTACK, get_pcvar_float(cvar_freezeduration), OFFSET_LINUX)


Получается:

// Save player's old gravity and maxspeed (bugfix)
pev(victim, pev_gravity, g_frozen_gravity[victim])
pev(victim, pev_maxspeed, g_frozen_maxspeed[victim])

// Prevent from jumping
if (pev(victim, pev_flags) & FL_ONGROUND)
set_pev(victim, pev_gravity, 999999.9) // set really high
else
set_pev(victim, pev_gravity, 0.000001) // no gravity

// Prevent from moving
set_pev(victim, pev_maxspeed, 1.0)
set_pdata_float(victim, OFFSET_NEXTATTACK, get_pcvar_float(cvar_freezeduration), OFFSET_LINUX)
// Set a task to remove the freeze
g_frozen[victim] = true;
set_task(get_pcvar_float(cvar_freezeduration), "remove_freeze", victim)


Template not found: /templates/cs/addcomments.tpl