{"hash":"0xF05DFAF1ADFEF2CD","ns":"VEHICLE","name":"_IS_POSITION_VALID_FOR_TRAIN","slug":"_IS_POSITION_VALID_FOR_TRAIN","official":false,"named":true,"luaName":"IsPositionValidForTrain","game":"rdr3","apiset":"client","returnType":"BOOL","params":[{"name":"trainConfig","type":"Hash"},{"name":"x","type":"float"},{"name":"y","type":"float"},{"name":"z","type":"float"},{"name":"direction","type":"BOOL"},{"name":"p5","type":"BOOL"}],"summary":"Returns whether the specified train config can be spawned at the given coordinates.","descriptions":[{"source":"alloc8or","format":"text","body":"Returns whether the specified train config can be spawned at the given coordinates.\nThe engine snaps the coordinates to the nearest track and checks the requested direction, matching the direction parameter used by CREATE_MISSION_TRAIN."},{"source":"vorp","format":"text","body":"Return true if the specified train can be spawned at the location (automatically snap to the nearest track from coords) with the direction."}],"examples":[],"aliases":["_IS_SPAWN_POSITION_VALID_FOR_TRAIN"],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":2,"url":"https://natives.borderlinerp.com/natives/VEHICLE/_IS_POSITION_VALID_FOR_TRAIN","markdownUrl":"https://natives.borderlinerp.com/natives/VEHICLE/_IS_POSITION_VALID_FOR_TRAIN.md","snippets":{"lua":"local retval = IsPositionValidForTrain(trainConfig, x, y, z, direction, p5)","luaInvoke":"local retval = Citizen.InvokeNative(0xF05DFAF1ADFEF2CD, trainConfig, x, y, z, direction, p5, Citizen.ReturnResultAnyway())","js":"const retval = IsPositionValidForTrain(trainConfig, x, y, z, direction, p5);","jsInvoke":"const retval = Citizen.invokeNative('0xF05DFAF1ADFEF2CD', trainConfig, x + 0.0000001, y + 0.0000001, z + 0.0000001, direction, p5, Citizen.returnResultAnyway());","csharp":"bool retval = Function.Call<bool>((Hash)0xF05DFAF1ADFEF2CD, trainConfig, x, y, z, direction, p5);","notes":["Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat(\"name\")` or a backtick literal like `` `name` ``.","Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.","The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works."]}}