Jump to content

Coding_Camel

Member
  • Content Count

    24
  • Joined

  • Last visited

  • Medals

Posts posted by Coding_Camel


  1. Recently i've been working on a vehicle saving script for a life mission... It works with one vehicle, where there is a variable carrying a single item like LAND_CAR. When I try to do this with arrays, it says "Type string, expected array", the error happens when count INV_SavedVehicle happens.

    The code is very messy, as i'm not looking for perfection yet, just something that works with an array.

    Variable is declared in seperate SQF like this

    INV_SavedVehicle = [];

    Save code

    _ArryLength = count INV_SavedVehicle;
    
    
    if(_ArryLength >= 3) then {
    
    player groupChat "You can not save more than 3 vehicles, to get more please remove a vehicle at the retrieve vehicle box...";
    
    } else {
    
    _vcl = (nearestobjects [getpos player, ["Air", "Ship", "LandVehicle"], 3] select 0);
    
    _vclClass = typeOf _vcl;
    
    player globalchat format ["VEHICLE ARRAY : %1",_vcl]; // debug
    
    
    INV_SavedVehicle set [count INV_SavedVehicle, _vclClass];
    
    player globalchat format ["SAVED ARRAY : %1",INV_SavedVehicle]; // debug
    
    deleteVehicle _vcl;
    
    player groupChat "VEHICLE SAVED, YOU MAY RETRIEVE IT AT THE VEHICLE RETRIEVE POINT!";
    
    
    ["INV_SavedVehicle",INV_SavedVehicle] spawn clientsavevar;
    
    };

    The save code is executed from an action. Hopefully someone can help.

    Thanks,

    Camel


  2. Hello there! I'm Coding Camel from True American Gaming, and i'm here to announce the launch of our new community mission, True American Life. It is hosted on the map Celle, and features;

    Donator Housing,

    1000+ vehicles,

    Custom Anti-Hack,

    Full stat save,

    Backed by developers who have been modding since Arma 1,

    Addonsync,

    Custom game launcher.

    To find the server search "[TA]" in your filter.

    We wish to have a server with 20+ players all the time, so that everyone can have an enjoyable experience.

    We have a custom launcher where all you have to do is click "Install [TA] Island Life" and you'll be ready to go in 15-20 minutes, you can also use addonsync!

    ADDONSYNC URL: http://tanfowebsite.site.nfoservers.com/life/life.7z

    LAUNCHER : http://trueamericangaming.com/forum/m/7814935/viewthread/6843558-true-american-gaming-official-game-launcher-beta

    DIRECT LAUNCHER DOWNLOAD : http://www.mediafire.com/download/43y9xj1r2vt0zbv/TA_Game_Launcher.exe

    WEBSITE : http://trueamericangaming.com/

    If you have any questions, please join our teamspeak server : ta.ts3dns.com

    We hope you enjoy your experience here. Thanks,

    True American Gaming Staff


  3. So i'm trying to set it up so that if you have a player on the ground in the animation of hands behind head then you can put him in a vehicle.

    private ["_vcl","_target","_cop"];
    _cop = _this select 0;
    _vcl = (nearestobjects [getpos _cop, ["Air", "Ship", "LandVehicle"], 3] select 0);
    _target = objNull;
    
    
    {
    if((_x distance _vcl < 10) && (animationstate _x == "civillying01")) then
    {
    _target = _x;
    };
    } forEach civarray;
    
    
    hint format ["%1",_target];
    
    if (isNull _target) then 
    {
    _cop sideChat "No civilians close enough to your vehicle!";
    } else {
    _cop sideChat "Civilian has been put in your vehicle!";
    _target moveInCargo _vcl;
    };


  4. Hi, so I have a script where you walk up to a safe and try to rob it.

    Only problem is I want it to display differently for each bank you rob.

    _safe is defined at the top, given in a parameter when an action is selected. I've done hints with %1 variables and they display safe1, safe2, and safe3 as they should. Although when I use an if statement to check which safe it is it doesn't work.

    if (_safe == "safe1") then
    {
    hint "safe 1";
    };

    Either gives "Zero Divisor Error" or "Generic Error in Expression"

    Could it be that that if statement is inside another if statement?


  5. Hi, recently I posted about server sided files, but I figured that one out myself. Now here's the problem. I have a file that has 3 uid lists, each for different bases, and a trigger that checks if you are in that uid list. The uid lists worked fine, but now that they are server sided they don't work. I tried publicvariable, and publicvariableclient. I'm guessing that its because the variable is being put on the server, and not on the client? or something similar

    heres the condition for the trigger

    this && player in thislist && !((getPlayerUID player) in baseUID1 OR (getPlayerUID player) in baseUID2);


  6. Sorry, posted in the wrong section last time.

    I'm trying to put a SQF file on the server so it's not in the mission file. I've seen it done before, anyone here know how?

    I'm using

    [] execVM "servermissionfile\code.sqf"

    to execute it from the init.

    EDIT -

    just found that it uses the isServer check in the init for other files. I think this is my issue!


  7. Hi, i'm trying to make a fishing script, but heres the problem. Even at its most basic form the only thing showing up is "script activated", and me being new to arma scripting, i'm sure its just one of those stupid beginner mistakes.

    player groupchat "SCRIPT ACTIVATED!";
    
    if (player distance getMarkerPos fish < 10) then {
    
    player groupchat "FISH CAUGHT!";
    
    };
    else
    {
    player groupChat "You are not where the fish are!";
    };


  8. So, been trying to get a radar script working ( detects speed of another vehicle infront of you ) and it seems to work. Now what I want to do is make the script only work on a certain vehicle. For instance, black SUV.

    By work on that vehicle, I mean when you get in the radar script activates, and only the driver can use it. Is there a way to do this?

    Also, if this is in the wrong section i'm sorry. First time posting here!

×