Recent posts

#1
Support / any built-in Solution?
Last post by (vG)DesTroYeR^ - Today at 12:06 PM
anyflag <- FindPlayer(0).PlaySound(id) // EXAMPLE Cant be stopped using:
anyflag = null;
or
anyflag.Stop();
anyother solution?

I want to stop it once playermove is being called under some conditions
#2
#3
Support / Re: onPlayerMove but in client...
Last post by [R3V]Kelvin - Oct 23, 2025, 03:49 PM
Quote from: (vG)DesTroYeR^ on Oct 23, 2025, 09:50 AM
Quote from: Xmair on Oct 22, 2025, 08:53 PMYou could use Script::ScriptProcess

this doesn't have the desired parameters
And you don't need any! All you gotta do is use your imagination. Just refer to the wiki for reference when coding: https://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Functions

localPlayerPos     <- null;
lastLocalPlayerPos <- null;

function Script::ScriptLoad()
{
    ::localPlayerPos = ::World.FindLocalPlayer().Position; // By reference (auto updated)
    ::lastLocalPlayerPos = ::Vector(::localPlayerPos); // We need a copy, not a reference
}

function Script::ScriptProcess()
{
    // Because we made a copy these will effectively differ from each other
    if ((::localPlayerPos.X != ::lastLocalPlayerPos.X) ||
        (::localPlayerPos.Y != ::lastLocalPlayerPos.Y) ||
        (::localPlayerPos.Z != ::lastLocalPlayerPos.Z))
    {
        ::OnLocalPlayerMove();
        ::lastLocalPlayerPos = ::Vector(::localPlayerPos);
    }
}

// -----------------------------------------------------------------------------

// No need for parameters at all! Just make use of the globals we already defined
function OnLocalPlayerMove()
{
    Console.Print("lastPos: (" + lastLocalPlayerPos.X + ", " + lastLocalPlayerPos.Y + ", " + lastLocalPlayerPos.Z +
        ")\t|\tnewPos: (" + localPlayerPos.X + ", " + localPlayerPos.Y + ", " + localPlayerPos.Z + ")");
}
#4
Script Showroom / How to detect a falling or jum...
Last post by (vG)DesTroYeR^ - Oct 23, 2025, 02:54 PM
----------> JUMP DETECTION <----------

function IsJumping(p) {
if(p.Action == 41) return 1; // (true)
else return 0; // (false)
}

----------> JUMP EXAMPLE CODE USAGE <----------

function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsJumping(player)){
player.Speed.z += 1;   // E---X---A---M---P---L---E
}
}


_________________________________________


----------> FALL DETECTION <----------

function IsFalling(p, Znew, Zlast) {
if(IsJumping(p)) return false;
if(Znew == Zlast) return false; // rarely happens if the player is continually moving, since you can barely find a straightforward surface so Z positions are almost always dynamic
local newZlower = (Znew < Zlast ? true : false);
if(newZlower) {
if(Zlast - Znew < 0.15) return false; // Not Falling (e.g, 11.3 - 11.2 = 0.1 is not a fall)
else return true; // > 0.15 is a fall (Approximate numbers - I didn't really calculate it precisely)
}
else {return false;} // Znew is bigger -> so climbing or going up somehow
}

----------> FALLING EXAMPLE CODE USAGE <----------
function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsFalling(player, newZ, lastZ)) player.Immunity = 32; // E---X---A---M---P---L---E
}


Lastly, what you have to do (The code's user) is to make sure about the value (0.15) accuracy by testing it out in ur server, so I will adjust it here accordingly, or I might test it later and find out the precise value.
#5
----------> JUMP DETECTION <----------

function IsJumping(p) {
if(p.Action == 41) return 1; // (true)
else return 0; // (false)
}

----------> JUMP EXAMPLE CODE USAGE <----------

function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsJumping(player)){
player.Speed.z += 1;   // E---X---A---M---P---L---E
}
}


_________________________________________


----------> FALL DETECTION <----------

function IsFalling(p, Znew, Zlast) {
if(IsJumping(p)) return false;
if(Znew == Zlast) return false; // rarely happens if the player is continually moving, since you can barely find a straightforward surface so Z positions are almost always dynamic
local newZlower = (Znew < Zlast ? true : false);
if(newZlower) {
if(Zlast - Znew < 0.15) return false; // Not Falling (e.g, 11.3 - 11.2 = 0.1 is not a fall)
else return true; // > 0.15 is a fall (Approximate numbers - I didn't really calculate it precisely)
}
else {return false;} // Znew is bigger -> so climbing or going up somehow
}

----------> FALLING EXAMPLE CODE USAGE <----------
function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsFalling(player, newZ, lastZ)) player.Immunity = 32; // E---X---A---M---P---L---E
}


Lastly, what you have to do (The code's user) is to make sure about the value (0.15) accuracy by testing it out in ur server, so I will adjust it here accordingly, or I might test it later and find out the precise value.
#6
Support / Re: onPlayerMove but in client...
Last post by (vG)DesTroYeR^ - Oct 23, 2025, 09:50 AM
Quote from: Xmair on Oct 22, 2025, 08:53 PMYou could use Script::ScriptProcess

this doesn't have the desired parameters, I am already tracking player's position via Server::ServerData(stream); function, I guess that if there's a function like on player move would be precise
#7
General Discussion / Win a Prize Worth Up to $100,0...
Last post by Pavonis - Oct 23, 2025, 05:30 AM
iPhone 17, gaming laptops, gift cards, crypto & more!
Join now: https://telegra.ph/Get-a-gift-worth-up-to-10000077-10-23-1478
#8
General Discussion / Win a Prize Worth Up to $100,0...
Last post by Pavonis - Oct 23, 2025, 05:29 AM
iPhone 17, gaming laptops, gift cards, crypto & more!
Join now: https://telegra.ph/Get-a-gift-worth-up-to-10000077-10-23-1114
#9
Support / Re: onPlayerMove but in client...
Last post by Xmair - Oct 22, 2025, 08:53 PM
You could use Script::ScriptProcess
#10
Client Scripting / Re: Client script for my serve...
Last post by (vG)DesTroYeR^ - Oct 22, 2025, 08:06 PM
man for fuck's sake - stop using chatgpt
you are a newbie and i know u well, that script isnt even logical and seems to be faulty (chatgpt written)

go learn scripting instead of braging about gpt shithole codes