Jump to content
Haduuken

[Tutorial] Add License 4.4

Recommended Posts

This is the updated version of the older version. This version is for 4.4 and higher

Step 1. Open config_license.hpp. add

    class example { //This is just a example change it to what ever you need
        variable = "example";
        displayName = "STR_License_Example";
        price = 500;
        illegal = false;
        side = "civ";
    };

Step 2. Open stringtable.xml. Add

        <Key ID="STR_License_Example">
            <Original></Original>
            <Czech></Czech>
            <Spanish></Spanish>
            <Russian></Russian>
            <German></German>
            <French></French>
            <Italian></Italian>
            <Portuguese></Portuguese>
            <Polish></Polish>
        </Key>

Done.

Share this post


Link to post
Share on other sites

Once you've added the new license, you have to add it to a store in the editor correct? How would I go about doing that? Also, I've created an Advance rebel license that gives you access to more weapons and things, how would I integrate this into the already existing rebel shop so there would not have to be a separate shop? 

Share this post


Link to post
Share on other sites

Hi, if you have one NPC already and on that npc you have say, ATM, Rebel Clothing, Rebel Weapons to add your new Rebel weapons you need to create your self a new shop under the config_weapons.hpp

class rebel_adv {
        name = "Advanced Rebel Armoury";
        side = "civ";
        license = "advrebel"; //<---- Add your new licence you created here
        level[] = { "", "", -1, "" };
        items[] = {};
		mags[] = {};
		accs[] = {};
	};

After you have done that you will need to add it to the NPC you already have by using

