Help with Database queries from a script

Merg

Well-Known Member
So this is all i have at the moment. It looks like this could work but does anybody know if i forgot something?
Code:
private["_playerUID","_key","_result","_primary","_data"];

//This should be very obvious
_playerUID = getPlayerUID player;

//Database query (Client Side)
waitUntil{!hiveInUse};
hiveInUse =  true;
_key = fromat["CHILD:999:SELECT * FROM donators WHERE donor = ?:[%1]:",_playerUID];
_data = "HiveEXT" callExtension _key;
hiveInUse =  false;

//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;


    //Checking results
    if(_result = 0) exitWith {};
       
    if(_result > 1) then {   
        player addaction[("<t color=""FC0000"">" + ("Donator Menu") +"</t>"),"donatormenu.sqf","",5,false,true,"", ""];
   
    };

Also im running this client side, so not sure if its gonna work...
 
So this is all i have at the moment. It looks like this could work but does anybody know if i forgot something?
Code:
private["_playerUID","_key","_result","_primary","_data"];

//This should be very obvious
_playerUID = getPlayerUID player;

//Database query (Client Side)
waitUntil{!hiveInUse};
hiveInUse =  true;
_key = fromat["CHILD:999:SELECT * FROM donators WHERE donor = ?:[%1]:",_playerUID];
_data = "HiveEXT" callExtension _key;
hiveInUse =  false;

//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;


    //Checking results
    if(_result = 0) exitWith {};
     
    if(_result > 1) then { 
        player addaction[("<t color=""FC0000"">" + ("Donator Menu") +"</t>"),"donatormenu.sqf","",5,false,true,"", ""];
 
    };

Also im running this client side, so not sure if its gonna work...
dunno much about hive queries but I do know you misspelled format here
Code:
_key = fromat["CHILD:999:SELECT * FROM donators WHERE donor = ?:[%1]:",_playerUID];
also in the new steam based beta patches you either use their steamID (which I believe is returned by getPlayerUID now) or you use getPlayerUIDOld which returns the old UID. ( I think, at least)
 
Last edited:
dunno much about hive queries but I do know you misspelled format here
Code:
_key = fromat["CHILD:999:SELECT * FROM donators WHERE donor = ?:[%1]:",_playerUID];
also in the new steam based beta patches you either use their steamID (which I believe is returned by getPlayerUID now) or you use getPlayerUIDOld which returns the old UID. ( I think, at least)
Turns out that i can't use CHILD. I need to use arma 2 net. Do you know if it is already installed with HiveEXT.dll?
 
Turns out that i can't use CHILD. I need to use arma 2 net. Do you know if it is already installed with HiveEXT.dll?
I honestly don't know. I strictly stay away from database stuff because of the bull that comes with it haha. Good luck though.
 
I honestly don't know. I strictly stay away from database stuff because of the bull that comes with it haha. Good luck though.
Okay, im working on a script that automaticly sets up a donator menu when the payment is conpleted. I would use the paypal API to get the uid of the player, and then insert it to a database table. When the player logs in a script would make a query and check if the player is a donator.
 
Yea this can work. But you won't be able to make custom queries to your DB without CHILD:999. I've been thinking about creating something like this but this paypal API seems confusing.
 
Child:999 only works on reality i think. You can of course use the custom_loadout table and get the information from there, but again that would not work with pwnoz0rs server package. I have a working PHP script for paypal but paypals API is really hard to use.
 
Back
Top