igoooor Posted January 8, 2015 Report Share Posted January 8, 2015 good catch. always nice to have code review. I'll edit the samples so they are correct you did the same error "_packet = _this select 0;" in lesson 3 And also in lesson 3, I think this is not correct: PV_EventStatusClient = [Dayz_Epoch_Event_Running]; publicVariable "Dayz_Epoch_Event_Running"; and should be: PV_EventStatusClient = [Dayz_Epoch_Event_Running]; publicVariable "PV_EventStatusClient"; right ? You did it twice this one ;) Edit: I just saw: private ["packet","_sender","_status","_logString","_isAdmin",]; _packet = _this select 0; see "packet" and "_packet" ? ^^ hambeast 1 Link to comment Share on other sites More sharing options...
hambeast Posted January 9, 2015 Author Report Share Posted January 9, 2015 you did the same error "_packet = _this select 0;" in lesson 3 And also in lesson 3, I think this is not correct: PV_EventStatusClient = [Dayz_Epoch_Event_Running]; publicVariable "Dayz_Epoch_Event_Running"; and should be: PV_EventStatusClient = [Dayz_Epoch_Event_Running]; publicVariable "PV_EventStatusClient"; right ? You did it twice this one ;) Edit: I just saw: private ["packet","_sender","_status","_logString","_isAdmin",]; _packet = _this select 0; see "packet" and "_packet" ? ^^ ok, I think I got them all. If you see any more let me know. computermancer 1 Link to comment Share on other sites More sharing options...
igoooor Posted January 9, 2015 Report Share Posted January 9, 2015 ok, I think I got them all. If you see any more let me know. sure :) thanks again for this awesome tutorial! hambeast 1 Link to comment Share on other sites More sharing options...
hambeast Posted January 9, 2015 Author Report Share Posted January 9, 2015 NP! Link to comment Share on other sites More sharing options...
KamikazeXeX Posted January 12, 2015 Report Share Posted January 12, 2015 NP! Hey bud, great thread! making some form of event system using this right now and having some issues with this section of code // admin menu if (_isAdmin) then { if((speed player <= 1)) then { if (s_player_admin_option < 0) then { s_player_admin_option = player addaction[("<t color=""#E65C00"">" + ("Admin Menu") +"</t>"),"event\AdminMenu.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_admin_option; s_player_admin_option = -1; }; }; // player TP menu if((speed player <= 1) && Dayz_Epoch_Event_Running) then { if (s_player_event_option < 0) then { s_player_event_option = player addaction[("<t color=""#FF0000"">" + ("-- EVENT ACCESS --") +"</t>"),"event\PlayerMenu.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_event_option; s_player_event_option = -1; }; Long story short, no options show on scroll wheel unless i'm looking at a trader? Not tried this with other players yet but i assume it'd be the same results EDIT: It doesn't show options unless you're looking at any object Link to comment Share on other sites More sharing options...
igoooor Posted January 12, 2015 Report Share Posted January 12, 2015 Hey bud, great thread! making some form of event system using this right now and having some issues with this section of code // admin menu if (_isAdmin) then { if((speed player <= 1)) then { if (s_player_admin_option < 0) then { s_player_admin_option = player addaction[("<t color=""#E65C00"">" + ("Admin Menu") +"</t>"),"event\AdminMenu.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_admin_option; s_player_admin_option = -1; }; }; // player TP menu if((speed player <= 1) && Dayz_Epoch_Event_Running) then { if (s_player_event_option < 0) then { s_player_event_option = player addaction[("<t color=""#FF0000"">" + ("-- EVENT ACCESS --") +"</t>"),"event\PlayerMenu.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_event_option; s_player_event_option = -1; }; Long story short, no options show on scroll wheel unless i'm looking at a trader? Not tried this with other players yet but i assume it'd be the same results EDIT: It doesn't show options unless you're looking at any object this is weird, could you show us the surrounding lines where you put this code in your server_functions.sqf? Link to comment Share on other sites More sharing options...
KamikazeXeX Posted January 12, 2015 Report Share Posted January 12, 2015 this is weird, could you show us the surrounding lines where you put this code in your server_functions.sqf? Its supposed to be in fn_selfActions :P but anyhow here is how i'm using it right not, tried removing the player speed line to see if helped but no joy, i've placed it pretty much at the very top with all my other custom actions are scriptName "Functions\misc\fn_selfActions.sqf"; /*********************************************************** ADD ACTIONS FOR SELF - Function - [] call fnc_usec_selfActions; ************************************************************/ private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached","_playerUID","_characterID","_plotDistance","_PlotsNear", "_classname","_isowner"]; if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running. _vehicle = vehicle player; ExcavateVeh = vehicle player; thesub = vehicle player; _isPZombie = player isKindOf "PZombie_VB"; _inVehicle = (_vehicle != player); _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); //------------------------------------------------ Vending Machine --------------------------------// private["_playerPos","_nearVend"]; _playerPos = getPosATL player; _nearVend = count nearestObjects [_playerPos, ["MAP_vending_machine"], 4] > 0; if (_nearVend) then { if (s_player_Vend < 0) then { s_player_Vend = player addaction[("<t color=""#00C732"">" + ("Vehicle Vending") +"</t>"),"dayz_code\actions\vendveh.sqf"]; }; } else { player removeAction s_player_Vend; s_player_Vend = -1; }; //--------------------------------------------- Vending Machine End ---------------------------// //################################# Bexs Bunker ########################################## if (cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 ) then { if (s_player_bunker < 0) then { s_player_bunker = player addaction[("<t color=""#0000ff"">" + ("Entering the bunker") +"</t>"),"custom\bunker\bunkerin.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_bunker; s_player_bunker = -1; }; if (cursorTarget isKindOf "Infostand_2_EP1" && (player distance cursorTarget) < 2 ) then { if (s_player_bunkero < 0) then { s_player_bunkero = player addaction[("<t color=""#0000ff"">" + ("Leaving the Bunker") +"</t>"),"custom\bunker\bunkerout.sqf","",5,false,true,"", ""]; }; } else { player removeAction s_player_bunkero; s_player_bunkero = -1; }; //########################### Bexs Bunker stop ############################################ //################################# XeXGaming Events Start ########################################## // admin menu if ((getPlayerUID player) in XG_AdminList) then { if (s_player_admin_option < 0) then { s_player_admin_option = player addaction[("<t color=""#ffffff"">" + ("Events Menu") +"</t>"),"custom\events\AdminEventMenu.sqf"]; }; } else { player removeAction s_player_admin_option; s_player_admin_option = -1; }; // player TP menu if (XG_EventRunning) then { if (s_player_event_option < 0) then { s_player_event_option = player addaction[("<t color=""#FF0000"">" + ("-- EVENT ACCESS --") +"</t>"),"custom\events\PlayerEventMenu.sqf"]; }; } else { player removeAction s_player_event_option; s_player_event_option = -1; }; //########################### XeXGaming Events End ############################################ _nearLight = nearestObject [player,"LitObject"]; _canPickLight = false; if (!isNull _nearLight) then { if (_nearLight distance player < 4) then { _canPickLight = isNull (_nearLight getVariable ["owner",objNull]); }; }; This is a weird one to be honest :L EDIT: NVM fixed it, I had player removeAction s_player_admin_option; s_player_admin_option = -1; player removeAction s_player_event_option; s_player_event_option = -1; at the bottom of self act, the times i make derps like this :L Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 Hey, I saw your tutorial on publiceventhandlers, but I just can't seem to get it well enough to apply it to my script. I want players to hear my player groan when he is playing possum. (from superfunmenu) As it is now, only client can hear the groan. I was hoping you could help me with the basics of getting other players to hear/see my desired sounds/animations. Thanks man. Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 Hey, I saw your tutorial on publiceventhandlers, but I just can't seem to get it well enough to apply it to my script. I want players to hear my player groan when he is playing possum. (from superfunmenu) As it is now, only client can hear the groan. I was hoping you could help me with the basics of getting other players to hear/see my desired sounds/animations. Thanks man. What you want to do is define a PVEH on the clientside (most likely in the init.sqf or a sqf file called from that) that when fired off, plays a sound. How you fire it off is the tricky part as you probably only want people in say a 30m radius to hear the sound. You could be lazy and just fire it off to everyone. So here's how I would do it quick and dirty. Note, there is probably a better way to do this but its monday... So, you need 2 pveh. 1. Serverside PVEH to get our call from our player and send to other players 2. Clientside PVEH to actually play the sound. // Serverside PVEH (Init this in your server.pbo) if (isDedicated) then { // expects [Player,Radius] "PVEH_PlaySoundServer" addPublicVariableEventHandler { private["_packet", "_sender", "_radius", "_playersToSend"]; _packet = _this select 1; _sender = _packet select 0; _radius = _packet select 1; _playersToSend = nearestObjects [_sender, ["CAmanBase"], _radius]; { _clientID = owner _x; PVEH_PlaySoundClient = []; _clientID publicVaribleClient "PVEH_PlaySoundClient"; } forEach _playersToSend; }; }; // Clientside PVEH (init this in your mission.pbo) if (!isDedicated) then { // expects [] "PVEH_PlaySoundClient" addPublicVariableEventHandler { // play sound code goes here }; }; Now please note, that the "get players within raidus" code is probably inefficient and probably buggy. I'm sure there is a better way to do this and you are free to look into that part, I just wrote this up real quick to give you an idea on how you can do this. edit: sorry I forgot, somewhere in your code to kick this off, you will need to call a publicVariableServer command to kick it off like this: PVEH_PlaySoundServer = [player,30]; // [player,radius] publicVariableServer "PVEH_PlaySoundServer"; computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 Sweet, trying it now, thanks man, Ill edit this with the results :wub: Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 Ran into an issue. I get this in my RPT PVEH_PlaySoundClient = []; _clientID publicVaribleClient "PVEH_PlaySoundClien> 12:15:59 Error position: <publicVaribleClient "PVEH_PlaySoundClien> 12:15:59 Error Missing ; 12:15:59 File mpmissions\epoch.Altis\TEST\init.sqf, line 17 Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 can you pate your TEST/init.sqf ? Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 // Serverside PVEH (Init this in your server.pbo) if (isDedicated) then { // expects [Player,Radius] "PVEH_PlaySoundServer" addPublicVariableEventHandler { private["_packet", "_sender", "_radius", "_playersToSend"]; _packet = _this select 1; _sender = _packet select 0; _radius = _packet select 1; _playersToSend = nearestObjects [_sender, ["CAmanBase"], _radius]; //_playersToSend = _sender nearEntities [["man"],_radius]; { _clientID = (owner _x); PVEH_PlaySoundClient = []; _clientID publicVaribleClient "PVEH_PlaySoundClient"; } forEach _playersToSend; }; }; Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 can you try throwing in this between the _clientID = and PVEH at line 15/16: diag_log format["_clientID: %1", _clientID]; this should make it spit out the clientID of whatever the object is... I have a suspicion that it is picking up AI and trying to pass them the PVAR, will probably need to tweak that part a bit. Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 lol, ok, I think I know how to eliminate AI, i have an ESP admin tool that eliminates AI by requireing pUID != ""; Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 see if you can throw that in there as that might be causing the error. I looked at the code and nothing pops out at me as a syntax error... Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 12:49:26 Error in expression <]; PVEH_PlaySoundClient = []; _clientID publicVaribleClient "PVEH_PlaySoundClien> 12:49:26 Error position: <publicVaribleClient "PVEH_PlaySoundClien> 12:49:26 Error Missing ; 12:49:26 File mpmissions\epoch.Altis\TEST\init.sqf, line 18 12:49:26 Error in expression <]; PVEH_PlaySoundClient = []; _clientID publicVaribleClient "PVEH_PlaySoundClien> 12:49:26 Error position: <publicVaribleClient "PVEH_PlaySoundClien> 12:49:26 Error Missing ; 12:49:26 File mpmissions\epoch.Altis\TEST\init.sqf, line 18 Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 idk you could try setting PVEH_PlaySoundClient = 0; maybe its angry about an empty array? Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 Haha, maybe, I will try that.... here is what I have so far.. // Serverside PVEH (Init this in your server.pbo) if (isDedicated) then { // expects [Player,Radius] "PVEH_PlaySoundServer" addPublicVariableEventHandler { private["_packet", "_sender", "_radius", "_playersToSend"]; _packet = _this select 1; _sender = _packet select 0; _radius = _packet select 1; _playersToSend = nearestObjects [_sender, ["CAmanBase"], _radius]; //_playersToSend = _sender nearEntities [["man"],_radius]; { _clientID = (owner _x); _eachManPuid = getPlayerUID _x; if ((_eachManPuid != "")) then { diag_log format["_clientID: %1", _clientID]; PVEH_PlaySoundClient = 0; _clientID publicVaribleClient "PVEH_PlaySoundClient"; }; } forEach _playersToSend; }; }; Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 It seems to have a problem with this line _clientID publicVaribleClient "PVEH_PlaySoundClient"; 13:06:52 Error in expression <]; PVEH_PlaySoundClient = 0; _clientID publicVaribleClient "PVEH_PlaySoundClien> 13:06:52 Error position: <publicVaribleClient "PVEH_PlaySoundClien> 13:06:52 Error Missing ; 13:06:52 File mpmissions\epoch.Altis\TEST\init.sqf, line 23 13:06:52 Error in expression <]; PVEH_PlaySoundClient = 0; _clientID publicVaribleClient "PVEH_PlaySoundClien> 13:06:52 Error position: <publicVaribleClient "PVEH_PlaySoundClien> 13:06:52 Error Missing ; 13:06:52 File mpmissions\epoch.Altis\TEST\init.sqf, line 23 Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 btw if you are using the stock a3 antihacks, put a file named "skaro.sqf" in your arma3 directory (next to arma3.exe) and you can put code inside of it you want to test out. This only works for clientside code so IDK how helpful it will be for your serverside stuff but you can at least call serverside PVEH's with it. I think the default keybind is f12 or f11 Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 hmm... try adding _clientID to the private array at the top of the expression. It could be a locality issue? aside from that I'm not really sure. I'll have to play with the code tonight and see if I can't generate you a sample pbo to play with computermancer 1 Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 I'm not using epah, I removed that line just to see if i could get the dialog debug to show and it did Since I was the only person around for 30 m, this is my clientID i am guessing? I also loaded in another client and got his client ID and puid as well as mine... not sur ewhere to move from here. 13:26:55 "_clientID: 4" 13:26:55 "_eachManPuid: 76561198000896540" 13:26:55 "_clientID: 5" 13:26:55 "_eachManPuid: 76561198132318240" Link to comment Share on other sites More sharing options...
hambeast Posted March 23, 2015 Author Report Share Posted March 23, 2015 yeah that is your clientid. If you're running infistar, I believe the file is called admin_start.sqf Link to comment Share on other sites More sharing options...
computermancer Posted March 23, 2015 Report Share Posted March 23, 2015 So, I can't seem to get the code to work after teh server is triggered. I can get the diag to display all the code from serverside, such as remotePlayerid, name, uid, etc but I cant get it to do the next part which is to trigger the clientside code of playing the sound. or even diags :wacko: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now