Guest Terminator5665 Posted May 27, 2010 Report Share Posted May 27, 2010 Hi,I'm using the shane green's submod, i want to add a few more vehicles to the police station.I have basic knowledge of scripting, but i am a bit confused why i keep getting an error (sorry if its something silly).I added a new VO in the editor and changed the constants at the top of the script to correspond correctly as i am added a slick top unit. ActorList 148 = Game::GetActors(VO_LAPDSLICK); for(int i=0; i < 148.GetNumActors(); i++) { Vector Lapdslick = 148.GetActor(0)->GetPosition(); Vehicle m = Game::CreateVehicle(OBJ_LAPDSLICK, UNNAMED); m.EnableBlueLights(false); m.SetPosition(Lapdslick); m.UpdatePlacement(); m.SetMaxPassengers(2); m.SetMaxTransports(2); m.SetSpeed(12.0f); m.PushActionWait(ACTION_NEWLIST, 2.0f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 11, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 11, false); }I added this after the last vehicle to be spawned which was 147. When i start it with the game it says that the 148 is an illegal operation. What does the 148 reference to and why is it giving me an error?Thanks in advanced for any helpp.s. i attached the full script to this post Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted May 27, 2010 Report Share Posted May 27, 2010 A variable cannot be named as a number. If you look closely, the variables used as ActorLists here are "l##", which is a small L. Replace 148 with l48 and you'll be fine. You must change three lines, the first ones, not including the brace. Quote Link to comment Share on other sites More sharing options...
Guest Terminator5665 Posted May 27, 2010 Report Share Posted May 27, 2010 oh i feel dumb now thanks i diden't realize that those were Ls thanks for the help! Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted May 27, 2010 Report Share Posted May 27, 2010 No problem. Glad to help. Quote Link to comment Share on other sites More sharing options...
Guest Terminator5665 Posted May 28, 2010 Report Share Posted May 28, 2010 One more thing, how do i make a command that i created via script show up in the editor? I tried the assign command button but there's no where to choose what script it goes to... Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted May 28, 2010 Report Share Posted May 28, 2010 Once you create a command script, it will appear in the commands list for units. Make sure you don't use the same command script names though. Quote Link to comment Share on other sites More sharing options...