Advertisement
demellion

Remote Execution example (Arma 3)

Sep 7th, 2023
1,798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 0.81 KB | None | 0 0
  1. // Some client function (before cleanup)
  2. [getPlayerUID player,profileName,CASH,_bank,player] remoteExecCall ["DB_fnc_insertRequest",RSERV];
  3.  
  4. // Some client function (after cleanup)
  5. 0 remoteExecCall ["DB_fnc_insertRequest",2];
  6.  
  7. // Function on the server
  8. DB_fnc_insertRequest = {
  9.     // Ignore headless clients
  10.     if (remoteExecutedOwner isEqualTo 0) exitWith {}; // headless client
  11.  
  12.     // Let server determine source of call by itself, not by arbitrary data.
  13.     private _players = allPlayers select {(owner _x) isEqualTo remoteExecutedOwner};
  14.     if (_players isEqualTo []) exitWith {};
  15.     private _player = _players select 0;
  16.     private _uid = getPlayerUID _player;
  17.     private _name = _player getVariable['realname','none'];
  18.    
  19.     // ... whatever your code is supposed to do here, no client data input involved at any point.
  20. };
  21.  
Tags: Arma3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement