Эксперт
-
Автор темы
- #1
пиздец апи говно я ебал
JavaScript:
/*
author: Mikhailkrylow,
stay Home, stay YouGame.biz, netvoine
*/
// api shit
// api pisal sin govna
// mb govnokod mne poxui
var colors = {
head: [0,0,255,255],
body: [255,255,255,255],
}
// api isue tak chto vot default color^^^
// pizdec blyad [x,y,z]
// x = blue,y = green,z = red kakogo xua
var hits = []
function lerp(a, b, c) {
return a+(b-a)*c
}
function print(arg) {
//prikol api ukazano cheat.log_custom a ono undefined
cheat.log(arg.toString());
}
function on_damage() {
var attacker = entity.get_player_for_user_id(current_event.get_int('attacker'));
var attacked = entity.get_player_for_user_id(current_event.get_int('userid'));
var damage = current_event.get_int('dmg_health');
var hitgroup = current_event.get_int('hitgroup');
var color = colors.body
if(hitgroup == 1) color = colors.head;
if (attacker == entity.get_local_player() && attacker != attacked) {
for (var i = 0; i < hits.length; i++) {
if(hits[i].ent == attacked){
hits[i].damage += damage
hits[i].alpha = 25550
hits[i].color = color
hits[i].offset = 0
return;
}
}
var pos = entity.get_origin(attacked) // a hui a ne get_hitbox_pos
pos[2] += 64
hits.push(
{
ent: attacked,
position: pos,
alpha: 25550,
damage: damage,
color: color,
offset: 0
}
);
}
}
register_callback('player_hurt', on_damage)
function on_render() {
for (var i = 0; i < hits.length; i++) {
hits[i].alpha = Math.floor(lerp(hits[i].alpha,0,2*global_vars.frametime()))
var position = render.world_to_screen(hits[i].position)
hits[i].color[3] = Math.min(255,hits[i].alpha)
hits[i].offset += 50*global_vars.frametime()
if(hits[i].alpha > 0){
render.text(
[
position[0]+1,
position[1]+1-hits[i].offset,
],
[0,0,0,Math.min(255,hits[i].alpha)],
10,
0,
'-' + hits[i].damage
)
render.text(
[
position[0],
position[1]-hits[i].offset,
],
hits[i].color,
10,
0,
'-' + hits[i].damage
)
}else{
hits.shift()
}
}
}
register_callback('render', on_render)
Пожалуйста, авторизуйтесь для просмотра ссылки.
Пожалуйста, авторизуйтесь для просмотра ссылки.