Jump to content

Balthorius

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About Balthorius

  • Rank
    Rookie
  1. So your problem is that you want that script admin.sqf only to be executed if the player activating the trigger is an admin. The most simple way would be to check for (local player) && {((getPlayerUID player) in Adminlist)} at the beginning of admin.sqf. This way you could execute the script for anyone but stop it if the player is not an admin. Therefor ... [player] execVM "admin.sqf"; ... would be your choice. I think your "real" problem here is the condition set to the trigger. Since the player-object is always local ... (local player) will never fail. As far as I know the code inside the trigger is only executed on the maschine that created the trigger. In multiplayer that always should be the server. To really make use of the trigger-conzept you should rely to its very own special variables "this" and "thislist". See: https://community.bistudio.com/wiki/Mission_Editor:_Triggers or: http://killzonekid.com/arma-scripting-tutorials-triggers/ ... for tutorials about triggers. The problem with your code might be that no matter who activates the trigger the condition will always return true if the player creating the trigger is an admin. In this case you would need something like ... _trigger setTriggerStatements [ "true", " { if (getPlayerUID _x in AdminList) then { PV_doAdminSQF = _x; (owner _x) publicVariableClient 'PV_doAdminSQF'; }; } count thislist; ", ""] Of course you need to set a PVEH to handle the call from above. "PV_doAdminSQF" addPublicVariableEventHandler { (_this select 1) execVM "admin.sqf"; }; I hope that matched with your problem. Greetings Balthorius
  2. This should only be korrect if _var is a String. Having another type of variable one should use: _string = "Pos: " + str(_var); or the former mentioned _string = format ["Pos: %1", _var]; (which for me seems to be the best way in most cases)
  3. Balthorius

    Arma2MySQL

    Hey guys. I'm having some trouble using Arma2Net with my stored procedure. I really looked for an answer via google for more than two hours but now i decided to post here... Maybe I should have created a new thread for this... If so, please anyone move this post to a new thread. What I was trying is using a stored procedure I created before in the database I am using. So I found an example of doing so on this homepage (I tried to post a link, here but since I just registered I am not allowed to do so...), but when it comes to the execution of my code Arma2Net throws an exception. (Of course I made sure my stored procedure really works - it's all fine when executing it with my MySQL client.) This is my code... _strCreate = format ["[objUID=%1,instanceNr=%2,class='%3',dmg=%4,charID=%5,world='%6',inv='%7',hits='%8',code=%9]", _uid, dayz_instance, _class, 0, _charID, _worldspace, [], [], _fuel ]; _create = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%1', 'insertBaseBuildingObject', '%2']", mydatabase, _strCreate]; diag_log format ["Debug BB-Create ... %1",_create]; And here is what I get in the Arma2Net logfile... Info: 23:22:31 - Received - Database: overpoch_test Procedure: insertBaseBuildingObject Parameters: objUID=6513412343451243,instanceNr=11,class=Plastic_Pole_EP1_DZ,dmg=0,charID=676235463242456,world=[342.237,[4640.63,9870.5,0]],inv=[],hits=[],code=3333 Info: 23:22:31 - Parsing parameters... Warning: 23:22:31 - Couldn't parse procedure, split didn't work. Can anyone tell what is wrong here? I have found some could that gave me a hint that my parameters could not be seperated correctly so that Arma2Net could have interpreted the hole string of parameters as one single parameter. The result would be that the further seperation with '=' would bring up an array with more than 2 entries (10 in my case) so that Arma2Net gives that warning. Any help would be appreciated. Best regards Balthorius
×