this addAction[""Advanced Rebel Weapon Shop"",life_fnc_weaponShopMenu,""ClassName"",0,false,false,"""",' license_civ_advrebel && playerSide isEqualTo civilian'];e

Where you see classname enter what you have called yours

Share this post


Link to post
Share on other sites
5 minutes ago, MrExtremePulse said:

Hi, I'm adding in an advanced weapon shop also, I'm planning to add in vehicles, how will i go about doing this?

class civ_advrebel {
        side = "civ";
        conditions = "license_civ_advrebel";
        vehicles[] = {
            { "Your vehicle here", "" },
            { "Your vehicle here", "" },
            { "Your vehicle here", "" },
        };
    };

 

Edited by [IL] KingCrazyHunter
  • Like 1

Share this post


Link to post
Share on other sites
Just now, MrExtremePulse said:

4.4r4, what code will i need to add into an npc in game?

 

this addAction[localize ""STR_MAR_advrebel_shop"",life_fnc_vehicleShopMenu,[""civ_advrebel"",civilian,[""civ_car_69"",""civ_car_69_1""],""civ"",""Advanced Rebel Vehicles""]]; this setVariable [""realname"", ""Car Shop""];

This should work make sure you add in the spawnpoints and add the string into the stringtable.xml

Share this post


Link to post
Share on other sites

the code for the veh shop looks a bit different to my current config, are you sure that is 4.4r4?

This is my current rebel shop code:

 class reb_car {
        side = "civ";
        vehicles[] = {
            { "B_Quadbike_01_F", { "", "", -1 } },
            { "B_G_Offroad_01_F", { "", "", -1 } },
            { "O_MRAP_02_F", { "", "", -1 } },
			{ "I_MRAP_03_F", { "", "", -1 } },
			{ "B_LSV_01_unarmed_F", { "", "", -1 } },
            { "B_Heli_Light_01_F", { "", "", -1 } },
            { "B_G_Offroad_01_armed_F", { "", "", -1 } }
        };
    };

 

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, MrExtremePulse said:

the code for the veh shop looks a bit different to my current config, are you sure that is 4.4r4?

This is my current rebel shop code:

 class reb_car {
        side = "civ";
        vehicles[] = {
            { "B_Quadbike_01_F", { "", "", -1 } },
            { "B_G_Offroad_01_F", { "", "", -1 } },
            { "O_MRAP_02_F", { "", "", -1 } },
			{ "I_MRAP_03_F", { "", "", -1 } },
			{ "B_LSV_01_unarmed_F", { "", "", -1 } },
            { "B_Heli_Light_01_F", { "", "", -1 } },
            { "B_G_Offroad_01_armed_F", { "", "", -1 } }
        };
    };

 

when you add the vehicle to the shop you have to scroll down to add the vehicle license.

Example

    class C_Rubberboat {
        vItemSpace = 45;
        licenses[] = { {"boat"}, {""}, {""}, {""} };
        price = 5000;
        textures[] = { };
    };

 

  • Like 1

Share this post


Link to post
Share on other sites

Hello there
  I add licenses but this license does not go to other users.
I need to manually add licenses to all users
How does the licensed license automatically appear in the database?

Share this post


Link to post
Share on other sites
2 hours ago, TulparHAN said:

Hello there
  I add licenses but this license does not go to other users.
I need to manually add licenses to all users
How does the licensed license automatically appear in the database?

whatever license you added you must set the license to purchase on a npc

Share this post


Link to post
Share on other sites
2 hours ago, StonerGaming said:

whatever license you added you must set the license to purchase on a npc

My licenses should not be sold in npc.
I made a license for the Clan Base.
For this reason I can not sell at NPC.

Share this post


Link to post
Share on other sites
1 hour ago, TulparHAN said:

My licenses should not be sold in npc.
I made a license for the Clan Base.
For this reason I can not sell at NPC.

alright well to add the license to civilians login to phpmyadmin and open the database now edit the person you want and you will see civilian license. Add the variable name of the license in that area. Not sure if it will work. it might though

Share this post


Link to post
Share on other sites

Hi great tutorial.

I am having trouble with where to place my new license in my medic NPC. I am creating a Combat medic license. This is in my NPC - 

 

this enableSimulation false; this allowDamage false; this addAction[format ["%1 ($%2)",localize (getText(missionConfigFile >> "Licenses" >> "mAir" >> "displayName")), [(getNumber(missionConfigFile >> "Licenses" >> "mAir" >> "price"))] call life_fnc_numberText],life_fnc_buyLicense,"mAir",0,false,false,"",' !license_med_mAir && playerSide isEqualTo independent ',5]; this addAction[localize"STR_MAR_EMS_Item_Shop",life_fnc_weaponShopMenu,"med_basic",1.5,true,true,"","true",5]; this addAction[localize"STR_MAR_EMS_Clothing_Shop",life_fnc_clothingMenu,"med_clothing",1.5,true,true,"","true",5]; this addAction[localize"STR_MAR_W_E_Vehicle Shop",life_fnc_vehicleShopMenu,["med_shop",independent,"med_car_1","med","Kavala Hospital"],1.5,true,true,"","true",5]; this addAction[localize"STR_MAR_Helicopter_Shop", life_fnc_vehicleShopMenu,["med_air_hs",independent,"medic_spawn_1","med","Kavala Hospital"],1.5,true,true,"","true",5]; this addAction[localize"STR_MAR_W_Car_Garage",  {   if (life_HC_isActive) then {    [getPlayerUID player,playerSide,"Car",player] remoteExecCall ["HC_fnc_getVehicles",HC_Life]; } else { [getPlayerUID player,playerSide,"Car",player] remoteExecCall ["TON_fnc_getVehicles",2];};  createDialog "Life_impound_menu";  disableSerialization;  ctrlSetText[2802,"Fetching Vehicles...."];  life_garage_sp = "med_car_1"; life_garage_type = "Car"; },"",0,false,false,"",'playerSide isEqualTo independent',5]; this addAction[localize"STR_MAR_Helicopter_Garage",  {   if (life_HC_isActive) then {    [getPlayerUID player,playerSide,"Air",player] remoteExecCall ["HC_fnc_getVehicles",HC_Life]; } else { [getPlayerUID player,playerSide,"Air",player] remoteExecCall ["TON_fnc_getVehicles",2];};  createDialog "Life_impound_menu";  disableSerialization;  ctrlSetText[2802,"Fetching Vehicles...."];  life_garage_sp = "medic_spawn_1"; life_garage_type = "Air"; },"",0,false,false,"",'playerSide isEqualTo independent ',5]; this addAction[localize"STR_MAR_Store_vehicle_in_Garage",life_fnc_storeVehicle,"",0,false,false,"",'!life_garage_store',5]; this addAction[localize"STR_Shops_Market",life_fnc_virt_menu,"med_market",1.5,false,false,"",' isNull objectParent player && player distance _target < 5 && playerSide isEqualTo independent ',5]; this setObjectTextureGlobal [0,"textures\medic_uniform.jpg"];

 

The combat medic license variable is - cmedic.

 

Any help would be greatly appreciated.

 

Thankyou

 

Edited by Mukstar

Share this post


Link to post
Share on other sites
On 7/24/2020 at 5:34 AM, Spicywolf said:

hi i have some questions

i make 5 license for civ class 

and i want to sell class license  in regular order
ex) class1->class2->class3 

https://pastebin.com/Ci12viwQ this is my npc who sell class license pls give me some help

What is the actual issue you have? I can't see any issues with the pastebin you have provided. Also would you be able to provide your licenses config?

Share this post


Link to post
Share on other sites
3 hours ago, zyn13 said:

What is the actual issue you have? I can't see any issues with the pastebin you have provided. Also would you be able to provide your licenses config?

no i solve everything thank you for reply 

have a nice day ^^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.