Ajout de licence, la licence ne s'ajoute pas.


#1

Bonjour, ayant un serveur Altis Life en cours de développement, je suis confronté à des erreurs inconnues, notamment pour l’ajout de nouvelles licences.

Les licences sont correctement ajoutée, j’ai suivi le tutoriel à la lettre et en suivant le tutoriel, lors du démarrage du serveur, je ne peux pas acheter la licence aux PNJ, elle n’apparaît pas.

Auriez-vous des réponses à se genre d’erreur, je vous en serais très reconnaissant, merci de votre aide.


#2

Peux-tu envoyer le lien du tutoriel que tu as utilisé ? Lewos


#3

Le voici : http://www.altisliferpg.com/topic/1193-howto-create-new-licenses/


#4

Lewos Peux-tu m’envoyer chaque code entier que tu as modifié ? ( pour chaque step / étape )


#5

Configuration.sqf

//Setup variable inv vars.{missionNamespace setVariable[_x,0];} foreach life_inv_items;  
//Licenses [license var, civ/cop]  
life_licenses =  
[  
["license_cop_air","cop"],  
["license_cop_swat","cop"],  
["license_cop_cg","cop"],  
["license_civ_driver","civ"],  
["license_civ_air","civ"],  
["license_civ_heroin","civ"],  
["license_civ_marijuana","civ"],  
["license_civ_gang","civ"],  
["license_civ_boat","civ"],  
["license_civ_oil","civ"],  
["license_civ_dive","civ"],  
["license_civ_truck","civ"],  
["license_civ_gun","civ"],  
["license_civ_rebel","civ"],  
["license_civ_coke","civ"],  
["license_civ_diamond","civ"],  
["license_civ_copper","civ"],  
["license_civ_iron","civ"],  
["license_civ_sand","civ"],  
["license_civ_salt","civ"],  
["license_civ_cement","civ"],  
["license_med_air","med"],  
["license_civ_home","civ"]  
["license_civ_dogs", "civ"]  
];```

**fn_licensePrice.sqf**

switch (_type) do{
case “driver”: {500}; //Drivers License cost
case “boat”: {1000}; //Boating license cost
case “pilot”: {25000}; //Pilot/air license cost
case “gun”: {10000}; //Firearm/gun license cost
case “dive”: {2000}; //Diving license cost
case “oil”: {10000}; //Oil processing license cost
case “cair”: {15000}; //Cop Pilot License cost
case “swat”: {35000}; //Swat License cost
case “cg”: {8000}; //Coast guard license cost
case “heroin”: {25000}; //Heroin processing license cost
case “marijuana”: {19500}; //Marijuana processing license cost
case “medmarijuana”: {1500}; //Medical Marijuana processing license cost
case “gang”: {10000}; //Gang license cost
case “rebel”: {75000}; //Rebel license cost
case “truck”: {20000}; //Truck license cost
case “diamond”: {35000};
case “salt”: {12000};
case “cocaine”: {30000};
case “sand”: {14500};
case “iron”: {9500};
case “copper”: {8000};
case “cement”: {6500};
case “mair”: {15000};
case “home”: {75000};
case “dogs”: {30000};
};```

fn_licenseType.sqf

private["_type","_ret","_var","_mode"];_type = [_this,0,"",[""]] call BIS_fnc_param;  
_mode = [_this,1,-1,[0]] call BIS_fnc_param;  
if(_type == "" OR _mode == -1) exitWith {[]};  

switch (_mode) do  
{  
case 0:  
{  
switch (_type) do  
{  
case "driver": {_var = "license_civ_driver"}; //Drivers License cost  
case "boat": {_var = "license_civ_boat"}; //Boating license cost  
case "pilot": {_var = "license_civ_air"}; //Pilot/air license cost  
case "gun": {_var = "license_civ_gun"}; //Firearm/gun license cost  
case "dive": {_var = "license_civ_dive"}; //Diving license cost  
case "oil": {_var = "license_civ_oil"}; //Oil processing license cost  
case "cair": {_var = "license_cop_air"}; //Cop Pilot License cost  
case "swat": {_var = "license_cop_swat"}; //Swat License cost  
case "cg": {_var = "license_cop_cg"}; //Coast guard license cost  
case "heroin": {_var = "license_civ_heroin"}; //Heroin processing license cost  
case "marijuana": {_var = "license_civ_marijuana"}; //Marijuana processing license cost  
case "medmarijuana": {_var = "license_civ_medmarijuana"}; //Medical Marijuana processing license cost  
case "gang": {_var = "license_civ_gang"}; //Gang license cost  
case "rebel": {_var = "license_civ_rebel"}; //Rebel License  
case "truck":{_var = "license_civ_truck"}; //Truck License  
case "diamond": {_var = "license_civ_diamond"};  
case "salt": {_var = "license_civ_salt"};  
case "cocaine": {_var = "license_civ_coke"};  
case "sand": {_var = "license_civ_sand"};  
case "iron": {_var = "license_civ_iron"};  
case "copper": {_var = "license_civ_copper"};  
case "cement": {_var = "license_civ_cement"};  
case "mair": {_var = "license_med_air"};  
case "home": {_var = "license_civ_home"};  
case "dogs": {_var = "license_civ_dogs"};  
default {_var = ""};  
};  
};  

case 1:  
{  
switch (_type) do  
{  
case "license_civ_driver": {_var = "driver"}; //Drivers License cost  
case "license_civ_boat": {_var = "boat"}; //Boating license cost  
case "license_civ_air": {_var = "pilot"}; //Pilot/air license cost  
case "license_civ_gun": {_var = "gun"}; //Firearm/gun license cost  
case "license_civ_dive": {_var = "dive"}; //Diving license cost  
case "license_civ_oil": {_var = "oil"}; //Oil processing license cost  
case "license_cop_air": {_var = "cair"}; //Cop Pilot License cost  
case "license_cop_swat": {_var = "swat"}; //Swat License cost  
case "license_cop_cg": {_var = "cg"}; //Coast guard license cost  
case "license_civ_heroin": {_var = "heroin"}; //Heroin processing license cost  
case "license_civ_marijuana": {_var = "marijuana"}; //Marijuana processing license cost  
case "license_civ_medmarijuana": {_var = "medmarijuana"}; //Medical Marijuana processing license cost  
case "license_civ_gang": {_var = "gang"}; //Gang license cost  
case "license_civ_rebel": {_var = "rebel"}; //Rebel License  
case "license_civ_truck":{_var = "truck"}; //Truck License  
case "license_civ_diamond": {_var = "diamond"};  
case "license_civ_salt": {_var = "salt"};  
case "license_civ_coke": {_var = "cocaine"};  
case "license_civ_sand": {_var = "sand"};  
case "license_civ_iron": {_var = "iron"};  
case "license_civ_copper": {_var = "copper"};  
case "license_civ_cement": {_var = "cement"};  
case "license_med_air": {_var = "mair"};  
case "license_civ_home": {_var = "home"};  
case "license_civ_dogs": {_var = "dogs"};  
default {_var = ""};  
};  
};  
};```

**fn_varToStr.sqf**  

//License Block
case “license_civ_driver”: {“Driver License”};
case “license_civ_air”: {“Pilot License”};
case “license_civ_heroin”: {“Heroin Training”};
case “license_civ_gang”: {“Gang License”};
case “license_civ_oil”: {“Oil Processing”};
case “license_civ_dive”: {“Diving License”};
case “license_civ_boat”: {“Boating License”};
case “license_civ_gun”: {“Firearm License”};
case “license_cop_air”: {“Pilot License”};
case “license_cop_swat”: {“Swat License”};
case “license_cop_cg”: {“Coast Guard”};
case “license_civ_rebel”: {“Rebel Training”};
case “license_civ_truck”: {“Truck License”};
case “license_civ_diamond”: {“Diamond Processing”};
case “license_civ_copper”: {“Copper Processing”};
case “license_civ_iron”: {“Iron Processing”};
case “license_civ_sand”: {“Sand Processing”};
case “license_civ_salt”: {“Salt Processing”};
case “license_civ_coke”: {“Cocaine Training”};
case “license_civ_marijuana”: {“Marijuana Training”};
case “license_civ_cement”: {“Cement Mixing License”};
case “license_med_air”: {“Pilot License”};
case “license_civ_home”: {“Home Owners License”};
case “license_civ_dogs”: {“Licence de possession de chien”};
};```

Et le pnj :

this addAction[format["%1 ($%2)",["license_civ_dogs"] call life_fnc_varToStr,[(["dogs"] call life_fnc_licensePrice)] call life_fnc_numberText],life_fnc_buyLicense,"dogs",0,false,false,"",' !license_civ_dogs && playerSide == civilian ']; ```

#6

Lewos voici le correctif de configuration.sqf :

//Setup variable inv vars.{missionNamespace setVariable[_x,0];} foreach life_inv_items;  
//Licenses [license var, civ/cop]  
life_licenses =  
[  
["license_cop_air","cop"],  
["license_cop_swat","cop"],  
["license_cop_cg","cop"],  
["license_civ_driver","civ"],  
["license_civ_air","civ"],  
["license_civ_heroin","civ"],  
["license_civ_marijuana","civ"],  
["license_civ_gang","civ"],  
["license_civ_boat","civ"],  
["license_civ_oil","civ"],  
["license_civ_dive","civ"],  
["license_civ_truck","civ"],  
["license_civ_gun","civ"],  
["license_civ_rebel","civ"],  
["license_civ_coke","civ"],  
["license_civ_diamond","civ"],  
["license_civ_copper","civ"],  
["license_civ_iron","civ"],  
["license_civ_sand","civ"],  
["license_civ_salt","civ"],  
["license_civ_cement","civ"],  
["license_med_air","med"],  
["license_civ_home","civ"],  //Ligne ou tu avais oublié la virgule  
["license_civ_dogs", "civ"]  
];  

en gras rouge c’est là ou tu avais oublié une virgule, ça devrait fonctionner maintenant :slight_smile:


#7

La virgule qui tue, je n’avais même pas fait attention^^ je test cela, merci


#8

Lewos c’est vrai que cette virgule… :lol:


#9

ça marche, merci :smiley: