life is cheap, death is free!
-
Автор темы
- #1
JavaScript:
screen_size = Global.GetScreenSize()
UI.AddSliderInt("X paimon", 0, screen_size[0])
UI.AddSliderInt("Y paimon", 0, screen_size[1])
UI.AddSliderInt("Paimon width", 0, 500)
UI.AddSliderInt("Paimon height", 0, 500)
draw = {
prefix: "paimon",
suffix: ".png",
foldername: "Paimon",
our_gif: [],
delay: 0.015,
frame_count: 52,
current_frame: 0,
prev_time: 0,
time: 0,
played: false
}
dir = "ot/scripts/" + "Paimon" + "/";
texture_object = {}
function AddTexture(path)
{
if (texture_object[path] == undefined)
{
texture_object[path] = Render.AddTexture(path);
return texture_object[path];
}
else
return texture_object[path];
}
current_frame = 0;
prev_time = 0;
time = 0;
function dodraw(){
for (i = 0; i <= draw.frame_count; i++)
{
draw.our_gif.push(AddTexture(dir + draw.prefix + i.toString() + draw.suffix));
}
FSN_START(draw)
}
function FSN_START(prefix) {
x = UI.GetValue("Script items", "X paimon")
y = UI.GetValue("Script items", "Y paimon")
w = UI.GetValue("Script items", "Paimon width")
h = UI.GetValue("Script items", "Paimon height")
if (!Entity.IsValid(Entity.GetLocalPlayer())) {
prefix.current_frame = 0;
prefix.time = 0;
prefix.prev_time = 0;
return;
}
prefix.time = Globals.Realtime();
if (prefix.time >= prefix.prev_time + prefix.delay) {
prefix.current_frame++;
prefix.prev_time = prefix.time;
}
if (prefix.current_frame > prefix.frame_count) {
prefix.current_frame = 0;
}
Render.TexturedRect(x, y, w, h, prefix.our_gif[prefix.current_frame]);
}
Cheat.RegisterCallback("Draw", "dodraw");
Пожалуйста, авторизуйтесь для просмотра ссылки.
Последнее редактирование: