Français [Fuel Stations] Transférer l'argent du remplissage à une entreprise

  • Auteur de la discussion Auteur de la discussion Enzo2991
  • Date de début Date de début

Enzo2991

User
2/2/20
120
19
25
1 150
Bienvenue dans ce tutoriel qui vous permettra de transféré l'argent du remplissage a une entreprise
Ce tutoriel fait suite à la demande de JNR 01 JNR 01

Tout d'abord, aller dans le dossier @The_Programmer/addons/fuel_stations/client/ et trouver le fichier fn_refuelStation.sqf
Ensuite, remplacer ces lignes
Code:
life_cash = life_cash + _totalcost;
[1] call SOCK_fnc_updatePartial;
par :
[CODE highlight="1"]_IDEntreprise = 1; //---> Remplacer le numero par L'id de votre entreprise(dans la base de donnée)
_entreprise = objNull;
{
_id = _x select 0;
_entreprise = _x select 1;
if (_id isequalto _IDEntreprise) exitWith {_entreprise = _x select 1;};
}foreach maxence_all_entreprises;

_oldEntACC = _entreprise getVariable ["entreprise_bankacc",0];
_oldEntACC = _oldEntACC + _totalcost;
_entreprise setVariable ["entreprise_bankacc",_oldEntACC,true];
[(_entreprise getVariable ["entreprise_id",0]),5,(_entreprise getVariable ["entreprise_bankacc",0])] remoteExecCall ["max_entreprise_fnc_updateEntreprise",2];
[_entreprise,format ["%1 (ravitaillement station)",(name player)],_totalcost,2] remoteExecCall ["max_entreprise_fnc_insertEntrepriseLogs",2];[/CODE]

Vous pouvez remplacer le numéro 1 a la première ligne par l'id de votre entreprise qui recevra l'argent.

Cordialement,
Forum Moderator Enzo2991, avec la collaboration de JNR 01 JNR 01
 
Dernière édition par un modérateur:
  • Like
Les réactions: JNR 01

vdgrg-ConvertImage.png



Bienvenue dans ce tutoriel qui vous permettra de transféré l'argent du remplissage a une entreprise
Ce tutoriel fait suite à la demande de JNR 01 JNR 01

Tout d'abord, aller dans le dossier @The_Programmer/addons/fuel_stations/client/ et trouver le fichier fn_refuelStation.sqf
Ensuite, remplacer ces lignes
Code:
life_cash = life_cash + _totalcost;
[1] call SOCK_fnc_updatePartial;
par :
[CODE highlight="1"]_IDEntreprise = 1; //---> Remplacer le numero par L'id de votre entreprise(dans la base de donnée)
_entreprise = objNull;
{
_id = _x select 0;
_entreprise = _x select 1;
if (_id isequalto _IDEntreprise) exitWith {_entreprise = _x select 1;};
}foreach maxence_all_entreprises;

_oldEntACC = _entreprise getVariable ["entreprise_bankacc",0];
_oldEntACC = _oldEntACC + _totalcost;
_entreprise setVariable ["entreprise_bankacc",_oldEntACC,true];
[(_entreprise getVariable ["entreprise_id",0]),5,(_entreprise getVariable ["entreprise_bankacc",0])] remoteExecCall ["max_entreprise_fnc_updateEntreprise",2];
[_entreprise,format ["%1 (ravitaillement station)",(name player)],_totalcost,2] remoteExecCall ["max_entreprise_fnc_insertEntrepriseLogs",2];[/CODE]

Vous pouvez remplacer le numéro 1 a la première ligne par l'id de votre entreprise qui recevra l'argent.

Cordialement,
Forum Moderator Enzo2991, avec la collaboration de JNR 01 JNR 01
Il y as aussi une modification a faire dans la bdd sur entrepriselogs :
de base la table name fait max 32 char si le nom du joueur est long veuillez modifier et mettre 255 comme ceci :

2020-10-26_12h46_26.png
 
Dernière édition:
Hello there,

how can i make this for every gas station? so here´s an example:

1. gas station for entreprise 1
2. gas station for entreprise 2
 
Hello S SeCTioN !
The easiest way to do this is to add a variable like this to the pump init :
Code:
this setVariable ["pump_entreprise_id",1];
You can edit the company ID by editing the 1 here.

And in the tutorial, instead of this line :
Code:
_IDEntreprise = 1;
We get the variable from the pump :
Code:
_IDEntreprise = _pump getVariable ["pump_entreprise_id",1];
Here the 1 is the default company ID if the variable is not set in the init of the pump.
 
Hello Solestraa Solestraa, dans le même fichier que ce tutoriel, remplace ces lignes :
Code:
life_cash = life_cash + _totalcost;
[1] call SOCK_fnc_updatePartial;
par :
Code:
maxence_compte_gouv = maxence_compte_gouv + _totalcost;
publicVariable "maxence_compte_gouv";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,maxence_compte_east,(name player),3,0,_totalcost,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];