Jump to content
IceEagle132

[Tutorial] Civ Passeport

Recommended Posts

Difficulty: Easy

Create Original Idea : Black Lagoon

Authors:  Heimdall & AltisAurore.fr

Source:  Link

Create a new file in core\civilian and name it: "fn_civPasseport.sqf"
/*  
	Montrer son passeport   
@Author : Heimdall @AltisAurore.fr  
*/  

private["_target","_message"];  

_target = cursorTarget;  

if(playerSide != civilian) exitWith  
{  
    hint "You're not a citizen!";  
};  

if( isNull _target) then {_target = player;};  

if( !(_target isKindOf "Man") ) then {_target = player;};  

if( !(alive _target) ) then {_target = player;};  

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Civilian Of Altis(edit depend the map)</t>", name player];  

[player, _message] remoteExec ["life_fnc_passeportCiv",_target];

 

Then open file "CfgRemoteExec.hpp" And add

F(life_fnc_passeportCiv,CLIENT)

 

 
Then, create a second file in core\civilian and name it: "fn_passeportCiv.sqf"
/*  
File : fn_PasseportCiv.sqf  
Create Original Idea : Black Lagoon  
Edit : Heimdall @AltisAurore.fr  
*/  

private["_msg"];  
_msg = _this select 1;  
hintSilent parseText _msg;

 

 
Go to "functions.h" file and below the "class civilian ", add :
class passeportCiv {};  
class civPasseport {};
Then in the core folder open file "fn_setupActions.sqf" add inside of "case civilian"
//Passport 
	life_actions = life_actions + [player addAction["<t color='#00FF00'>Present the passport</t>",life_fnc_civPasseport,"",1,false,true,"",' playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" ']];

Then add the "civ.paa" into your icons folder:

 

civ.paa

Edited by AlaskaVet
Updated to work for 4.4+
  • Like 3

Share this post


Link to post
Share on other sites
7 hours ago, Don Veska said:

Thanks but don't work, I have interaction to present but player didn't receive (sorry for my english) 

RPT?

Share this post


Link to post
Share on other sites

Captain here:

To use this script in 4.4 and newer versions you simply have to replace 

[[player, _message],"life_fnc_passeportCiv",_target,false] spawn life_fnc_MP;

by

[player, _message] remoteExec ["life_fnc_passeportCiv",_target];

and add in your CfgRemoteExec.hpp at class Functions the following line:

F(life_fnc_passeportCiv,CLIENT)

 

Now it should work for 4.4 and newer as well. Captain out *flies away* 10kimp_jetpack_tif_2273739g.jpg

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, HeWhoMustNotBeNamed said:

Hey can you maybe help me to make a police badge with this. 

would be nice :)

 

Simply change the file names like civ by cop, modify the playerSide check and edit the image name.

Greets.

Share this post


Link to post
Share on other sites

