Français Not solved Script de compte d'utilisateur paintball fonctionne seulement en local

  • Auteur de la discussion Auteur de la discussion cadnalex
  • Date de début Date de début
  • Bonjour Visiteur ! Les sujets de cette catégorie sont clos. Si vous souhaitez réouvrir, merci de nous contacter en précisant le lien du post à réouvrir !

    Hello Visiteur ! The topics in this category are closed. If you wish to reopen, please contact us with the link of the post you wish to reopen !

cadnalex

User
14/5/22
51
5
3
300
Didacticiel https://native-network.net/forum/thread/65-tutorial-paintball-script/

[CODE lang="csharp" title="pb_join.sqf-original"]if (joinmode==0) then {
_PUID = getPlayerUID player;
_spielerGeld = life_cash;
hint "Eine Anfrage wurde an den Server gesendet, bitte warte einen Moment";
[[_PUID,_spielerGeld],"TON_fnc_paintball",false,false] spawn life_fnc_MP;
joinmode = 1;
} else {
hint "Du bist der Lobby bereits beigetreten, versuche es später noch einmal!";
};[/CODE]
[CODE lang="csharp" title="pb_join.sqf-modifié"]if (joinmode==0) then {
_PUID = getPlayerUID player;
_spielerGeld = RJM_GRANA;
hint "Uma solicitação foi enviada ao servidor, aguarde um momento";
[_PUID,_spielerGeld], remoteExecCall ["TON_fnc_paintball",false];
joinmode = 1;
} else {
hint "Você já entrou no lobby, tente novamente mais tarde!";
};[/CODE]
[CODE lang="csharp" title="fn_pb_response.sqf-original"]private["_respondmode","_message"];




_respondmode = [_this,0,0,[0]] call BIS_fnc_param;




if (_respondmode==1) then {
_message = [_this,1,"",[""]] call BIS_fnc_param;
hint format ["%1",_message];
};
seulement ça n'a pas marché.



if (_respondmode==2) then {
player addEventHandler ["handleDamage", {false}];
playMusic "LeadTrack02_F_Bootcamp";
hint "Willkommen in der Paintballarena! Das kommende Spiel wird 5 Minuten gehen, viel Spaß!";
meinePos = getPos player;
[] call life_fnc_saveGear;
player enableFatigue false;
meingear = life_gear;
life_gear set [16,[]];
RemoveAllWeapons player;
{player removeMagazine _x;} foreach (magazines player);
removeUniform player;
removeVest player;
removeBackpack player;
removeGoggles player;
removeHeadGear player;
player forceAddUniform "U_I_Protagonist_VR";
player addWeaponGlobal "hgun_Pistol_heavy_02_Yorris_F";
player addMagazines ["6Rnd_45ACP_Cylinder" , 25];
{
player unassignItem _x;
player removeItem _x;
} foreach (assignedItems player);
player allowDamage false;
_wohin = round(random (count pb_positionen));
if (_wohin==count pb_positionen) then {_wohin=_wohin-1;};
_position = pb_positionen select _wohin;
player setPos _position;
tode = 0;
player addEventHandler ["Hit", {
_wohin = round(random (count pb_positionen));
if (_wohin==count pb_positionen) then {_wohin=_wohin-1;};
_position = pb_positionen select _wohin;
player setPos _position;
tode = tode+1;
_maxGeld = 100;
_grenzeAusz = 30;
_geldTod = _maxGeld/_grenzeAusz;
_punkte = _grenzeAusz-tode;
hintSilent parseText format ["<t align='center' color='#00E500' size='1.3'>Statistik</t><br/><br/><t align='left'>Tode</t><t align='right'>%1</t><br/><t align='left'>Punkte</t><t align='right'>%2</t>",tode,_punkte];
}];
};




