Jump to content

MC.Quit

Member
  • Content Count

    10
  • Joined

  • Last visited

  • Medals

Posts posted by MC.Quit


  1. 3 minutes ago, HazJ said:

    Don't expect it done for you. Learn and try yourself. Check this out:

    https://community.bistudio.com/wiki/displayAddEventHandler

    https://community.bistudio.com/wiki/DIK_KeyCodes

    Here is a snippet from mine to give you an idea.

    
    #define DIK_H 0x23
    
    case DIK_H :
    {
    	player action ["SwitchWeapon", player, player, -1];
    };

    I have a keyDownHandler function with switch block. Params:

    
    params ["_display", "_key", "_shift", "_ctrl", "_alt"];

    I use _key for the switch condition.

    Thank you for the basic! i'll see if i could make it work thanks.

    i might have some questions in the future tho :P

    the first question is whats the DIK_H 0x23 means


  2. Hi i need someone that can make a simple holster script for me that allows the player to holster his weapon after pressing

    SHIFT+H

    for now i use this

    player addAction ["Holster weapon","holsterpistol.sqf"]

     

    at the holsterpistol.sqf there is this code

    player action ["SwitchWeapon", player, player, -1];

    pretty simple but im tryna keep the actionbar empty


  3. 3 minutes ago, pierremgi said:

    _friendyGroup and _enemyGroup are not defined.

    silentHint doesn't exist. HintSilent is better.

    the cursorObject is a command returning object (if exists) on real time. You need to loop a condition if you want to use it (except if you are using the debug console on the fly, during game).

    addAction can be alright, but you need to use the specific variables. See addAction.

    i want to slap my self for stupidity. XD thanks man i didnt notice the mistake lol 

    *hint to self* do not make scripts at 3 am


  4. private ["_prisonGroup","_guardGroup","_unit"];

    _guardGroup = createGroup west;
    _prisonGroup = createGroup civilian;
    _unit = cursorObject;
    switch (playerSide) do
    {
    case civilian:
    {
        [_unit] joinSilent _friendlyGroup;//<<Enters player to Blufor
        silentHint "you are now a Prison Guard";

    };
    case west:
    {
        [_unit] joinSilent _enemyGroup;//<<Enters player to Civilian
        silentHint "you are now a Prisoner";
    };
    };

     

    Did i miss something? im not sure if i done it right because i placed a player as a civ infront a opfor soldier and tried switching the civ to the guardgroup (blufor) and it didnt work

    But when i used the script with addaction like that (   [Player] joinSilent _friendlyGroup;//<<Enters player to Blufor  ) it worked on me any idea why it doesnt work?

    • Like 1

  5. 23 hours ago, HazJ said:

    I think you are diving in way too deep. I recommend you Google and learn the basics to start with. Another way would be to use getPlayerUID command with an array of UIDs.

    
    adminsArr =
    [
    	"12345",
    	"54321"
    ];
    
    player addAction ["Show online admins",
    {
    	private _onlineAdmins = [];
    	{
    		if (!isNull _x && getPlayerUID _x in adminsArr) then
    		{
    			_onlineAdmins pushBack (name _x);
    		};
    	} forEach playableUnits;
    	hintSilent format ["Online admins: %1", _onlineAdmins];
    }];

    Could probably ditch the forEach with simple method using nested adminsArr which contains UID + name then use joinString/splitString perhaps.

    
    player addAction ["God Mode", {if (isDamageAllowed (_this select 0)) then {(_this select 0) allowDamage false;} else {(_this select 0) allowDamage true;};}, nil, 0, false, false, "", "(getPlayerUID _this in adminsArr"];

    Not tested.

    Awesome! works perfect! thanks


  6. Hello i'm pretty new to scripting and i want to make a mission with a one admin slot.

    So I want the Admin slot to have a "addAction" that show the admin all the players in the session.

    An when he selects 1 player that player gets some "AddAction" commands that allow him to do stuff.

    As a new guy to all this scripting stuff i do not know how to make it happen. PLEASE PLEASE PLEASE help me.

    :) thanks have a good day (:

    i though about some thing like that...

     

    down here would be the idea

    ---------

    on the admin slot would be an "addAction" with the action

    (Give Power)

    when the "Give Power" action is pressed

    the players list would be shown

    and the player that the admin selects gets some power

    example :

    ----------

    Give Power

    --------------

    Player list <-- would be in green text

    Shawn

    Jhon

    Alex

    Dan

    ----------

    if Dan is selected then a hint/titletext would appear and say

    "Dan has been giving admin power"

    and then Dan has some addactions that i would make.

×