Jump to content

cael817

Member
  • Content Count

    38
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by cael817

  1. I have an variable with a scalar value that changes if the players gets killed or kills someone (cbounty), when they kill someone they get the targets cbounty value added to theirs which is fine in itself. Now i want to add so if cbounty reaches a certain value (lets say 1000) and above it will globally hint the server that "player name" has a bounty of "cbounty" and was last seen near "town name" and place a marker (preferably with the player name) the position where the player where at the time of the hint and then remove the marker some time later (to keep the map clean). I have read that it would be bad to do "while loops" but if i want this script to check all players for a higher cbounty value than the set one from time to time i need some kind of loop right or using "near/nearest(something)" as you understand this is way over my head so any help is appreciated =). i found this thread http://forums.bistudio.com/showthread.php?186287-Select-a-random-player/page1 but that is not how i would like it to behave and i would like players to have a chance of staying away, ill probably make the bounty "bleed" off but thats another issue =). Thanks. Im slowly getting towards something that i think might work #define PUBLIC_AREAS call cityList if (isDedicated) exitWith {}; waitUntil {!isNull player}; player addEventHandler ["Fired", { if (player getvariable "cbounty" > 1000) then { if ({(_this select 0) distance getMarkerPos (_x select 0) < _x select 1} count PUBLIC_AREAS > 0) then { systemChat "A high value target was last seen near the area marked on the map"; createBountyMarker = { deleteMarker "bountyMarker"; _pos = getPos (vehicle player); _markerText = format["Bounty Target, %1",(name player)]; _bountyMarker = createMarker ["bountyMarker", _pos]; _bountyMarker setMarkerShape "ICON"; _bountyMarker setMarkerPos _pos; _bountyMarker setMarkerText _markerText; _bountyMarker setMarkerColor "ColorRed"; _bountyMarker setMarkerType "select"; sleep 300; deleteMarker _bountyMarker; }; [] spawn createBountyMarker; }; }; }]; This places the marker for me, but i would like to if possible to use all "NameCityCapital","NameCity","NameVillage","CityCenter" and maybe other places. Can i use that together with the code above? btw cityList is already in A3W [ // Marker Name, Diameter, City Name ["Town_1", 400, "Kavala"], ["Town_2", 300, "Agios Dionysios"], ["Town_3", 150, "Abdera"], etc. but it doesnt and shouldn't contain all towns. I could of create one separate with all towns if that's good practice? Is it possible to suppress the "systemChat" or make a (global) hint that only throws once in a while. Also can i add more eventhandlers ("fired" isnt really optimal for what i want) into this or is it better to put all the towns etc into an array and create triggers on top of those? not that i think i will figure that out by myself =). Or can one create an custom eventhandler that is something like "enteringTown"? (any town or something like that above) that would be really nice...
  2. Hi, Im trying to have some of my functions in a server sided mod (started with -servermod=@testmod), but im having trouble calling and or define them. I came as far as having some logging(diag_log format ["fn_init.sqf ran"] ;). I understood that i might need to be using addPublicvariableEventhandler but i still don't get it =). So if someone could walk me thru this one step at a time i would greatly appreciate it. This far i got in the @testmod folder config.cpp class CfgPatches { class Testmod { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; }; class CfgFunctions { class Testmod { class main { file = "\x\addons\testmod\init"; class init { postInit = 1; }; }; }; }; and in @testmod\addons\testmod\init\ fn_init.sqf diag_log format ["fn_init.sqf ran"]; call compile preprocessFileLineNumbers "\x\addons\testmod\code\fnc_teleport.sqf"; and in @testmod\addons\testmod\code\ fnc_teleport.sqf fnc_teleport = { onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';"; hint "Click on the map to teleport"; }; publicVariable "fnc_teleport"; Now ofc. this doesn't work when i call it from the client (testing with call fnc_teleport from the console). And im guessing if i want to utilize this in an addAction i guess it wont work either way but as long as i can call it from the console(which it does if i have the function in the mission) im pretty happy =). So how do i do this properly? and how do i call or spawn it(depending on the function) As you see i never made a @mod but i want to learn and i want to start small otherwise i will never get it but ofc. i want to effectively compile several functions from several scrips. I also if possible want to log which playerUID used each function (admin logging) but i guess that is even more impossible? Thanks. I got it working, still don't know if im doing it properly but i hade some of my paths wrong(i edited my post so hopefully it will work for any one trying to do the same).
  3. cael817

    RPT logs

    Thank you, i was confused i guess =)
  4. cael817

    RPT logs

    Is it just me being confused or didn't the server create a new .rpt log each time you ran a "restart" command before 1.44 or 1.42? Now it seems i need to "shutdown" to make that happen, i dont remember having to do that in a very long time but now my logs grew very large and i noticed it.
  5. Hi im using this script that i believe Larrow made for making lights around a helipad #define RADIUS 30 #define AMOUNT 100 _target = cursorTarget; _target_pos = getPos _target; if (isNil "borderObjects") then { borderObjects = []; _rad = RADIUS; _bcount = AMOUNT; _inc = 360/_bcount; for "_ang" from 1 to 360 step _inc do { _a = (_target_pos select 0)+(sin(_ang)*_rad); _b = (_target_pos select 1)+(cos(_ang)*_rad); _pos = [_a,_b,_target_pos select 2]; _object = createVehicle ["Land_CncShelter_F", _pos, [], 0, "CAN_COLLIDE"]; borderObjects pushBack _object; }; [format ["Added objects around a radius of (%1m) they will be removed in 30 seconds",RADIUS], 5] call mf_notify_client; }; sleep 30; if ( !(isNil "borderObjects") ) then { { deleteVehicle _x; }forEach borderObjects; borderObjects = nil; }; Can i easily add to this script so each Land_CncShelter_F is rotated x degrees for each increment? I used the Land_CncShelter_F for testing as its easy to see if my changes worked.
  6. Worked prefectly, and thanks for cleaning up =) Thank you very much Larrow
  7. cael817

    Disable voting in 1.40

    Thanks, And this seemed to work voteMissionPlayers = 9999; voteThreshold = 1; allowedVoteCmds[] = {}; allowedVotedAdminCmds[] = {};
  8. I noticed in the rpt logs (with 1.40) that when i had set "voteThreshold" to 1.1 it says it reverts to 0.5 What is the right way to disable all forms of voting right now or at least make it impossible for a vote to pass. Thanks ---------- Post added at 14:21 ---------- Previous post was at 12:44 ---------- So, will voteMissionPlayers = 9999; voteThreshold = 1; allowedVoteCmds[] = {}; allowedVotedAdminCmds[] = {}; Suffice?
  9. Thanks for this time and tool nuxil. BEC helped me alot so far =) . Regards Micael
  10. Yes i could do that but i guess that would be to only mark a random player with a high enough value. That i can actually manage to do =). I would like it so the "bounty target" gets marked and hinted about when they approach certain places, like towns or villages, actually having the possibility for adding my own markers and triggers to them might be just what i want. If there where an eventhandler like "nearTown" that would probably be perfect.
  11. Thank you Schatten, I'm thinking that i may i need to take an alternative route to achieve what i want so i looked at KKs Trigger Tutorial here http://killzonekid.com/arma-scripting-tutorials-triggers-v3-1-basic-multiplayer-coding-v1-1/ but how do i get something like this _triggerPositions = nearestLocations [getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameVillage","NameCity","NameCityCapital"], 25000]; to output/reflect this ? _triggerPositions = [[0,0,0],[1,1,1],[2,2,2]];
  12. Do i need to make the marker name unique? is this sufficient? _markerName = format["bt%1",(name player)]; _bountyMarker = createMarker ["_markerName", _pos];
  13. I used 1.35 exp for some time now and it seems to run fine, no issues so far =). Thanks for making this tool
  14. Hi, Since some time, i think about 1.28 or maybe 1.26 my Rcon tools gets disconnected every 1-5 minutes(without me changing anything besides updating ArmA). I use BEC and sometimes EPM on the same machine as the server. And ARC or EPM when on another machine. All of them behaves pretty much the same and looses its connection and then reconnects again. Normally this isnt a problem but with BEC doing the restarts and announcements they sometimes get lost during the disconnect. Anyone else seen this and found a fix or any insight to this problem? Thanks.
  15. cael817

    RCon loses its connection

    Sorry, i forgot to thanks you for the info Nuxil, i also wanted to inform that i never gott rid of the problem until i did a complete reinstall of windows, i was probably just to lazy to go thru the register or whatever i forgot to remove =). Bec is a great tool btw! Thanks again.
  16. So i found several ways to create map markers depending on for example classname _number = 0; _vehicle = nearestObjects [player, ["car"], 20000]; { _number = _number + 1; _markername = format ["%1_%2", typeOf _x, _number]; _vehicleMarker = createMarkerLocal [_markername, position _x]; _vehicleMarker setMarkerShapeLocal "ICON"; _vehicleMarker setMarkerTypeLocal "mil_dot"; _vehicleMarker setMarkerTextLocal "Your stuff is here"; _vehicleMarker setMarkerColorLocal "ColorRed"; } forEach _vehicle; What i want to do is to find all vehicles and or objects that have the variable "ownerUID" set to it and preferably compare this to the playerUID, and if it matches draw a private marker on the map and then remove it after a set time. I have problems figuring out both how to find and mark objects/vehicles based on a variable instead of classname and how to use deleteMarkerLocal _vehicleMarker; in conjunction with the above code, if this way even is a good idea? Goal is for it to work on a dedicated server. Any help is appreciated. :)
  17. Thanks austin_medic, Worked like a charm and i learned that you need to restart the mission/local server from time to time =). I actually had it like that but it just threw errors at me, guess that's what you get doing stuff other than sleep 4 in the morning. Thanks again
  18. Does EPM (0.9.9.6) cashe/buffer the banlist somewhere? I have something strange going on where i seem to have some players banned even with an empty bans.txt. and to my knowledge i only use EPM and BEC =). Other interesting thing is that i can only see the connect and the immediately disconnect in the logs no message about a ban or so. They on the other hand get "You got banned" Thanks
  19. So, im trying to add an action dynamically to all vehicles that have a the variable "ownerUID" (or will get it later) i had this working pretty nice by setting the action to the player and doing the checking there but now im trying to add it to the vehicles instead as i understand that this is more beneficial, but what do i know it may be completely unnecessary. The script further down (based on KillzoneKids tutorials) works but as i run it every 30 seconds it adds one more action every time which isn't looking very good and im probably thinking the wrong way about this, so i need some help and tips. So what i want to do. (btw this is a MP wasteland mission) I have the variable set to the vehicle in this case its "ownerUID" which i set to the vehicle with _vehicle setVariable ["ownerUID", getPlayerUID player, true]; and i want these things to happen. Vehicle has a "ownerUID" add action to "unlock" if "locked" or vice versa. Vehicle has a "ownerUID" add action to "Pick the vehicles lock" if the UID isn't matching the "ownerUID" and is locked. so i don't really care about the distance (below) i actually just want these actions to be set as long as a vehicle have some kind of value in "ownerUID" or whatever i may call that, but as i said, im probably thinking about this wrong. I appreciate any help or tips that can make this more neat or efficient and why that may be as im very much learning. _lockableVehicles = nearestObjects [player, ["LandVehicle", "Ship", "Air"], 5000]; { _x setVariable ["lockable", _x addAction ["Lock Vehicle", "addons\vehiclelock\lock.sqf", "", 1, false, false, "", " if (!alive _target) exitWith { _target removeAction (_target getVariable 'lockable'); }; if (isNil {_target getVariable'ownerUID'}) exitWith { }; if (_target getVariable'ownerUID' != getPlayerUID player) exitWith { }; true "]]; } forEach _lockableVehicles; { _x setVariable ["unLockable", _x addAction ["Unlock Vehicle", "addons\vehiclelock\unlock.sqf", "", 1, false, false, "", " if (!alive _target) exitWith { _target removeAction (_target getVariable 'unLockable'); }; if (isNil {_target getVariable'ownerUID'}) exitWith { }; if (_target getVariable'ownerUID' != getPlayerUID player) exitWith { }; true "]]; } forEach _lockableVehicles; { _x setVariable ["lockPickable", _x addAction ["Pick the vehicles lock", "addons\vehiclelock\lockPick.sqf", "", 1, false, false, "", " if (!alive _target) exitWith { _target removeAction (_target getVariable 'lockPickable'); }; if (isNil {_target getVariable 'ownerUID'}) exitWith { }; if (_target getVariable 'ownerUID' == getPlayerUID player) exitWith { }; true "]]; } forEach _lockableVehicles;
  20. Thank you both, i haven't tested your script in MP yet Larrow but when i run the mission in MP from my client your script is immensely fast and does it good, i need to add in some extra things in it to make some extra things happen, as check for a lockpick, have a chance of breaking it but i modified it some to my needs but there is some things there that i need to figure out. Bangabob your addaction with something added from Larrows script turned out nice and ill use it until i cant test and build on Larrows variant but here is pretty much the strings what i use. ["<img image='client\icons\r3f_unlock.paa'/>Unlock Vehicle", "client\actions\unlock.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] == getPlayerUID player && locked cursorTarget >= 2 && cursorTarget distance player < 7"], ["<img image='client\icons\r3f_lock.paa'/>Lock Vehicle", "client\actions\lock.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] == getPlayerUID player && locked cursorTarget == 0 && cursorTarget distance player < 7"], ["<img image='client\icons\r3f_unlock.paa'/>Pick the vehicles lock", "client\actions\lockPick.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] != getPlayerUID player && locked cursorTarget >= 2 && cursorTarget distance player < 7"], ["<img image='client\icons\r3f_lock.paa'/>Lock someone else vehicle", "client\actions\locknotowned.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] != getPlayerUID player && locked cursorTarget == 0 && cursorTarget distance player < 7"], As i already had scripts that worked with addAction to player this is what i use now and it can simplify the scripts i use some, i used a swith type of controls tructure in some of them before but the worked for a while in Dedicated MP but suddently stopped working. Again Larrows script works extremely well for me in MP on my "Client" computer but i need it to do some other extra stuff but im very happy for both you examples. Thank you both again
  21. cael817

    Object Not found spam in RPT

    I get these very, very often 17:29:08 Server: Object 2:15958 not found (message 108) 17:29:09 Server: Object 2:18220 not found (message 108) 17:29:10 Server: Object 2:25156 not found (message 108) 17:29:11 Server: Object 2:18918 not found (message 108) 17:29:11 Server: Object 2:25575 not found (message 108) 17:29:11 Server: Object 2:22149 not found (message 108)
  22. Hi, Im trying to remove the inventory screen when someone tries to check the inventory of a locked vehicle and i have been using this script by (i believe) NiiV. Which have worked before but now it throws a "Error Undefined variable in expression: null" at line 13 (case null:{ // UNLOCKED) im guessing that "null" represents another value than true or false but commenting out that part doesnt work. has anything rplace "null" ? or what is wrong here? Thanks private ["_cTarget","_isOk","_display","_inVehicle","_lockState2", "_null"]; disableSerialization; while {true} do { waitUntil {!isnull (findDisplay 602)}; _display = findDisplay 602; _inVehicle = (vehicle player) != player; _cTarget = cursorTarget; _lockState2 = cursorTarget getVariable "objectLocked"; //player globalChat format["Gear open [_display = %1, _inVehicle = %2, _cTarget = %3, _lockState2 = %4]",_display,_inVehicle,_cTarget,_lockState2]; if(((vehicle player) distance _cTarget) < 12) then { switch (_lockState2) do { case null:{ // UNLOCKED }; case false:{ // UNLOCKED }; case true:{ // LOCKED cutText ["Cannot access gear in a locked vehicle." , "PLAIN DOWN"]; _display closeDisplay 1; }; case "0":{ // UNLOCKED }; case "1":{ // LOCKED cutText ["Cannot access gear in a locked vehicle." , "PLAIN DOWN"]; _display closeDisplay 1; }; }; }; //waitUntil {isnull (findDisplay 602)}; //player globalChat "Gear closed"; };
  23. How do a "correct" .Arma3Profile look for a server as of the latest stable release? the one from my "game" profile doesn't seem to match the ones i used before(or the "tutorial" one) so if someone have (preferably a commented one) and is willing to post it i would be grateful.
  24. cael817

    Is this normal

    Its hard to see on the picture but if i look at many building in particular the industrial ones there seems to bee a "copy" of the building model withing the other one causing it a graphical glitch, is this related to building destruction or something becuase this reminds me of when i accidentally paste two buildings in the exact same spot. both in arma an other games. Picture is looking at one of the industrial buildings in Agios Dionysios, but alomost all around there shows the graphical phenomomenon.
  25. cael817

    Is this normal

    Aha, thank you =).
×