if (_respondmode==3) then {
life_gear = meingear;
[] spawn life_fnc_Loadgear;
player setPos meinePos;
player allowDamage true;
player removeAllEventHandlers "Hit";
player addEventHandler["handleDamage",{_this call life_fnc_handleDamage;}];
player enableFatigue true;
_grenzeAusz = 30;
if (tode>=_grenzeAusz) then {
hint "Das Spiel wurde beendet. Leider hast du nicht genügend Punkte erspielt, um einen Geldpreis zu erhalten!";
} else {
_maxGeld = 100;
_geldTod = _maxGeld/_grenzeAusz;
_punkte = _grenzeAusz-tode;
_geldMin= _geldTod*tode;
_gesamt = _maxGeld-_geldMin;
life_cash = life_cash + _gesamt;
hint format ["Das Spiel wurde beendet. Du hast insgesamt %1 Punkte erspielt und einen Geldpreis ($%2) erhalten. Glückwunsch!",_punkte,_gesamt];
};
};




if (_respondmode==4) then {playMusic "LeadTrack06_F";};




if (_respondmode==5) then {
_message = [_this,1,"",[""]] call BIS_fnc_param;
hint format ["%1",_message];
life_cash = life_cash - 100;
};[/CODE]
[CODE lang="csharp" title="fn_pb_response.sqf-modifié"]private["_respondmode","_message"];




_respondmode = [_this,0,0,[0]] call BIS_fnc_param;




if (_respondmode==1) then {
_message = [_this,1,"",[""]] call BIS_fnc_param;
hint format ["%1",_message];
};




if (_respondmode==2) then {
player addEventHandler ["handleDamage", {false}];
playMusic "LeadTrack02_F_Bootcamp";
hint "Bem-vindo à arena de paintball! O próximo jogo durará 5 minutos, divirta-se!";
meinePos = getPos player;
[] call life_fnc_saveGear;
player enableFatigue false;
meingear = life_gear;
life_gear set [16,[]];
RemoveAllWeapons player;
{player removeMagazine _x;} foreach (magazines player);
removeUniform player;
removeVest player;
removeBackpack player;
removeGoggles player;
removeHeadGear player;
player forceAddUniform "U_I_Protagonist_VR";
player addWeaponGlobal "hgun_Pistol_heavy_02_Yorris_F";
player addMagazines ["6Rnd_45ACP_Cylinder" , 25];
{
player unassignItem _x;
player removeItem _x;
} foreach (assignedItems player);
player allowDamage false;
_wohin = round(random (count pb_positionen));
if (_wohin==count pb_positionen) then {_wohin=_wohin-1;};
_position = pb_positionen select _wohin;
player setPos _position;
tode = 0;
player addEventHandler ["Hit", {
_wohin = round(random (count pb_positionen));
if (_wohin==count pb_positionen) then {_wohin=_wohin-1;};
_position = pb_positionen select _wohin;
player setPos _position;
tode = tode+1;
_maxGeld = 100;
_grenzeAusz = 30;
_geldTod = _maxGeld/_grenzeAusz;
_punkte = _grenzeAusz-tode;
hintSilent parseText format ["<t align='center' color='#00E500' size='1.3'>Statistik</t><br/><br/><t align='left'>Mortes</t><t align='right'>%1</t><br/><t align='left'>Punkte</t><t align='right'>%2</t>",tode,_punkte];
}];
};




if (_respondmode==3) then {
life_gear = meingear;
[] spawn life_fnc_Loadgear;
player setPos meinePos;
player allowDamage true;
player removeAllEventHandlers "Hit";
player addEventHandler["handleDamage",{_this call life_fnc_handleDamage;}];
player enableFatigue true;
_grenzeAusz = 30;
if (tode>=_grenzeAusz) then {
hint "O jogo terminou. Infelizmente, você não ganhou pontos suficientes para receber um prêmio em dinheiro!";
} else {
_maxGeld = 100;
_geldTod = _maxGeld/_grenzeAusz;
_punkte = _grenzeAusz-tode;
_geldMin= _geldTod*tode;
_gesamt = _maxGeld-_geldMin;
RJM_GRANA = RJM_GRANA + _gesamt;
hint format ["O jogo terminou. você tem total %1 Ganhe pontos e um prêmio em dinheiro ($%2) receber. Parabéns!",_punkte,_gesamt];
};
};




if (_respondmode==4) then {playMusic "LeadTrack06_F";};




