 |
|
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
|

05-04-2016
, 23:20
Re: Questions regarding server serformance (CPU)
|
#6
|
Spoiler
PHP Code:
public client_PreThink(id)
{
if(!is_user_hltv(id) && !is_user_bot(id))
{
/* ========== [ Screen Fade ] ========== */
if(g_ScreenfadeActivar[id] && g_PlayerFlashed[id] == false)
{
if(g_ScreenFadePreto[id] == true)
{
message_begin(MSG_ONE, g_msgScreenfade, {0,0,0}, id)
write_short(0) // Duracao
write_short(0) // Tempo
write_short(0x0004) // Tipo
write_byte(0) // Vermelho
write_byte(0) // Verde
write_byte(0) // Azul
write_byte(255) // Transparencia
message_end()
}
else
{
message_begin(MSG_ONE, g_msgScreenfade, {0,0,0}, id)
write_short(0) // Duracao
write_short(0) // Tempo
write_short(0x0004) // Tipo
write_byte(0) // Vermelho
write_byte(0) // Verde
write_byte(0) // Azul
write_byte(210) // Transparencia
message_end()
}
}
/* ================================ */
if(native_is_user_logged(id) && is_user_alive(id) && g_bRondaComecou == true)
{
set_pdata_int(id, HIDE_HUD, 1<<5)
set_task(0.1, "RemoveYellowCrosshair", id + TASK_REMOVE_Y_CROSSHAIR)
}
if(g_MenuContaPessoalAberto[id] == true && is_user_alive(id))
set_pdata_int(id, HIDE_HUD, 1<<5 | 1<<6) // Hide Crosshair
/* ========= [ Camera Rotativa ] ========= */
//if(g_Configuracao_5[id] == 0)
//{
new pAlive = is_user_alive(id)
if(!pAlive && g_Active[id] == false)
g_Active[id] = true
else if(pAlive)
{
if(g_Active[id] == true)
{
set_pev(id, pev_fixangle, 1) // Stop Mouse
set_pev(id, pev_oldbuttons, pev(id, pev_oldbuttons) | IN_JUMP | IN_DUCK) // Stop Jump & Duck
set_pdata_int(id, HIDE_HUD, 1<<5 | 1<<6) // Hide Crosshair
}
else if(g_Active[id] == false)
{
if(g_StopRepeat[id] == false)
{
set_pdata_int(id, HIDE_HUD, 1<<5) // Show Crosshair
set_task(0.1, "RemoveYellowCrosshair", id + TASK_REMOVE_Y_CROSSHAIR) // Remove yellow-small Crosshair
g_StopRepeat[id] = true
}
}
}
//}
/* ================================ */
}
}
This is what i have in my PreThink. Is it too much? I cant really find a way to do this things whiout PreThink.
|
|
|
|