Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. /*
  2. Connect to the sql with the ini
  3. - Panda
  4.  
  5. */
  6.  
  7. #include "script_macros.hpp"
  8.  
  9. if (isNil {uiNamespace getVariable "life_sql_id"}) then
  10. {
  11. _result = "extDB3" callExtension "9:VERSION";
  12.  
  13. diag_log format ["extDB3: Version: %1", _result];
  14. if(_result == "") exitWith {systemChat "extDB3: Failed to Load"; false};
  15.  
  16. _result = call compile ("extDB3" callExtension format["9:ADD_DATABASE:AltisLife"]);
  17. if (_result select 0 isEqualTo 0) exitWith {systemChat format ["extDB3: Error Database: %1", _result]; false};
  18. systemChat "extDB3: Connected to Database";
  19.  
  20. life_sql_id = round(random(9999));
  21. CONSTVAR(life_sql_id);
  22.  
  23. _result = call compile ("extDB3" callExtension format["9:ADD_DATABASE_PROTOCOL:AltisLife:SQL_CUSTOM:%1:altis-life-custom.ini",(call life_sql_id)]);
  24. if ((_result select 0) isEqualTo 0) exitWith {systemChat format ["extDB3: Error Database Setup: %1", _result]; false};
  25.  
  26. systemChat format ["extDB3: Initalized Protocol"];
  27.  
  28. "extDB3" callExtension "9:LOCK";
  29. systemChat "extDB3: Locked";
  30. uiNamespace setVariable ["life_sql_id",life_sql_id];
  31. }
  32. else
  33. {
  34. life_sql_id = uiNamespace getVariable "life_sql_id";
  35. CONSTVAR(life_sql_id);
  36. diag_log "extDB2: Still Connected to Database";
  37. };
  38.  
  39. _query = format["playerInsert:%1:%2:%3:%4:%5:%6:%7:%8:9:%10:%11",60,"Yo",78,34,[],[],[],[],[],[],[]];
  40. [_query,1] call compile preprocessFileLineNumbers "\life_server\asyncCall.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement