Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Vehicle MMR_PARTIAL_ENGINE  

MMR_PARTIAL_ENGINE

THERE IS NO SOUND NOR ANIMATIONS UUIDS

Category: Vehicle
By : HESKEMO OYEN
Created: 2010-10-04 Edited: 2010-10-04
Worlds: Second Life

the Zip file

Download all files for MMR_PARTIAL_ENGINE
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. MMR_PARTIAL_ENGINE_1.lsl
1 //HKM GEARS TM
2 //PC Engine V-Tec
3 //by HESKEMO
4 //Date: 9/23/2010//
5 integer debug = FALSE;
6
7 //Basic settings
8 float ForwardPower; //Forward power
9 list ForwardPowerGears =[-10,-5,0,5,10,30,40,50,60,70,90];
10 float ReversePower = -5; //Reverse power
11 list TurnPowerL = [5,10,40,60];
12 float TurnPower; //Turning power
13 //float TurnPower = 100; //Turning power
14 float TurnSpeedAdjust = 0.1; //how much
15 //effect speed has on turning, higher numbers effect more. 0.0 to disable
16 //====================CHANNELS
17 integer mainoutputchannel = 90081;
18 integer permscontrol_uuids = 90082;
19 integer resetscript = 90083;
20 integer config_constrainexport = 90084;
21 integer configimport = 90085;
22 integer configexport = 90086;
23 //===================CHANNELS END
24 float aPower = 2000.0;
25 string forwarddiection="Y";
26 integer showvectors=FALSE;
27 //Other variables
28 vector sittarget_pos = <.990,.5,0.83>;
29 vector sittarget_rot = <0,0.00,0.00>;
30 float backupcameradistance = 5.2;
31 float dcamera_boosting = 7.3;
32 float backupCamera_release = 10.3;
33 float dcamera_norm=7.9;
34 float angle_norm=-35;
35 //==========================================================================
36 float FlightForwardPower = 24;
37 float FlightReversePower = 16;
38 float FlightUpPower = 14;
39 float FlightDownPower = 14;
40 float FlightStrafePower = 12;
41 float FlightTurnPower = 4;
42 string SitText = "Lets Roll"; //Text to show on pie menu
43 string NonOwnerMessage = "The car alarm is triggered. Ask the owner to get the car key start off the car."; //Message when someone other than owner tries to sit
44 //============PERMISSIONS
45 key agent;
46 key objectowner;
47 integer group;
48 integer permissionOptions = 0;
49 string OwnerName;
50 list accesslistuuids;
51 //======================================
52 integer ListenCh = 0;
53 string HornCommand = "h";
54 string RevCommand = "r";
55 string IdleCommand = "i";
56 string StopCommand = "s";
57 string FlightCommand = "fly";
58 string GroundCommand = "drive";
59 string LockCommand = "lock";
60 string Accessdeny="";
61 string FlightSound = "";
62 string HornSound = "";
63 string IdleSound = ""; //Sound to play when idling
64 string RunSound = ""; //Sound to play when the gas in pressed
65 string RunSoundaggressive = "6685b122-cdf5-786f-5b64-7d1a2e633a06"; //started from 3th gear
66 string Run_gearUp = "";
67 string RevSound = "";
68 string StartupSound = ""; / Sound to play when owner sits
69 string DrivingAnim = "driving generic"; //Animation to play when owner sits
70
71 //==========================================================================
72 //Other variables
73 key Owner;
74 integer NumGears;
75 integer Gear = 0;
76 integer Gear2nd = 0;
77 integer NewSound;
78 string Sound;
79 integer CurDir;
80 integer LastDir;
81 integer Forward;
82 vector SpeedVec;
83 vector Linear;
84 vector Angular;
85 integer Active;
86 key sitting;
87 integer Moving;
88 string SimName;
89 float velocity;
90 integer DIR_STOP = 100;
91 integer DIR_START = 101;
92 integer DIR_NORM = 102;
93 integer DIR_LEFT = 103;
94 integer DIR_RIGHT = 104;
95 integer DIR_FLIGHT = 105;
96 integer listeningnum = -596;
97 // channel
98 integer DIE_ENGINE = -131;
99 float camDrivDistance = 3.3;
100 //=======================BASIC MENU CODINGS
101 deBug(string k){
102 if(debug){
104 }
105 }
106 permcontrol(string c, key h){
107 if(c=="adduuid")accesslistuuids=addUsersUUID(h,accesslistuuids);
108 if(c=="removeid")accesslistuuids=removeUsersUUID(h,accesslistuuids);
109 }
110 list addUsersUUID(key id, list l){ // ADD SINGLE UUID TO THE LIST AND CHECK FOR DUPLICATIONS
111 list p = l;
112 if(llListFindList(p,[id])==-1 && id!= NULL_KEY){
113 p = p+[id];
114 }
115 return p;
116 }
117 list removeUsersUUID(key id,list l){
118 list p = l ;
119 integer h =llListFindList(p,[id]);
120 if(h!=-1){
121 p = llDeleteSubList(p,h,h);
122 }
123 return p;
124 }
125 integer getPermUser(key id){ // THROW IN AN UUID AND SEE IF THE PERSON IS ALLOWED OR NOT
126 group = llDetectedGroup(0); // Is the Agent in the objowners group?
127 agent = id; //llDetectedKey(0); // Agent's key
128 Owner = llGetOwner(); // objowners key
129 integer A= FALSE;
130 integer B= FALSE;
131 integer C= FALSE;
132 integer D= FALSE;
133 integer E=(objectowner == id);
134 integer F=(id!=NULL_KEY);
135 if(permissionOptions==0){// 0 for owner only
136 A =E;
137 }
138 if(permissionOptions==1){// 1 for group only
139 B=group;
140 }
141 if(permissionOptions==2){// 2 for the public
142 C = TRUE;
143 }
144 if(permissionOptions==3){// 3 for the accesslist
145 integer i = llListFindList(accesslistuuids,[id]);
146 if(i!=-1)D = TRUE;
147 }
148 return E||A||B||C||D&&F;
149 }
150
151 //========================================PERMISSION OPTIONS
152 CAMERAFunction(){
153
155 CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
156 CAMERA_BEHINDNESS_ANGLE, 2.0, // (0 to 180) degrees
157 CAMERA_BEHINDNESS_LAG, 0.1, // (0 to 3) seconds
158 CAMERA_DISTANCE, 8.0, // ( 0.5 to 10) meters
159 // CAMERA_FOCUS, <0,0,0>, // region-relative position
160 CAMERA_FOCUS_LAG, 0.1 , // (0 to 3) seconds
161 CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
162 CAMERA_FOCUS_THRESHOLD, 0.5, // (0 to 4) meters
163 PITCH" title="View Definition" class="tooltip">CAMERA_PITCH, 20.0, // (-45 to 80) degrees
164 // CAMERA_POSITION, <0,0,0>, // region-relative position
165 CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
166 CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
167 CAMERA_POSITION_THRESHOLD, 0.5, // (0 to 4) meters
168 CAMERA_FOCUS_OFFSET, <0.10,0,0> // <-10,-10,-10> to <10,10,10> meters
169 ]);
170
171 // llSetCameraEyeOffset(<-2, 0, 1>);
172 // the camera is 2m behind and 1m above the object
173
174 // llSetCameraAtOffset(<2, 0, 1>);
175
176 // and looks at a point that is 2m in front and 1m above the object
177
178 // sitting on this object will now place your camera
179 // so it's looking straight ahead on a line parallel
180 // to the objects x (forward) axis, 1m above the objects center.
181
182 }
183
184 VEHICLEFunction(){
190
193
194 llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0);
196
198 llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.2);
199
202
205
210 llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, <0.00000, 0.00000, 0.00000, 0.332000>);
213 }
214 gearUP(integer g){
215 TurnPower= llList2Integer(TurnPowerL,1);
216 //if((g-Gear2nd)>2){
217 // llTriggerSound(RunSoundaggressive,1.0);
218 //}
219 //Gear2nd = g;
220 //llSleep(1.0);
221 // Gear2nd = 0;
222 if(g>2){
223 //llSetCameraParams([CAMERA_FOCUS_OFFSET, <2.50,0,0>]);
224 }
225 }
226 gearDOWN(integer g){
227 //llSetCameraParams([CAMERA_FOCUS_OFFSET, <4.50,0,0>]);
228 TurnPower= llList2Integer(TurnPowerL,2);
229 //Gear2nd = -1;
230 //llSleep(1.0);
231 //Gear2nd = 0;
232 if(g>2){
233 //llSetCameraParams([CAMERA_FOCUS_OFFSET, <4.50,0,0>]);
234 }
235 }
236 gearSignal(integer g){
237 if(g == 2)
238 {
239 signaldata( "///<<PARK - (E) BRAKE>>///");
241 Moving = 0;
242 Linear.x = 0;
244 llSetRot(llEuler2Rot(<0,0,rot.z>));
245 NewSound = 1;
246 }
247 else if(!Moving)
248 {
249 Moving = 1;
251 //if(debug)llOwnerSay("unfreeze");
252 }
253 //if(g == 5)llSetCameraParams([CAMERA_FOCUS_OFFSET, <8.10,0,0>]);
254 if(g > 2){signaldata("GEAR " + (string)(g - 2));
257 }
258 if(g < 2){signaldata("GEAR REVERSE : R" + (string)llFabs(g - 2));
262 }
263 ForwardPower = llList2Float(ForwardPowerGears, g);
264 if(Linear.x > 0) Linear.x = ForwardPower;
265 }
266 preloadingsounds(){
267 llSetText("Preloading....",<1,0,0>,1);
268 llPreloadSound(FlightSound);
269 llPreloadSound(HornSound);
270 llPreloadSound(IdleSound);
271 llPreloadSound(RunSound);
272 llPreloadSound(RevSound);
273 llPreloadSound(StartupSound);
275 llSetText("DONE",<0,0,1>,1);
276 llSetText("",<1,1,1>,1);
277 }
278 int(){
279 //Owner = llGetOwner();
280 //OwnerName = llKey2Name(Owner);
281 TurnSpeedAdjust *= 0.01;
282 Gear = 3;
283 ForwardPower = llList2Integer(ForwardPowerGears, 3);
284 NumGears = llGetListLength(ForwardPowerGears);
285 TurnPower= llList2Integer(TurnPowerL,1);
286 llSetSitText(SitText);
287 llCollisionSound("", 0.0);
288 llSitTarget(sittarget_pos, llEuler2Rot(DEG_TO_RAD*sittarget_rot));
290 exportconfiguration();
291 }
292 signaldata(string k){
293 llMessageLinked(LINK_SET,mainoutputchannel,k,NULL_KEY);
294 llSetText(k+"\n.\n.\n.\n.",<1,1,.6>,1.0);
295 llSleep(5.0);
296 llSetText("",<0,0,0>,1.0);
297 }
298 activecheck(){
299 if(!Active){
302 //llSay(listeningnum,(string)DIR_STOP);
306 }else{
307 SimName = llGetRegionName();
309 //llSay(listeningnum,(string)DIR_START);
311 //llSay(listeningnum,(string)DIR_NORM);
312 NewSound = 1;
313 Sound = IdleSound;
314 Linear = <0,0,-2>;
315 }
316 }
317 vector vaildation_vector(string n)
318 {
319 vector vec;
320 integer length = llStringLength(n);
321 string n0 = llGetSubString(n,0,0);
322 string n1 = llGetSubString(n,length-1,length);
323 if(n0=="<" && n1==">"){
324 vec=(vector)llGetSubString(n,0,-1);
325 return vec;
326 }else{
327 deBug("Cannot vaild the vector value: '"+n+"' misses '<' or '>'");
328 return ZERO_VECTOR;
329 }
330 }
331 exportconfiguration(){
332 string n;
333 // vector 0 vector 1 string X/Y 2 float 3 float 4 integer 5 string 2 list 6
334 n=(string)sittarget_pos+";"+(string)sittarget_rot+";"+forwarddiection+";"+(string)backupcameradistance+";"+(string)backupCamera_release+";"+(string)showvectors+";"+(string)llList2CSV(accesslistuuids);
335 llMessageLinked(LINK_SET,configexport,n,NULL_KEY);
336 }
337 vel_anaylsis(){
338 velocity = llVecMag(llGetVel());
339
340 }
341 default
342 {
344 {
345 int();
346 state Ground;
347 }
348 }
349 state Ground
350 {
352 {
353 if(n==configimport){ // IMPORT CONFIGURATIONS TO THE CAR
354 llSetText("Sync....\n.\n.\n.\n.\n.\n.\n.\n.\n.",<1,0,0>,1);
355 list cl;
356 cl = llParseString2List(m,[";"],[]);
357 sittarget_pos=vaildation_vector(llList2String(cl,0));
358 sittarget_rot=vaildation_vector(llList2String(cl,1));
359 forwarddiection=llList2String(cl,2);
360 backupcameradistance=llList2Float(cl,3);
361 backupCamera_release=llList2Float(cl,4);
362 showvectors=llList2Integer(cl,5);
363 permissionOptions=llList2Integer(cl,6);
364 int();
365 llSetText("",<1,0,0>,1);
366 }
367 if(n==config_constrainexport)exportconfiguration();
368 if(n==resetscript)llResetScript();
369 if(n==permscontrol_uuids){permcontrol(m,id);}
370 }
372 {
373 llListen(ListenCh, llKey2Name(llGetOwner()), NULL_KEY, "");
374 activecheck();
375 VEHICLEFunction();
376 }
377 on_rez(integer param)
378 {
379 preloadingsounds();
380 }
381 changed(integer change)
382 {
383 if((change & CHANGED_LINK) == CHANGED_LINK)
384 {
385 sitting = llAvatarOnSitTarget();
386 if((sitting != NULL_KEY) && !Active) //ready to drive it
387 {
388 if(getPermUser(sitting)) //reject others
389 {
390 llWhisper(0, NonOwnerMessage);
391 llTriggerSound(Accessdeny,1.0);
392 llUnSit(sitting);
393 }else{
395 llTriggerSound(StartupSound, 1.0);
397 //llSay(listeningnum,(string)DIR_START);
398 llSetPos(llGetPos() + <1,0,1.5>);
400 SimName = llGetRegionName();
401 llLoopSound(IdleSound,1);
402 llSetTimerEvent(0.1);
403 CurDir = DIR_NORM;
404 LastDir = DIR_NORM;
405 }
406 }
407 else if((sitting == NULL_KEY) && Active) // unsit and turn the car off
408 {
409 llSetTimerEvent(0.0);
410 llStopAnimation(DrivingAnim);
411 Active = 0;
413 //llSetRot(z);
416 //llSay(listeningnum,(string)DIR_STOP);
418 }
419 }
420 }
421
423 {
425 {
426 Active = 1;
427 Linear = <0,0,-2>;
428 Angular = <0,0,0>;
429 llStopAnimation("sit");
430 llStartAnimation(DrivingAnim);
432 CAMERAFunction();
433 }
434 }
435
436 control(key id, integer levels, integer edges)
437 {
438 SpeedVec = llGetVel() / llGetRot();
439 if((edges & levels & CONTROL_UP))
440 {
441 if(Gear<NumGears)
442 {
443 ++Gear;
445 gearSignal(Gear);
446 gearUP(Gear);
447 }
448 }else if((edges & levels & CONTROL_DOWN))
449 {
450 if(Gear > 0)
451 {
452 --Gear;
453 gearSignal(Gear);
454 gearDOWN(Gear);
455 }
456 }
457 if((edges & levels & CONTROL_FWD))
458 {
459
460 if(!Moving && Gear!=2){
461 Moving = 1;
463 Linear.x = ForwardPower;
464 NewSound = 1;
466 llSetCameraParams([CAMERA_DISTANCE,dcamera_boosting]);
467 llSleep(3.0);
469 llSetCameraParams([CAMERA_DISTANCE,dcamera_norm]);
470 }
471 if(Moving){
472 Linear.x = ForwardPower;
473 NewSound = 1;
474 }
476 }else if((edges & ~levels & CONTROL_FWD))
477 {
478 //if(debug)llOwnerSay("release");
479 if(Linear.x>0){
480 Linear.x -= ForwardPower;
481 }else{Linear.x=0;}
482 NewSound = 1;
483 }
484
485 if((edges & levels & CONTROL_BACK))
486 {
487 llSetCameraParams([CAMERA_DISTANCE, backupcameradistance]);
488 //llSetCameraParams([CAMERA_FOCUS_LAG, 0.3]);
489 }else if((edges & ~levels & CONTROL_BACK))
490 {
491 llSetCameraParams([CAMERA_DISTANCE, backupCamera_release]);
492 //llSetCameraParams([CAMERA_FOCUS_LAG, 0.1]);
493
494 // llSetCameraParams([CAMERA_FOCUS_OFFSET, <0,0,0>]);
495 //Linear.x -= ReversePower;
496 //NewSound = 1;
497 }else if((~edges & levels & CONTROL_BACK)){
498 if((Linear.x-2)>0){
499 Linear.x -=2;
500 }else{Linear.x = 0;}
501
502 }
503 if(NewSound)
504 {
505 if(Linear.x==0)Sound = IdleSound;
506 else{
507 if(Linear.x<30) Sound = RunSound;
508 else if(Linear.x>=30) Sound = RunSoundaggressive;
509 }
510 }
511 if(llFabs(SpeedVec.x) < 1.5)
512 {
513 if(levels & CONTROL_ROT_LEFT) CurDir = DIR_LEFT;
514 else if(levels & CONTROL_ROT_RIGHT) CurDir = DIR_RIGHT;
515 else CurDir = DIR_NORM;
516 Angular.z = 0.0;
517 }else{
518 if(SpeedVec.x < 0.0){
519 Forward = -1;
520 SpeedVec.x *= -TurnSpeedAdjust;
521 }else{
522 Forward = 1;
523 SpeedVec.x *= TurnSpeedAdjust;
524 }
525 if(levels & CONTROL_ROT_LEFT){
526 CurDir = DIR_LEFT;
527 //if(debug)llOwnerSay("L: .x:"+(string)SpeedVec.x+" tunring:"+(string)(TurnPower - SpeedVec.x));
528 Angular.z = (TurnPower - SpeedVec.x) * Forward;
529 }else if((edges & ~levels & CONTROL_ROT_LEFT)){
530 CurDir = DIR_NORM;
531 Angular.z = 0;
532 // llSetCameraParams([CAMERA_FOCUS_OFFSET, <0,0,0>]);
533
534 }else if((edges & levels & CONTROL_ROT_LEFT)){
535 //llSetCameraParams([CAMERA_FOCUS_OFFSET, <4.50,-2,0>]);
536 }
537 if(levels & CONTROL_ROT_RIGHT){
538 CurDir = DIR_RIGHT;
539 //if(debug)llOwnerSay("R: .x:"+(string)SpeedVec.x+" tunring:"+(string)(TurnPower - SpeedVec.x));
540 Angular.z = -((TurnPower - SpeedVec.x) * Forward);
541 }else if((edges & ~levels & CONTROL_ROT_RIGHT)){
542 CurDir = DIR_NORM;
543 Angular.z = 0;
544 // llSetCameraParams([CAMERA_FOCUS_OFFSET, <0,0,0>]);
545 }else if((edges & levels & CONTROL_ROT_RIGHT)){
546 // llSetCameraParams([CAMERA_FOCUS_OFFSET, <4.50,2,0>]);
547 }
548 }
549 }
550
552 {
553 if(llGetRegionName() == SimName)
554 {
555 Moving = 0;
557 //llOwnerSay("Region Hit "+SimName);
558 }else{
559 SimName = llGetRegionName();
560 }
561 }
562
563 timer()
564 {
565 if(Linear != <0.0, 0.0, -2.0>)
566 {
568 llApplyImpulse(Linear, TRUE);
569 }
570 if(Angular != <0.0, 0.0, 0.0>) llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, Angular);
571 if(CurDir != LastDir)
572 {
574 llSay(listeningnum,(string)CurDir);
575 LastDir = CurDir;
576 }
577 if(NewSound)
578 {
580 NewSound = 0;
581 llLoopSound(Sound, 1.0);
582 }
583 if(showvectors){
584 llSetText("linear vec:"+(string)Linear+"\n speedvec:"+(string)SpeedVec+"\n angular:"+(string)Angular+"\n.\n.\n.\n.\n.\n.",<1,1,1>,1.0);
585 }else{
586 llSetText("",<1,1,1>,1.0);
587 }
588 }
589 listen(integer channel, string name, key id, string message)
590 {
591 if((channel == DIE_ENGINE) && Active && (message == FlightCommand))state Flight;
592 if((channel == DIE_ENGINE) && Active && (message == LockCommand))state Lock;
593 if(llGetOwnerKey(id) != Owner) return;
594 message = llToLower(message);
595 if(message == HornCommand) llMessageLinked(LINK_SET, 12345, HornSound, NULL_KEY);
596 else if(message == RevCommand) llMessageLinked(LINK_SET, 12345, RevSound, NULL_KEY);
597 else if(message == IdleCommand) llLoopSound(IdleSound, 1.0);
598 else if(message == StopCommand) llStopSound();
599 else if((message == FlightCommand) && Active) state Flight;
600 }
601 }
602
603
604 state Lock
605 {
607 { Linear = <0,0,0>;
610 llSay(listeningnum,(string)DIR_FLIGHT);
611 llLoopSound(FlightSound, 1.0);
613 llSetPos(llGetPos() + <0,0,1.25>);
615 llSetRot(llEuler2Rot(<0,0,rot.z>));
616 }
617 listen(integer channel, string name, key id, string message)
618 {
619 if((channel == DIE_ENGINE) && Active && (message == FlightCommand))state Flight;
620 if((channel == DIE_ENGINE) && Active && (message == GroundCommand))state Ground;
621 if(llGetOwnerKey(id) != Owner) return;
622 message = llToLower(message);
623 if(message == GroundCommand) state Ground;
624 }
625
626
627 }
628 state Flight
629 {
631 {
632 Linear = <0,0,0>;
635 llSay(listeningnum,(string)DIR_FLIGHT);
636 llLoopSound(FlightSound, 1.0);
638 llSetPos(llGetPos() + <0,0,0.25>);
640 llSetRot(llEuler2Rot(<0,0,rot.z>));
641 llListen(ListenCh, OwnerName, NULL_KEY, "");
643
644 // linear friction
646
647 // uniform angular friction
649
650 // linear motor
652 llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0);
654
655 // angular motor
658 llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 2.0);
659
660 // hover
665
666 // linear deflection
669
670 // angular deflection
673
674 // vertical attractor
677
678 // banking
682
683 // default rotation of local frame
684 llSetVehicleRotationParam(VEHICLE_REFERENCE_FRAME, <0.00000, 0.00000, 0.00000, 0.00000>);
685
686 // removed vehicle flags
688
689 // set vehicle flags
692
694 }
695
696 listen(integer channel, string name, key id, string message)
697 {
698 if(llGetOwnerKey(id) != Owner) return;
699 message = llToLower(message);
700 if(message == GroundCommand) state Ground;
701 }
702
703 control(key name, integer levels, integer edges)
704 {
705 if((levels & CONTROL_LBUTTON))
706 {
710 llSleep(0.1);
712 return;
713 }
714
715 if((edges & levels & CONTROL_UP)) Linear.z += FlightUpPower;
716 else if((edges & ~levels & CONTROL_UP)) Linear.z = 0.0;
717
718 if((edges & levels & CONTROL_DOWN)) Linear.z -= FlightDownPower;
719 else if((edges & ~levels & CONTROL_DOWN)) Linear.z = 0.0;
720
721 if((edges & levels & CONTROL_FWD)) Linear.x += FlightForwardPower;
722 else if((edges & ~levels & CONTROL_FWD)) Linear.x = 0.0;
723
724 if((edges & levels & CONTROL_BACK)) Linear.x -= FlightReversePower;
725 else if((edges & ~levels & CONTROL_BACK)) Linear.x = 0.0;
726
727 if((edges & levels & CONTROL_LEFT)) Linear.y += FlightStrafePower;
728 else if((edges & ~levels & CONTROL_LEFT)) Linear.y = 0.0;
729
730 if((edges & levels & CONTROL_RIGHT)) Linear.y -= FlightStrafePower;
731 else if((edges & ~levels & CONTROL_RIGHT)) Linear.y = 0.0;
732
733 if((edges & levels & CONTROL_ROT_LEFT)) Angular.z = FlightTurnPower;
734 else if((edges & ~levels & CONTROL_ROT_LEFT)) Angular.z = 0;
735
736 if((edges & levels & CONTROL_ROT_RIGHT)) Angular.z = -FlightTurnPower;
737 else if((edges & ~levels & CONTROL_ROT_RIGHT)) Angular.z = 0;
738 }
739
740 changed(integer change)
741 {
742 if((change & CHANGED_LINK) == CHANGED_LINK)
743 {
744 sitting = llAvatarOnSitTarget();
745 if(sitting == NULL_KEY)
746 {
747 llSetTimerEvent(0.0);
748 llStopAnimation(DrivingAnim);
749 Active = 0;
753 llSay(listeningnum,(string)DIR_STOP);
755 state Ground;
756 }
757 }
758 }
759
760 timer()
761 {
763
765 }
766 }

Back to the Best Free Tools in Second Life and OpenSim.