Hello dear friends
Need help to combine two scripts in one "nvweapon.lua":
"weapon.lua" with this "fpinv.lua"
function fpinv_init(e)
end
function fpinv_main(e)
-- ------Firing Control
if (fpi_state(e, 0)) then
fpi_dimvar(e, "weapzoom");
fpi_dimvar(e, "breath");
fpi_etimerstart(e, false);
end
if (fpi_state(e, 0) and fpi_isrightweap(e, false) and fpi_haveweapleft(e, 0) and fpi_mouseclick(e, 1) and fpi_reloading(e, 0)) then
fpi_fireweapon(e, false);
end
if (fpi_state(e, 0) and fpi_isrightweap(e, false) and fpi_haveweapleft(e, 1) and fpi_mouseclick(e, 2) and fpi_reloading(e, 0)) then
fpi_fireweapon(e, false);
end
if (fpi_state(e, 0) and fpi_isrightweap(e, false) and fpi_haveweapleft(e, 1) and fpi_mouseclick(e, 3) and fpi_reloading(e, 0)) then
fpi_fireweapon(e, false);
end
if (fpi_state(e, 0) and fpi_isleftweap(e, false) and fpi_mouseclick(e, 1) and fpi_reloading(e, 0)) then
fpi_fireweapon(e, false);
end
if (fpi_state(e, 0) and fpi_isleftweap(e, false) and fpi_mouseclick(e, 3) and fpi_reloading(e, 0)) then
fpi_fireweapon(e, false);
end
-- ------Reload Control
if (fpi_state(e, 1) and fpi_reloading(e, 0)) then
fpi_enterzoom(e, false);
fpi_set_state(e, 0);
end
if (fpi_state(e, 0) and fpi_plrusingreload(e, 1) and fpi_zoomed(e, 0)) then
fpi_reloadplrweap(e, false);
end
if (fpi_state(e, 0) and fpi_plrusingreload(e, 1) and fpi_zoomed(e, 1)) then
fpi_reloadplrweap(e, false);
fpi_leavezoom(e, false);
fpi_set_state(e, 1);
end
if (fpi_state(e, 0) and fpi_reloading(e, 1) and fpi_zoomed(e, 1)) then
fpi_leavezoom(e, false);
fpi_set_state(e, 1);
end
-- ------Zoom Control
if (fpi_state(e, 0) and fpi_mouseclick(e, 2) and fpi_zoomed(e, 0)) then
fpi_enterzoom(e, false);
end
if (fpi_state(e, 0) and fpi_mouseclick(e, 2) and fpi_zoomed(e, 1)) then
fpi_leavezoom(e, false);
end
if (fpi_zoomed(e, 1)) then
fpi_setvar(e, "nv 1");
fpi_setvar(e, "thermal 0");
fpi_setvar(e, "weapzoom 1");
end
if (fpi_zoomed(e, 0)) then
fpi_setvar(e, "nv 0");
fpi_setvar(e, "weapzoom 0");
end
if (fpi_zoomed(e, 1) and fpi_keypressed(e, "20 1") and fpi_vargreater(e, "breath 0")) then
fpi_plrwobble(e, 0);
fpi_subvar(e, "breath 0.5");
end
if (fpi_zoomed(e, 1) and fpi_varequal(e, "breathing 0")) then
fpi_plrwobble(e, 20);
end
if (fpi_zoomed(e, 1) and fpi_keypressed(e, "20 0")) then
fpi_setvar(e, "breathing 0");
fpi_addvar(e, "breath 1");
end
if (fpi_zoomed(e, 1) and fpi_keypressed(e, "20 1") and fpi_vargreater(e, "breath 0") and fpi_etimergreater(e, 1850)) then
fpi_sound(e, "audiobank\music\heartbeat2.wav");
end
-- End of Script
end
I've try to use the command
"Include ("fpinv.lua") - Use within the init function to ensure the script is pre loaded"
OR the
"SwitchScript ( e,"fpinv" ) - Switch AI to use a different script"
on the "weapon.lua" but not work...
Maybe the script "fpinv.lua" is not correct ?
Any help will be appreciate, thanks in advance
Smile today, tomorrow could be worse
http://bestradiolarry.ro/fpsarea
"The best forum, game software, operating system or web platform, it's that software which can give you most of the options and speed, not just amazing graphics."