if (_respondmode==5) then {
_message = [_this,1,"",[""]] call BIS_fnc_param;
hint format ["%1",_message];
RJM_GRANA = RJM_GRANA - 100;
};[/CODE]
[CODE title="fn_ryn_message.sqf"]private["_titel","_message"];




_titel = [_this,0,"",[""]] call BIS_fnc_param;
_message = [_this,1,"",[""]] call BIS_fnc_param;




_hint = parseText format ["<t color='#ffff00'>%1</t><br/><br/><t color='#FFFFFF'>%2</t>", _titel,_message];




hint _hint;[/CODE]
[CODE title="fn_game.sqf-original"]pb_spielstatus=1;
[["Paintballarena","Ein Spieler hat soeben eine Lobby in der Paintballarena eröffnet! Die Lobby schließt sich in 60 Sekunden!"],"life_fnc_ryn_message",true,false] spawn life_fnc_MP;
sleep 60;




if (count pb_spieler>=2) then {




pb_spielstatus=2;
{
[[2],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
sleep 60;
_msg = "Das Spiel läuft noch 4 Minuten";
{
[[1,_msg],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
sleep 60;
_msg = "Das Spiel läuft noch 3 Minuten";
{
[[1,_msg],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
sleep 60;
_msg = "Das Spiel läuft noch 2 Minuten";
{
[[1,_msg],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
sleep 60;
_msg = "Das Spiel läuft noch eine Minute!";
{
[[1,_msg],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
[[4],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
sleep 60;
{
[[3],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
pb_spieler = [];
pb_spielstatus = 0;
joinmode = 0;
publicVariable "joinmode";




} else {




_msg = "Da zu wenig Spieler sich in der Lobby befanden wurde das Spiel abgebrochen!";
{
[[1,_msg],"life_fnc_pb_response",_x,false] spawn life_fnc_MP;
} forEach pb_spieler;
pb_spieler = [];
pb_spielstatus=0;
joinmode = 0;
publicVariable "joinmode";




};[/CODE]
[CODE lang="csharp" title="fn_game.sqf-modifié"]pb_spielstatus=1;
["Paintballarena","Um jogador acaba de abrir um lobby no Paintball Arena! O lobby fechará em 60 segundos!"] remoteExecCall ["life_fnc_ryn_message",true];
sleep 60;




if (count pb_spieler>=2) then {




pb_spielstatus=2;
{
[2] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
sleep 60;
_msg = "O jogo ainda tem 4 minutos";
{
[1,_msg] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
sleep 60;
_msg = "O jogo ainda tem 3 minutos";
{
[1,_msg] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
sleep 60;
_msg = "O jogo ainda tem 2 minutos";
{
[1,_msg] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
sleep 60;
_msg = "O jogo ainda tem 1 minuto!";
{
[1,_msg] remoteExecCall ["life_fnc_pb_response",_x];
[4] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
sleep 60;
{
[3] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
pb_spieler = [];
pb_spielstatus = 0;
joinmode = 0;
publicVariable "joinmode";




} else {




_msg = "Como não havia jogadores suficientes no lobby, o jogo foi cancelado!";
{
[1,_msg] remoteExecCall ["life_fnc_pb_response",_x];
} forEach pb_spieler;
pb_spieler = [];
pb_spielstatus=0;
joinmode = 0;
publicVariable "joinmode";




};[/CODE]
[CODE lang="csharp" title="fn_paintball.sqf-original"]private["_uid"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;




if (count pb_spieler==0&&pb_spielstatus==0) then {
[[],"TON_fnc_game",false,false] spawn life_fnc_MP;
pb_spielstatus = 1;
};




if (pb_spielstatus==1) then {
_uidarr = [_uid];
_geld = [_this,1,0,[0]] call BIS_fnc_param;
if (_geld>=5000) then {
pb_spieler = pb_spieler + _uidarr;
[[5,"Du wurdest erfolgreich für das kommende Spiel angemeldet!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
} else {
[[1,"Du hast keine 5000 Dollar bei dir!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
};
};




if ((pb_spielstatus==2&&count pb_spieler>=2)||(count pb_spieler==pb_maxspieler)) then {
[[1,"Leider hat das Spiel bereits begonnen oder die Lobby ist bereits voll, versuche es später noch einmal!"],"life_fnc_pb_response",_uid,false] spawn life_fnc_MP;
};[/CODE]
[CODE lang="csharp" title="fn_paintball.sqf-modifié"]private["_uid"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;




if (count pb_spieler==0&&pb_spielstatus==0) then {
[] remoteExecCall ["TON_fnc_game",false];
pb_spielstatus = 1;
};




if (pb_spielstatus==1) then {
_uidarr = [_uid];
_geld = [_this,1,0,[0]] call BIS_fnc_param;
if (_geld>=5000) then {
pb_spieler = pb_spieler + _uidarr;
[5,"Você foi registrado com sucesso para o próximo jogo!"] remoteExecCall ["life_fnc_pb_response",_uid];
} else {
[1,"Você não tem $ 5000 em você!"] remoteExecCall ["life_fnc_pb_response",_uid];
};
};




if ((pb_spielstatus==2&&count pb_spieler>=2)||(count pb_spieler==pb_maxspieler)) then {
[1,"Desculpe, o jogo já começou ou o lobby já está cheio, tente novamente mais tarde!"] remoteExecCall ["life_fnc_pb_response",_uid];
};[/CODE]

la seule chose que j'ai faite différente du tutoriel était
[CODE title="Config_RemoteExec.hpp"]F(TON_fnc_paintball,ANYONE)
F(TON_fnc_game,ANYONE)
F(life_fnc_ryn_message,ANYONE)
F(life_pb_response,ANYONE)[/CODE]

ça ne marche pas est-ce que quelqu'un peut m'aider?
 
ça ne marche tout simplement pas, le script vient de la v3 et je suis sur la v5, j'ai lu sur certains forums qu'il passait juste à remoteexec mais ça n'a pas marché.
 
Dans ton pb_join.sqf il y a une virgule en trop ici :
Code:
[_PUID,_spielerGeld], remoteExecCall ["TON_fnc_paintball",false];
C'est plutôt comme ça :
Code:
[_PUID,_spielerGeld] remoteExecCall ["TON_fnc_paintball",2];

S'il y a toujours un problème, est-ce que tu peux envoyer tes logs serveur et client ?
 
Dernière édition:
Ok so the problem is that you have to specify on what object you remoteExec, false is not a valid value here :
Code:
[] remoteExecCall ["TON_fnc_game",false];
You have to replace false by 2.

Same for :
Code:
[_PUID,_spielerGeld] remoteExecCall ["TON_fnc_paintball",false];
 
[CODE title="modificado"]pb_spielstatus=1;
["Paintballarena","Um jogador acaba de abrir um lobby no Paintball Arena! O lobby fechará em 60 segundos!"] remoteExecCall ["life_fnc_ryn_message",-2];
sleep 60;

if (count pb_spieler>=2) then {
pb_spielstatus=2;
{[2] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
sleep 60;

_msg = "O jogo ainda tem 4 minutos";
{[1,_msg] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
sleep 60;

_msg = "O jogo ainda tem 3 minutos";
{[1,_msg] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
sleep 60;

_msg = "O jogo ainda tem 2 minutos";
{[1,_msg] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
sleep 60;

_msg = "O jogo ainda tem 1 minuto!";
{[1,_msg] remoteExec ["life_fnc_pb_response",_x];
[4] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
sleep 60;

{[3] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;

pb_spieler = [];
pb_spielstatus = 0;
joinmode = 0;
publicVariable "joinmode";
} else {
_msg = "Como não havia jogadores suficientes no lobby, o jogo foi cancelado!";
{[1,_msg] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;
pb_spieler = [];
pb_spielstatus=0;
joinmode = 0;
publicVariable "joinmode";
};[/CODE]

jusqu'à ce que la ligne 3 fonctionne à partir de là non, pas d'erreurs dans le journal.
 
J'ai mis celui que tu m'as envoyé mais c'est toujours pareil.pas d'erreur de log.
[CODE title="que signifie _x ?"]{[2] remoteExec ["life_fnc_pb_response",_x];} forEach pb_spieler;[/CODE]
 
Ici _x correspond à chaque élément de pb_spieler : https://community.bistudio.com/wiki/Magic_Variables

Honnêtement c'est difficile de t'aider sur ce script, je ne sais pas comment il est sensé fonctionner. Le plus simple serait de demander au créateur du script pour ça.
Je ne peux que corriger les erreurs de syntaxe mais si la logique du script est pas bonne, c'est bien plus compliqué pour moi 😅
 
J'ai essayé de contacter le propriétaire et je n'ai pas pu.
le problème qui se produit est que les joueurs ne sont pas définis avec la variable pb_spieler.
 
Je ne sais pas pourquoi ça ne fonctionne pas à première vue.
Il faudrait que je lise et comprenne le code et le but du script, c'est très long, je ne pourrais pas faire cela ici, désolé :cry:
Pourriez-vous me diriger vers quelqu'un qui offre le service de réparation? selon le prix et même mieux.
 
Je vais essayer de le recréer, mais il y a des choses que je ne sais pas.
J'espère que ce n'est pas un problème pour vous que je demande ici.
la première chose que j'ai faite a été l'init, je l'ai mis comme ça.

NPC
_null=this execVM "core\paintball\pb_join.sqf";

dossier pb_join.sqf
[CODE title="pb_join.sqf"]_this allowDamage false;
_this enableSimulation false;
_this addAction["inscriçao Paintibal",TON_fnc_joinpaintball];[/CODE]

life_server\Functions\paintball\fn_joinpaintball.sqf
[CODE title="fn_joinpaintball.sqf"]if (player getVariable ["pb_spieler",false]) then {
_PUID = getPlayerUID player;
_spielerGeld = RJM_BANCO;
hint "Você já entrou no lobby, tente novamente mais tarde!";
player setVariable ['pb_spieler',false];
[_PUID,_spielerGeld] remoteExec ["TON_fnc_paintball",2];
joinmode = 1;
} else {
hint "sua escriçao foi enviada para central, aguarde um momento";
player setVariable ['pb_spieler',false];
};[/CODE]

life_server\config.cpp
[CODE title="config.cpp"] class TON_System {
...
class Paintball {
file = "\life_server\Functions\paintball";
class paintball {};
class game {};
class joinpaintball {};
};
...[/CODE]
mais apparemment ç'est faux parce que rien ne se passe.
 
Qu'ai-je fait de mal?
Code:
private ["_tax","_Pon"];
_tax = 5000;
_Pon = count pb_spieler;
if (_tax > RJM_BANCO) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
sleep 60;
if (count pb_spieler >= 2) then {
    { hint format ["Teste: %1",_Pon];};
    [false,0,_tax] Call RJM_fnc_AtualizarGrana;
    [] remoteExec ["TON_fnc_game",2];
} else {
    { hint format ["Teste: %1",_Pon];};
    [false,1,_tax] Call RJM_fnc_AtualizarGrana;
    player setVariable ['pb_spieler',false];
};

Code:
Error in expression <00;
_Pon = count pb_spieler;
if (_tax > RJM_BANCO) exitWith {hint localize "STR_>
  Error position: <RJM_BANCO) exitWith {hint localize "STR_>
  Error Undefined variable in expression: rjm_banco
File life_server\Functions\paintball\fn_paintball.sqf..., line 26
Error in expression <00;
_Pon = count pb_spieler;
if (_tax > RJM_BANCO) exitWith {hint localize "STR_>
  Error position: <RJM_BANCO) exitWith {hint localize "STR_>
  Error Undefined variable in expression: rjm_banco
File life_server\Functions\paintball\fn_paintball.sqf..., line 26
Error in expression <00;
_Pon = count pb_spieler;
if (_tax > RJM_BANCO) exitWith {hint localize "STR_>
  Error position: <RJM_BANCO) exitWith {hint localize "STR_>
  Error Undefined variable in expression: rjm_banco
File life_server\Functions\paintball\fn_paintball.sqf..., line 26
Error in expression <int format ["Teste: %1",count pb_spieler;];>
  Error position: <;];>
  Error Missing ]
Error in expression <int format ["Teste: %1",count pb_spieler;];>
  Error position: <;];>
  Error Missing ]