mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-01 06:56:16 +00:00
@@ -1976,6 +1976,14 @@ SCSS:
|
|||||||
extensions:
|
extensions:
|
||||||
- .scss
|
- .scss
|
||||||
|
|
||||||
|
SQF:
|
||||||
|
type: programming
|
||||||
|
color: "#FFCB1F"
|
||||||
|
lexer: C++
|
||||||
|
extensions:
|
||||||
|
- .sqf
|
||||||
|
- .hqf
|
||||||
|
|
||||||
SQL:
|
SQL:
|
||||||
type: data
|
type: data
|
||||||
ace_mode: sql
|
ace_mode: sql
|
||||||
|
|||||||
@@ -556,6 +556,10 @@
|
|||||||
"SCSS": [
|
"SCSS": [
|
||||||
".scss"
|
".scss"
|
||||||
],
|
],
|
||||||
|
"SQF": [
|
||||||
|
".sqf",
|
||||||
|
".hqf"
|
||||||
|
],
|
||||||
"SQL": [
|
"SQL": [
|
||||||
".prc",
|
".prc",
|
||||||
".sql",
|
".sql",
|
||||||
|
|||||||
68
samples/SQF/fn_remoteExecFnc.sqf
Normal file
68
samples/SQF/fn_remoteExecFnc.sqf
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
*
|
||||||
|
* Execute a function on a remote machine in mp.
|
||||||
|
*
|
||||||
|
* Argument:
|
||||||
|
* 0: Function arguments (Array)
|
||||||
|
* 1: Function to execute, has to be defined on the remote machine first (String)
|
||||||
|
* 2: The function will be executed where this unit is local OR the mode were this function should be executed. (Object OR Number, optional default: 2)
|
||||||
|
* Mode 0: execute on this machine only
|
||||||
|
* Mode 1: execute on server
|
||||||
|
* Mode 2: execute on all clients + server
|
||||||
|
* Mode 3: execute on dedicated only
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* Nothing
|
||||||
|
*/
|
||||||
|
|
||||||
|
private ["_arguments", "_function", "_unit", "_id"];
|
||||||
|
|
||||||
|
AGM_Core_remoteFnc = _this;
|
||||||
|
|
||||||
|
_arguments = _this select 0;
|
||||||
|
_function = call compile (_this select 1);
|
||||||
|
_unit = _this select 2;
|
||||||
|
|
||||||
|
if (isNil "_unit") then {
|
||||||
|
_unit = 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (typeName _unit == "SCALAR") exitWith {
|
||||||
|
switch (_unit) do {
|
||||||
|
case 0 : {
|
||||||
|
_arguments call _function;
|
||||||
|
};
|
||||||
|
case 1 : {
|
||||||
|
if (isServer) then {
|
||||||
|
_arguments call _function;
|
||||||
|
} else {
|
||||||
|
publicVariableServer "AGM_Core_remoteFnc";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case 2 : {
|
||||||
|
_arguments call _function;
|
||||||
|
|
||||||
|
AGM_Core_remoteFnc set [2, 0];
|
||||||
|
publicVariable "AGM_Core_remoteFnc";
|
||||||
|
};
|
||||||
|
case 3 : {
|
||||||
|
if (isDedicated) then {
|
||||||
|
_arguments call _function;
|
||||||
|
} else {
|
||||||
|
if (!isServer) then {publicVariableServer "AGM_Core_remoteFnc"};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (local _unit) then {
|
||||||
|
_arguments call _function;
|
||||||
|
} else {
|
||||||
|
if (isServer) then {
|
||||||
|
_id = owner _unit;
|
||||||
|
_id publicVariableClient "AGM_Core_remoteFnc";
|
||||||
|
} else {
|
||||||
|
publicVariableServer "AGM_Core_remoteFnc";
|
||||||
|
};
|
||||||
|
};
|
||||||
19
samples/SQF/macros.hqf
Normal file
19
samples/SQF/macros.hqf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#include <version.hqf>
|
||||||
|
|
||||||
|
#define SET(VAR,VALUE) private #VAR; VAR = VALUE;
|
||||||
|
#define CONV(VAR,ARRAY,POOL) VAR = ARRAY select (POOL find VAR);
|
||||||
|
|
||||||
|
#define ALL_HITPOINTS_MAN [ \
|
||||||
|
"HitHead", "HitBody", \
|
||||||
|
"HitLeftArm", "HitRightArm", \
|
||||||
|
"HitLeftLeg","HitRightLeg" \
|
||||||
|
]
|
||||||
|
|
||||||
|
#define ALL_HITPOINTS_VEH [ \
|
||||||
|
"HitBody", "HitHull", "HitEngine", "HitFuel", \
|
||||||
|
"HitTurret", "HitGun", \
|
||||||
|
"HitLTrack", "HitRTrack", \
|
||||||
|
"HitLFWheel", "HitRFWheel", "HitLF2Wheel", "HitRF2Wheel", "HitLMWheel", "HitRMWheel", "HitLBWheel", "HitRBWheel", \
|
||||||
|
"HitAvionics", "HitHRotor", "HitVRotor", \
|
||||||
|
"HitRGlass", "HitLGlass", "HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6" \
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user