Jump to content

raptor2x

Member
  • Content Count

    48
  • Joined

  • Last visited

  • Medals

Posts posted by raptor2x


  1. Hello,

    So basically I'm trying to do something when a player fires with a mortar.

    This is a simple code I made to check if it's working when the player fires with a MK18, and it's working good:

    player addEventHandler ["Fired",{	if (_this select 1 == "srifle_EBR_F") then	{            do something here	};}];
    So now I'm trying to adapt the code for the mortar, this is what I tried :
    player addEventHandler ["Fired",{	if (_this select 1 == "mortar_82mm") then	{            do something here	};}];
    It's not working and I probably know why "This EH will not trigger if a unit fires out of a vehicle. For those cases an EH has to be attached to that particular vehicle.", the mortar is a vehicle.

    So from what I understand I need to attach the Event Handler to the vehicle and not to the player itself.

    Can you explain me how can I do that ?

    Thank you !


  2. Try to store the message as an array of strings, should work.

     

    _myArray = [];
    _myArray pushBack _answerText;

     

    Like that ?

    private ["_answerAuthorID", "_answerAuthorName", "_answerText"];
    _answerAuthorID = _this select 0;
    _answerAuthorName = _this select 1;
    _answerText = _this select 2;
    
    _textArray = [];
    _textArray pushBack _answerText;
    
    [format ["addOpinion:%1:%2:%3", _answerAuthorID, _answerAuthorName, _textArray]] call extDB_Database_async;
    
    

    It gives 

    9RedPi7.png

     

    But the problem is the same with ":" 

    [17:56:57:934 +02:00] [Thread 5564] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Input String addOpinion:76561198028528740:Raptor:[":"]
    [17:56:57:934 +02:00] [Thread 5564] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Expected: 3 Got: 4
    [17:57:37:105 +02:00] [Thread 5564] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Input String addOpinion:76561198028528740:Raptor:["qsdqsdqds qs :"]
    [17:57:37:105 +02:00] [Thread 5564] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Expected: 3 Got: 4
    

    I believe there is a command called 'onChar' which you can put into your dialog config. You can find more info here: https://community.bistudio.com/wiki/User_Interface_Event_Handlers

     

    What am I supposed to do with onChar ? 

     

    Thanks guys !


  3. Hello,

    So basically I have a dialog where the player can enter a text. Then I save this text in my database.

    It's working good but if the player puts the character ":" inside his text, the query will understand as if it was a new input (I don't know if I'm expressing myself correctly, sorry).

    Here is the log so you will understand what I'm saying :

    [14:44:50:842 +02:00] [Thread 4856] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Input String addOpinion:76561198028528740:Raptor:this is a wonderful test :)
    [14:44:50:842 +02:00] [Thread 4856] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Expected: 3 Got: 4
    [14:32:36:478 +02:00] [Thread 4856] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Input String addOpinion:76561198028528740:Raptor:: 
    [14:32:36:478 +02:00] [Thread 4856] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Expected: 3 Got: 4
    [14:50:00:276 +02:00] [Thread 3028] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Input String addOpinion:76561198028528740:Raptor:test 2 : : : : : : : 
    [14:50:00:276 +02:00] [Thread 3028] extDB2: SQL_CUSTOM_V2: Incorrect Number of Inputs: Expected: 3 Got: 10
    

    So what should I do to force the character not be considerated as a new input ?

    private ["_answerAuthorID", "_answerAuthorName", "_answerText"];
    _answerAuthorID = _this select 0;
    _answerAuthorName = _this select 1;
    _answerText = _this select 2;
    
    [format ["addOpinion:%1:%2:%3", _answerAuthorID, _answerAuthorName, _answerText]] call extDB_Database_async;
    

    Thank you ! 


  4. Hello,
    Ok so my problem is easy to understand and I think that it is also easy to resolve.
    To explain that quickly, here is my code :

    _userUID = getPlayerUID player;
    _alreadyAnswered = [format ["getAnswerAuthor:%1", _userUID], 2] call extDB_Database_async;
    systemChat format ["%1", _alreadyAnswered];
    
    if(_alreadyAnswered == what can I write here ?) then
    {
    	blablabla
    }
    else
    {
    	blablabla
    };
    

    And here is the SQL code referring to "getAnswerAuthor" :

    [getAnswerAuthor]
    SQL1_1 = SELECT COUNT(*) FROM sondages WHERE UID = ?;
    
    Prepared Statement Cache = false
    Number of Inputs = 1
    SQL1_INPUTS = 1

    So the SQL query just checks if there is the UID of the player in the "sondages" table, then it returns 1 or 0 in alreadyAnswered.

    It's actually working well, when I check what's the result with systemChat format ["%1", _alreadyAnswered]; , it says in the chat [0] or [1].

     

    But the problem is that I want to do something with this [1] or that [0], as you can see at the line 5.

    I don't know how I can do that because it's not a simple true/false or a 1/0, there are the "[]" next to the number.

     

    So basically how can I do that if(_alreadyAnswered == [1]) ?

     

    Thanks !


  5. Hello,

     

    I will try to explain that quickly : I made a dialog with some buttons, text and images.
    I would like to know if it is possible to remove one element from the dialog when I click on one of the button.

     

    So let's imagine a window with 2 images in it and 2 buttons in it : one button to remove the image 1, one other to remove the image 2. Everything is in the same window . 
    How can I do that ?

     

    I know about the function closeDialog idc, but it's not what I want because it closes everything. I tried the function with the idc of the element I want to remove, but it closes everything so I guess that I'm using this function wrong.

     

    I hope that you understand what I'm trying to do.

    Thank you ! :-)


  6. Now with this update the mod is working perfectly with the laser-guided bombs, this is a masterpiece, one more time thank you very much for your work sabre !

    If some of you are using the mod ACE, you will have to disable it (at least I had to) in order to use the guided bombs because ACE replace them with unguided ones, this is strange but @sabre will probably do something to prevent that. :)


  7. Hello,

    I downloaded the mod today and tested it, it looks really good, you did a good job !

    However, it looks like I can't lock the guided bombs on the laser, when I press T it doesn't do anything. Do you have any idea why ? Already tried many times with different angles.


  8. Yes I need to read about the clientside & serverside, do you have any link of tutorial which can help me ?

    How can I make a server side file with a script that get launch when the mission start (and restart).

    Here is my init.sqf for you can see how I did the script.

    https://mega.co.nz/#!58k0WYRb!fSrSbxA_cZftWd8XFL8in1rOfZ0j8w1DcZaZjvPNYMs

    Also take note that the "failmission"/"endmission" commands are NOT global, so executing it once locally will just end the mission for your client, not the server.

    Yes, so I need to use "_myPass serverCommand "#restart";" but I have the other problem with the file that is not found.

    Maybe it's because of init.sqf.


  9. You don't understand, systemChat doesn't work on dedicated server, period. If it works then you are running it on client.

    Do you mean client side and server side ? So it means that the file where I put my script is client side ?

    And do you have any idea how I can fix that :

    Well it's working great with this script :

    http://www.puu.sh/hh7Yr/db2b547995.png

    But the problem is that after the mission restart, the countdown does not restart.

    I want the countdown to restart again and again after the mission restart, do you know what I mean ?

    Anyway, thank you for your help.


  10. The script is inside init.sqf

    ---------- Post added at 13:41 ---------- Previous post was at 12:02 ----------

    Even with that script it doesn't works.

    But the test message works.

    67a7d7da2a.png

    ---------- Post added at 14:42 ---------- Previous post was at 13:41 ----------

    Well it's working great with this script :

    db2b547995.png

    But the problem is that after the mission restart, the countdown does not restart.

    I want the countdown to restart again and again after the mission restart, do you know what I mean ?


  11. Thanks for the answer.

    Yes, the folders and the file are in the main folder of the server, right here :

    http://i.gyazo.com/5a39ef65e7f9adc4a4fb2cb0a4e4f8f9.gif

    Then in my script :

       	     if(_time < 2) then
               {  
            _myPass = call compile preprocessFileLineNumbers "\userConfig\myPass\myPass.hpp";
            _myPass serverCommand "#restart";
    	    };

    And in the myPass.hpp file :

    1bdaa91e26.png

    (I will change it so doesn't matter if you see it right now)

    I know about the #restart command, this is finally what I want.

    Another very unlikely cause for not finding external scripts would be if your server runs ArmA3 with the "-noFilePatching" startup parameter for some obscure reason.

    How can I check that ? server.cfg ?


  12. Yup, Jshock has it right.

    Make a document in your servers arma 3 root... in the userConfig folder (make one if you dont have it already).

    arma 3\userConfig\myPass\myPass.hpp

    Then in that file, just put your server.cfg password in quatations

    // \userConfig\myPass\myPass.hpp
    "mypassword1"

    Then, to restart the server... call this code on the server

    if isServer then {
    _myPass = call compile preprocessFileLineNumbers "\userConfig\myPass\myPass.hpp";
    _myPass serverCommand "#restart";
    };

    This way, if someone looks inside your mission, they wont get your password.

    Hello, thanks for the help but it doesn't work.

    When the countdown reach 0 and when it's supposed to do

    _myPass = call compile preprocessFileLineNumbers "\userConfig\myPass\myPass.hpp";

    _myPass serverCommand "#restart";

    I got this :

    44eb62416c.png

    myPass.hpp is right here, in the server root :

    764a4dbde4.png

    Any idea of what is the problem ?


  13. I think that I will do something different.

    My dedicated server restarts every 12 hours (it's an option on the hoster website).

    In my mission script I will just set the countdown to 12 hours (43200 seconds), and normally it should be sync with the delay of restart of the server.

    But maybe there is a difference between the starting time of the countdown of the server and the one of the mission ? Like some seconds, idk.


  14. It would be:

    "serverPassword" serverCommand "#restart";

    But AFAIK this is just a soft restart, it won't actually reset the box, if that's more of what your after?

    Thanks for your answer.

    I would like to try that on my local server, but what is the admin password on the local server ? How can we configure it ?

    EDIT : @Fight9 : Nice, thank you very much. I would like to try that on my own local server before.

    But the command #restart only restart the mission, not the server itself, right ?

×