English Solved Sharing Phone Numbers with Other Players in IPhone XI

  • Auteur de la discussion Auteur de la discussion Bundestag
  • Date de début Date de début
  • Tags Tags
    help

Bundestag

User
3/4/21
25
1
1
300
I saw some Server using a system that allows sharing the Phone Number, via scroll menu, to other Players.
I think the system adds yourself as a contact to the other players contact list.

I hope someone can help me out.
 
Solution
To complete FiQ FiQ response, you will need to create a new file in your mission e.g. fn_addMeInContact.sqf with :
Code:
_player = param [0,objNull,[objNull]];
if (isNull _player) exitWith {};

_number = _player getVariable ["maxence_numero","0"];
if (_number isEqualTo "0") exitWith {};

maxence_contact pushBackUnique [(name _player),_number];
[(getPlayerUID player),(player getVariable ["maxence_numero",""]),maxence_contact] remoteExec ["max_phone_fnc_updatePhone",2];
hint format ["%1 was added to your contacts !",(name _player)];

You will need to add this function to your Functions.hpp and to your CfgRemoteExec.hpp :
Code:
F(life_fnc_addMeInContact,CLIENT)

Then you just have to call this function like this ...
hopefully it helps, it's not hard to make addAction out of this

C++:
player getVariable ["maxence_numero","0"]; //get player number

maxence_contact pushBackUnique [_name,_number]; //adds to contact list
Don’t forget to define _name and _number
 
To complete FiQ FiQ response, you will need to create a new file in your mission e.g. fn_addMeInContact.sqf with :
Code:
_player = param [0,objNull,[objNull]];
if (isNull _player) exitWith {};

_number = _player getVariable ["maxence_numero","0"];
if (_number isEqualTo "0") exitWith {};

maxence_contact pushBackUnique [(name _player),_number];
[(getPlayerUID player),(player getVariable ["maxence_numero",""]),maxence_contact] remoteExec ["max_phone_fnc_updatePhone",2];
hint format ["%1 was added to your contacts !",(name _player)];

You will need to add this function to your Functions.hpp and to your CfgRemoteExec.hpp :
Code:
F(life_fnc_addMeInContact,CLIENT)

Then you just have to call this function like this :
Code:
[player] remoteExec ["life_fnc_addMeInContact",cursorObject];
 
  • Like
Les réactions: FiQ
Solution