Jump to content
erfd

Script editing help

Recommended Posts

Hey, can some look at the edits I made to the M4a1.script from the la mod? Im trying to put the rifle in the lapd, lasd, and chp patrol cars, but when I run the mod, the rifle is not availible in my squad. Thanks for any help.

Link to comment
Share on other sites

I think this may be your problem, im kinda new to scripting myself:


if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1))
return false;

Vehicle v(Target);
if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/05 US Army/hmmwv.e4p") == 0 ||
StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/05 US Army/us_army_truck.e4p") == 0 ||
StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/05 US Army/blackhawk.e4p") == 0 ||
StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 La Police/cv_chp.e4p") == 0 ||
StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 La Police/cv_lapd.e4p") == 0) ??
{
return true;
}
return false;

I think you for got your || where i incerted the question marks.

Hope this helps, USman

Link to comment
Share on other sites

Thats not it, the last line isn't sussposed to have || (accroding to xplorer and the original script) at the end. Thanks though.

Link to comment
Share on other sites

is it just one car or all of the ones you added? Did you add the command to the officers?

Wish you luck, USman :prop:

Link to comment
Share on other sites

Yes all the officers have the command (check my topic in the submods). None of the cars I added are working.

Link to comment
Share on other sites

Problem Fixed, had to lift restrictions on script that only allowed m4 to be in cars with flashbangs.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...