get_angle <- function(x, y, x2, y2){
return ::atan2(y2 - y, x2 - x);
}
get_player_angle <- function(){
local screen_size = ::GUI.GetScreenSize();
local cam_from = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, -1));
local cam_to = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, 1));
return ::get_angle(cam_from.X, cam_from.Y, cam_to.X, cam_to.Y);
}
untested, I took code from Get player Camera zoom local angle = ::get_player_angle();also maybe you will need to add some offset to result of angle to make it similar as serverside angle, to do it correctly usenormalize_angle <- function (a){
return ::atan2(::sin(a), ::cos(a));
}
::normalize_angle(angle + 1.57079);function ToLower(num) { // (Floor)
local fltdot = ".";
local numstr = num+"";
local checkflt = split(numstr, fltdot);
if(checkflt.len() > 2) return print("Wrong float value detected.");
if(checkflt.len() == 2){
local w = checkflt[0].tointeger(); \\ before the dot. like 34(.)5 - it will return 34
return w;
}
return print("Invalid input (ToLower)");
}
function ToGreater(num) { // (Ceil)
local fltdot = ".";
local numstr = num+"";
local checkflt = split(numstr, fltdot);
if(checkflt.len() > 2)return print("Invalid input - ToGreater()"); // must be 1 dot.
if(checkflt.len() <= 1)return print("Invalid input - ToGreater()"); // no integers. or (34.) so the dot in 34 is not a valid input
local floats = "0."+checkflt[1];
local integers = checkflt[0];
if (checkflt[1].tointeger() == 0) return integers.tointeger(); // if 34.0 return 34
local subTracT = floats.tofloat() - 1;
local subT = abs(subTracT); // (+)
local result = num + subT; // 34.3 + 0.7 = 35
return result;
}



Quote from: ToyDragon on Mar 20, 2025, 05:58 PMHello, I don't know much about it, but your script looks more like C + + or java, not the common Java language of vcmp, so I guess if you want to run this script, you need other plugin support, and I noticed that most of the functions are not official events of vcmp, and some of them are similar to letting the server-side script display GUI to the client? ? In my opinion, this seems to need the support of client script. If there is no support of client script, the server should not be able to display GUI directly to the client. Therefore, based on the above situation, I think this script should not run. I come from China, so my English may not be very good. Please be tolerant.