Français [Government System] Envoyer le prix d'une amende sur le compte gendarmerie

  • Auteur de la discussion Auteur de la discussion I'm the Boss
  • Date de début Date de début

I'm the Boss

Leader
Membre du personnel
2/1/20
696
3
44
1 100
Bonjour !
Ce tuto sera en rapport avec le script du Government System vendu par The Programmer.​


Il peut être adapté pour n'importe quoi pour ma part l'intégralité des mise en fourrière, sortie de fourrière, saisi le sont automatiquement aussi.

  • Rendez vous dans /core/cop/fn_ticketPaid.sqf
Il faudra supprimer ces lignes
Code:
BANK = BANK + _value;
[1] call SOCK_fnc_updatePartial;

Et ajouter cela à la place
Code:
maxence_compte_cop = maxence_compte_cop + _value;
publicVariable "maxence_compte_cop";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,maxence_compte_east,(name player),3,1,_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];

Votre fichier devrait ressembler à cela
Code:
#include "..\..\script_macros.hpp"
/*
    File: fn_ticketPaid.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Verifies that the ticket was paid.
*/
params [
    ["_value",5,[0]],
    ["_unit",objNull,[objNull]],
    ["_cop",objNull,[objNull]]
];
if (isNull _unit || {!(_unit isEqualTo life_ticket_unit)}) exitWith {}; //NO
if (isNull _cop || {!(_cop isEqualTo player)}) exitWith {}; //Double NO

maxence_compte_cop = maxence_compte_cop + _value;
publicVariable "maxence_compte_cop";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,maxence_compte_east,(name player),3,1,_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];

Vous voila fin prêt à faire un système complexe de prime sur un google sheet ahah !

Pour une modification d'un autre système de Tonic en rapport avec l'argent ou même un de The-Programmer vous pouvez me contactez sur Discord si besoin. (ẔΛ尺Øら
#4708)
 
Dernière édition par un modérateur:
  • Like
Les réactions: IGS Apex et Enzo2991
[CODE title="Est-ce correct comme ça"]#include "..\..\script_macros.hpp"
/*
File: fn_ticketPaid.sqf
Author: Bryan "Tonic" Boardwine

Description:
Verifies that the ticket was paid.
*/
params [
["_value",5,[0]],
["_unit",objNull,[objNull]],
["_cop",objNull,[objNull]]
];
if (isNull _unit || {!(_unit isEqualTo life_ticket_unit)}) exitWith {}; //NO
if (isNull _cop || {!(_cop isEqualTo player)}) exitWith {}; //Double NO

maxence_compte_cop = maxence_compte_cop + _value;
publicVariable "maxence_compte_cop";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,(name player),(name player),(["STR_COP_ACCOUNT","Max_Settings_Gouvernement","Gouvernement_Localization"] call theprogrammer_core_fnc_localize),_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];

life_ticket_paid = true;

[0,"STR_Cop_Ticket_PaidNOTF",true,[profileName,[life_ticket_val] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",west];
[1,"STR_Cop_Ticket_PaidNOTF_2",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
[life_ticket_val,player,life_ticket_cop] remoteExecCall ["life_fnc_ticketPaid",life_ticket_cop];

if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
closeDialog 0;
};

CASH = CASH - life_ticket_val;
[0] call SOCK_fnc_updatePartial;
life_ticket_paid = true;

if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};

[0,"STR_Cop_Ticket_PaidNOTF",true,[profileName,[life_ticket_val] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",west];
closeDialog 0;
[1,"STR_Cop_Ticket_PaidNOTF_2",true,[profileName]] remoteExecCall ["life_fnc_broadcast",life_ticket_cop];
[life_ticket_val,player,life_ticket_cop] remoteExecCall ["life_fnc_ticketPaid",life_ticket_cop];[/CODE]
 
[CODE title="ou alors?"]#include "..\..\script_macros.hpp"
/*
File: fn_ticketPaid.sqf
Author: Bryan "Tonic" Boardwine

Description:
Verifies that the ticket was paid.
*/
params [
["_value",5,[0]],
["_unit",objNull,[objNull]],
["_cop",objNull,[objNull]]
];
if (isNull _unit || {!(_unit isEqualTo life_ticket_unit)}) exitWith {}; //NO
if (isNull _cop || {!(_cop isEqualTo player)}) exitWith {}; //Double NO

maxence_compte_cop = maxence_compte_cop + _value;
publicVariable "maxence_compte_cop";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,(name player),(name player),(["STR_COP_ACCOUNT","Max_Settings_Gouvernement","Gouvernement_Localization"] call theprogrammer_core_fnc_localize),_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];[/CODE]
 
A noté qu'avec la mise à jour du Government System il faut rajouter le compte adac, comme ceci :

Code:
maxence_compte_cop = maxence_compte_cop + _value;
publicVariable "maxence_compte_cop";
[maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,maxence_compte_east,(name player),(name player),(["STR_COP_ACCOUNT","Max_Settings_Gouvernement","Gouvernement_Localization"] call theprogrammer_core_fnc_localize),_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];

Sinon la fonction updateAccounts retourne une erreur.
 
Dernière édition:
  • Like
Les réactions: Maxence