Skip to content

Instantly share code, notes, and snippets.

@StrixG
Created November 30, 2017 16:05
Show Gist options
  • Save StrixG/c4c593471602e5ae9b01abb35512a0b3 to your computer and use it in GitHub Desktop.
Save StrixG/c4c593471602e5ae9b01abb35512a0b3 to your computer and use it in GitHub Desktop.
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
'.source.lua':
# MTA:SA snippets
# Predefined variables
'exports':
'prefix': 'exports'
'body': 'exports'
'description': 'A table of resource names containing all export functions.'
'leftLabel': 'table'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'resource':
'prefix': 'resource'
'body': 'resource'
'description': 'A resource element of the resource the snippet was executed in.'
'leftLabel': 'resource'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'resourceRoot':
'prefix': 'resourceRoot'
'body': 'resourceRoot'
'description': 'A resource root element of the resource the snippet was executed in.'
'leftLabel': 'element'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'root':
'prefix': 'root'
'body': 'root'
'description': 'The root element of the client/server.'
'leftLabel': 'element'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'guiRoot':
'prefix': 'guiRoot'
'body': 'guiRoot'
'description': 'The root element of all GUI elements.'
'leftLabel': 'element'
'rightLabelHTML': '<span style="color:#ff4400">Client</span>'
'localPlayer':
'prefix': 'localPlayer'
'body': 'localPlayer'
'description': 'The player element of the local player.'
'leftLabel': 'player'
'rightLabelHTML': '<span style="color:#ff4400">Client</span>'
'source':
'prefix': 'source'
'body': 'source'
'description': 'The element that called the event.'
'leftLabel': 'element'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'this':
'prefix': 'this'
'body': 'this'
'description': 'Element, which was attached function-handler.'
'leftLabel': 'element'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'eventName':
'prefix': 'eventName'
'body': 'eventName'
'description': 'The name of the event ("onResourceStart", "onPlayerWasted" etc.)'
'leftLabel': 'string'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'client':
'prefix': 'client'
'body': 'client'
'description': 'The client that called the event.'
'leftLabel': 'player'
'rightLabelHTML': '<span style="color:#ff4400">Client</span>'
# Accounts
# Accounts OOP
# ACL
# ACL OOP
# Admin
# Admin OOP
# Audio
# Audio OOP
# Announcment
# Blips
# Blips OOP
# Browser
# Browser OOP
# Camera
# Camera OOP
# Clothes
# Collission shapes
# Collission shapes OOP
# Cursor
# Drawing
# Drawing OOP
# Effects
# Effects OOP
# Elements
# Elements OOP
# Engine
# Engine OOP
# Events
# Explosions
# Explosions OOP
# Files
'fileCreate':
'prefix': 'fileCreate'
'body': 'fileCreate(${1:string filePath})'
'description': 'Creates a new file in a directory of a resource. If there already exists a file with the specified name, it is overwritten with an empty file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileCreate'
'leftLabel': 'file'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileOpen':
'prefix': 'fileOpen'
'body': 'fileOpen(${1:string filePath}, ${2:bool readOnly = false})'
'description': 'Opens an existing file for reading and writing.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileOpen'
'leftLabel': 'file'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileClose':
'prefix': 'fileClose'
'body': 'fileClose(${1:file theFile})'
'description': 'Closes a file handle obtained by fileCreate or fileOpen.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileClose'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileDelete':
'prefix': 'fileDelete'
'body': 'fileDelete(${1:string filePath})'
'description': 'Deletes the specified file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileDelete'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileCopy':
'prefix': 'fileCopy'
'body': 'fileCopy(${1:string filePath}, ${2:string copyToFilePath}, ${3:overwrite = false})'
'description': 'This function copies a file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileCopy'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileExists':
'prefix': 'fileExists'
'body': 'fileExists(${1:string filePath})'
'description': 'This functions checks whether a specified file exists inside a resource.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/fileExists'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileFlush':
'prefix': 'fileFlush'
'body': 'fileFlush(${1:file theFile})'
'description': 'Forces pending disk writes to be executed.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileFlush'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileGetPath':
'prefix': 'fileGetPath'
'body': 'fileGetPath(${1:file theFile})'
'description': 'This function retrieves the path of the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetPath'
'leftLabel': 'string'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileGetPos':
'prefix': 'fileGetPos'
'body': 'fileGetPos(${1:file theFile})'
'description': 'Returns the current read/write position in the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetPos'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileGetSize':
'prefix': 'fileGetSize'
'body': 'fileGetSize(${1:file theFile})'
'description': 'Returns the total size in bytes of the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetSize'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileIsEOF':
'prefix': 'fileIsEOF'
'body': 'fileIsEOF(${1:file theFile})'
'description': 'Checks if the file position is at the end of the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileIsEOF'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileRead':
'prefix': 'fileRead'
'body': 'fileRead(${1:file theFile}, ${2:int count})'
'description': 'Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileRead'
'leftLabel': 'string'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileRename':
'prefix': 'fileRename'
'body': 'fileRename(${1:string filePath}, ${2:string newFilePath})'
'description': 'Renames the specified file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileRename'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileSetPos':
'prefix': 'fileSetPos'
'body': 'fileSetPos(${1:file theFile}, ${2:int offset})'
'description': 'Sets the current read/write position in the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileSetPos'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'fileWrite':
'prefix': 'fileWrite'
'body': 'fileWrite(${1:file theFile}, ${2:string string1, string string2, string string3 ...})'
'description': 'Writes one or more strings to a given file, starting at the current read/write position. Advances the position over the number of bytes that were written.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileWrite'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
# Files OOP
'File.new':
'prefix': 'File.new'
'body': 'File(${1:string filePath})'
'description': 'Creates a new file in a directory of a resource. If there already exists a file with the specified name, it is overwritten with an empty file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileCreate'
'leftLabel': 'file'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'File':
'prefix': 'File'
'body': 'File(${1:string filePath}, ${2:bool readOnly = false})'
'description': 'Opens an existing file for reading and writing.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileOpen'
'leftLabel': 'file'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:close':
'prefix': 'file:close'
'body': '${1:file}:close()'
'description': 'Closes a file handle obtained by fileCreate or fileOpen.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileClose'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'File.delete':
'prefix': 'File.delete'
'body': 'File.delete(${1:string filePath})'
'description': 'Deletes the specified file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileDelete'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'File.copy':
'prefix': 'File.copy'
'body': 'File.copy(${1:string filePath}, ${2:string copyToFilePath}, ${3:overwrite = false})'
'description': 'This function copies a file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileCopy'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'File.exists':
'prefix': 'File.exists'
'body': 'File.exists(${1:string filePath})'
'description': 'This functions checks whether a specified file exists inside a resource.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/fileExists'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:flush':
'prefix': 'file:flush'
'body': '${1:file}:flush()'
'description': 'Forces pending disk writes to be executed.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileFlush'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:getPath':
'prefix': 'file:getPath'
'body': '${1:file}:getPath()'
'description': 'This function retrieves the path of the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetPath'
'leftLabel': 'string'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:getPos':
'prefix': 'file:getPos'
'body': '${1:file}:getPos()'
'description': 'Returns the current read/write position in the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetPos'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file.pos':
'prefix': 'file.pos'
'body': '${1:file}.pos'
'description': 'Returns the current read/write position in the given file.\nSets the current read/write position in the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetPos'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:getSize':
'prefix': 'file:getSize'
'body': '${1:file}:getSize()'
'description': 'Returns the total size in bytes of the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetSize'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file.size':
'prefix': 'file.size'
'body': '${1:file}.size'
'description': 'Returns the total size in bytes of the given file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileGetSize'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:isEOF':
'prefix': 'file:isEOF'
'body': '${1:file}:isEOF()'
'description': 'Checks if the file position is at the end of the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileIsEOF'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file.eof':
'prefix': 'file.eof'
'body': '${1:file}.eof'
'description': 'Checks if the file position is at the end of the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileIsEOF'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:read':
'prefix': 'file:read'
'body': '${1:file}:read(${2:int count})'
'description': 'Reads the specified number of bytes from the given file starting at its current read/write position, and returns them as a string.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileRead'
'leftLabel': 'string'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'File.rename':
'prefix': 'File.rename'
'body': 'File.rename(${1:string filePath}, ${2:string newFilePath})'
'description': 'Renames the specified file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileRename'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:setPos':
'prefix': 'file:setPos'
'body': '${1:file}:setPos(${1:file theFile}, ${2:int offset})'
'description': 'Sets the current read/write position in the file.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileSetPos'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
'file:write':
'prefix': 'file:write'
'body': '${1:file}:write(${2:string string1, string string2, string string3 ...})'
'description': 'Writes one or more strings to a given file, starting at the current read/write position. Advances the position over the number of bytes that were written.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/FileWrite'
'leftLabel': 'int'
'rightLabelHTML': '<span style="color:#00bfff">Shared</span>'
# Fire
# Fire OOP
# GUI
# GUI OOP
# HTTP
# Input
# Lights
# Lights OOP
# Maps
# Markers
# Markers OOP
# Matrix/Vector
# Modules
# Objects
# Objects OOP
# Output
# Peds
# Peds OOP
# Pickups
# Pickup OOP
# Players
# Player OOP
# Projectiles
# Projectiles OOP
# Radar areas
# Radar areas OOP
# Resources
# Resources OOP
# Searchlights
# Searchlights OOP
# Server
# Settings
'get':
'prefix': 'get'
'body': 'get(${1:string settingName})'
'description': 'This function gets a setting\'s value, or a group of settings\' values, from the settings registry.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/Get'
'leftLabel': 'var'
'rightLabelHTML': '<span style="color:#ffbf00">Server</span>'
'set':
'prefix': 'set'
'body': 'set(${1:string settingName}, ${2:var value})'
'description': 'This function is used to save arbitrary data under a certain name on the settings registry.'
'descriptionMoreURL': 'https://wiki.multitheftauto.com/wiki/Set'
'leftLabel': 'bool'
'rightLabelHTML': '<span style="color:#ffbf00">Server</span>'
# SQL
# SQL OOP
# Teams
# Teams OOP
# Utility
# UTF8
# Vehicles
# Vehicles OOP
# Water
# Water OOP
# Weapons
# Weapons OOP
# World
# XML
# XML OOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment