|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-02-2008 14:29
not sure what i did wrong but here is what is happening, i have a hud that detects owner name and sends "Mrc Homewood lightson" and the police car picks up that message on channel -28 and i have another that listens for the person on sittarget for chat commands, the chat commands work fine but i cant get the hud commands to work, BUT! here is the funny thing, if i make another object add the sittarget and the listen lines for just the hud part it works fine, they dont work together is it posible im doing the channel stuff wrong? //////////////////////////// integer hanndle; hanndle = llListen(-28,"","","")||llListen(0,"","",""); //////////////////////////// listen(integer channel, string name, key id, string message) { key agent = llAvatarOnSitTarget(); if(channel == 0) { if(llAvatarOnSitTarget()) { if(message == "hud") { llGiveInventory(agent,"PD Cop Car Hud"); } else if(message == "stop") { llSetTimerEvent(0); llStopSound(); llSetStatus(STATUS_PHYSICS, FALSE); llSleep(.1); llMessageLinked(LINK_ALL_CHILDREN , 0, "WHEEL_DEFAULT", NULL_KEY); llSleep(.4); } else if(message == "start") { llTriggerSound("starter",1); llMessageLinked(LINK_ALL_CHILDREN , 0, "WHEEL_DRIVING", NULL_KEY); llSleep(.4); llSetStatus(STATUS_PHYSICS, TRUE); llSleep(.1); llSetTimerEvent(0.1); llSleep(0.7); llLoopSound("idle",3); } } } else if(channel == -28) { if(message == llKey2Name(agent)+" s") { llMessageLinked(LINK_ALL_CHILDREN, 0,"s", ""); } else if(message == llKey2Name(agent)+" lightson") { llMessageLinked(LINK_ALL_CHILDREN, 0,"lightson", ""); } else if(message == llKey2Name(agent)+" lightsoff") { llMessageLinked(LINK_ALL_CHILDREN, 0,"lightsoff", ""); } } }
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
06-02-2008 15:09
Uhm... does this really work??? hanndle = llListen(-28,"","",""  ||llListen(0,"","",""  ; I'm not sure, but I kinda doubt that you can add listens with ORing them together... Try adding a separate listener for each channel...
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-02-2008 15:35
already have, gave them bother there own integer didnt still work try them without the listen removes also didnt work XD
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-02-2008 15:44
That expression will start two listens (because the LSL language does NOT short-circuit the logical || and && operators), but the resulting value you are assigning to the handle variable is likely to be worthless.
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-02-2008 16:18
OMFG! im such a noob the problem was with the else if(channel == -2  XD with the else there it bypassed the others lol
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
06-02-2008 16:30
From: Haruki Watanabe Uhm... does this really work??? hanndle = llListen(-28,"","",""  ||llListen(0,"","",""  ; I'm not sure, but I kinda doubt that you can add listens with ORing them together... Try adding a separate listener for each channel... That DEFINITELY won't work! It will compile, and it will generate a (useless) integer to dump into the handle integer, however I doubt it will generate the proper handle to remove the listen(s). LOL
_____________________
My tutes http://www.youtube.com/johanlaurasia
|