by cop don t work :(  files fn_copPasseport.sqf and fn_passeportCop.sqf
//Passport 
    life_actions = life_actions + [player addAction["<t color='#00FF00'>pokaz</t>",life_fnc_copPasseport,"",1,false,true,"",' playerSide == cop && !isNull cursorTarget && cursorTarget isKindOf "Man" ']];

and 

 

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Policja Altis(edit depend the map)</t>", name player];  

[player, _message] remoteExec ["life_fnc_passeportCop",_target];

Share this post


Link to post
Share on other sites
1 hour ago, sniferpl said:

by cop don t work :(  files fn_copPasseport.sqf and fn_passeportCop.sqf
//Passport 
    life_actions = life_actions + [player addAction["<t color='#00FF00'>pokaz</t>",life_fnc_copPasseport,"",1,false,true,"",' playerSide == cop && !isNull cursorTarget && cursorTarget isKindOf "Man" ']];

and 

 

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Policja Altis(edit depend the map)</t>", name player];  

[player, _message] remoteExec ["life_fnc_passeportCop",_target];

i did the exact same thing first time its not cop for the player side its

if(playerSide != west) exitWith  

 

so switch the == cop in that file to west and then in your core file change the same thing over

private["_target","_message"];  

_target = cursorTarget;  

if(playerSide != west) exitWith  
{  
    hint "You're not a cop!";  
};  
 

 

Share this post


Link to post
Share on other sites
On 18/9/2016 at 3:37 AM, IceEagle132 said:

Difficulty: Easy

Create Original Idea : Black Lagoon

Authors:  Heimdall & AltisAurore.fr

Source:  Link

Create a new file in core\civilian and name it: "fn_civPasseport.sqf"
/*  
	Montrer son passeport   
@Author : Heimdall @AltisAurore.fr  
*/  

private["_target","_message"];  

_target = cursorTarget;  

if(playerSide != civilian) exitWith  
{  
    hint "You're not a citizen!";  
};  

if( isNull _target) then {_target = player;};  

if( !(_target isKindOf "Man") ) then {_target = player;};  

if( !(alive _target) ) then {_target = player;};  

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Civilian Of Altis(edit depend the map)</t>", name player];  

[player, _message] remoteExec ["life_fnc_passeportCiv",_target];

 

Then open file "CfgRemoteExec.hpp" And add

F(life_fnc_passeportCiv,CLIENT)

 

 
Then, create a second file in core\civilian and name it: "fn_passeportCiv.sqf"
/*  
File : fn_PasseportCiv.sqf  
Create Original Idea : Black Lagoon  
Edit : Heimdall @AltisAurore.fr  
*/  

private["_msg"];  
_msg = _this select 1;  
hintSilent parseText _msg;

 

 
Go to "functions.h" file and below the "class civilian ", add :
class passeportCiv {};  
class civPasseport {};
Then in the core folder open file "fn_setupActions.sqf" add inside of "case civilian"
//Passport 
	life_actions = life_actions + [player addAction["<t color='#00FF00'>Present the passport</t>",life_fnc_civPasseport,"",1,false,true,"",' playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" ']];

Then add the "civ.paa" into your icons folder:

 

civ.paa

don't work i put the image in the folder icons but when i'm in game don't show me the image! Plase help me

Share this post


Link to post
Share on other sites
On 9/20/2016 at 3:51 PM, blackfisch said:

Captain here:

To use this script in 4.4 and newer versions you simply have to replace 

[[player, _message],"life_fnc_passeportCiv",_target,false] spawn life_fnc_MP;

by

[player, _message] remoteExec ["life_fnc_passeportCiv",_target];

and add in your CfgRemoteExec.hpp at class Functions the following line:

F(life_fnc_passeportCiv,CLIENT)

 

Now it should work for 4.4 and newer as well. Captain out *flies away* 10kimp_jetpack_tif_2273739g.jpg

Well 

[[player, _message],"life_fnc_passeportCiv",_target,false] spawn life_fnc_MP; isnt anywere on this tutorial? dont really get what you are making us to change? 

Share this post


Link to post
Share on other sites

A better way of doing the map part of the code is to replace the line below

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Civilian Of Altis(edit depend the map)</t>", name player];  

with this

_message = format["<img size='10' color='#FFFFFF' image='icons\civ.paa'/><br/><br/><t size='2.5'>%1</t><br/><t size='1'>Civilian Of %2</t>", name player, worldName];  

If you want to make sure the world's name is capitalised made sure the .altis has a capital on the mission file name example: Altis

Just a nice simple way of getting it without changing the string.

Share this post


Link to post
Share on other sites
7 hours ago, Nylander said:

Well 

[[player, _message],"life_fnc_passeportCiv",_target,false] spawn life_fnc_MP; isnt anywere on this tutorial? dont really get what you are making us to change? 

I posted this on the 20th September 2016 - And since the post is edited you should assume, that it was in the tutorial once upon a time :P 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...