Jump to content
Sign in to follow this  
cain2001

Create a civilian using a script

Recommended Posts

Hello everyone.

I got a big problem, I manage to create some civilians using a script. But i want them to start whit a weapon. Say CZ75.

What do i need. Plz help me out.

/Cain

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">;******************

;*

;* Create vehicle.

;*

;******************

account=account-1000;

?(account<0):goto "abort";

hint format["Account %1",account];

;begin script

_pos = _this select 0

_grp = _this select 1

~6

"civilian6" createunit [getpos _pos,_grp,"",1,"PRIVATE"]

~1

titleText["$1000 has been deducted from your account.\nYou will be able to use your Thug in a few moments.","plain down"];

goto "done";

#abort

titleText["Insufficient funds.","plain down"];

account=account+1000;

hint format["Account %100",account];

#done

;begin script

_pos = _this select 0

_grp = _this select 1

~1

;------------------------------------------------------------------------------

;the following 4 lines are optional. You can set the groups behaviour etc...

;to your preference. Change or delete lines as you see fit.

;------------------------------------------------------------------------------

_grp setformation "LINE"

_grp setbehaviour "SAFE"

_grp setcombatmode "GREEN"

"_x allowfleeing 0" foreach units _grp

exit

<span id='postcolor'>

BTW where do i find a list of all new buildings in OFP:R?

Share this post


Link to post
Share on other sites

Change creating line in script to :

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

"civilian6" createunit [getpos _pos,_grp,"this addMagazine ""cz75mag"";this addWeapon ""cz75""",1,"PRIVATE"]

<span id='postcolor'>

Civilian is created with loaded CZ75.

Share this post


Link to post
Share on other sites

;******************

;*

;* Create vehicle.

;*

;******************

account=account-1000;

?(account<0):goto "abort";

hint format["Account %1",account];

;begin script

_pos = _this select 0

_grp = _this select 1

~6

civi6 = "civilian6" createunit [getpos _pos,_grp,"",1,"PRIVATE"]

civi6 addmagazine "CZ75mag";this addmagazine "CZ75mag";this addmagazine "CZ75mag";this addmagazine "CZ75mag";this addmagazine "CZ75mag";this addweapon "CZ75"

~1

titleText["$1000 has been deducted from your account.\nYou will be able to use your Thug in a few moments.","plain down"];

goto "done";

#abort

titleText["Insufficient funds.","plain down"];

account=account+1000;

hint format["Account %100",account];

#done

;begin script

_pos = _this select 0

_grp = _this select 1

~1

;------------------------------------------------------------------------------

;the following 4 lines are optional. You can set the groups behaviour etc...

;to your preference. Change or delete lines as you see fit.

;------------------------------------------------------------------------------

_grp setformation "LINE"

_grp setbehaviour "SAFE"

_grp setcombatmode "GREEN"

"_x allowfleeing 0" foreach units _grp

exit

Look at the bold part.  You name the civi and then add the weapons after it's created.  But I think my idea might only work with making 1 civi.  You can try it with more tho.

Share this post


Link to post
Share on other sites

Thanks ppl, But i still need that List of all houses in OFP:R ? i tryed search on it but i didt find any confused.gif

Cain

Share this post


Link to post
Share on other sites

Search Results

You must not be a very good searcher. Went to OFPEC, searched for Resistance Houses and I got these.

Share this post


Link to post
Share on other sites

Sorry m8 (cain=noob) But not on the battlefield smile.gif

Many many many thanks.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×