Quote from: (vG)DesTroYeR^ on Oct 23, 2025, 09:50 AMAnd 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_FunctionsQuote from: Xmair on Oct 22, 2025, 08:53 PMYou could use Script::ScriptProcess
this doesn't have the desired parameters
Code Select
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 + ")");
}

