|
Ginge Reymont
Registered User
Join date: 10 Oct 2005
Posts: 190
|
10-12-2005 23:46
I would like it so i could say guest "name" and then they can fly , but i cant find anything on giving permission.
Could anyone point me in the right direction?
|
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
10-13-2005 01:23
For a script to read someone's key input, it needs to: 1) request permission to do so to the target agent (with llRequestPermissions(the_key, PERMISSION_TAKE_CONTROLS) ) 2) once it is granted permission, call llTakeControls(LOTS_OF_CONSTANTS_FOR_DEFINING_WHICH_KEYS_TO_READ, TRUE/FALSE) (usually, in the run_time_permissions event, since this is what is triggered when the agent grants permission) 3) then do whatever you want with the input in the control event  So if you want to read an arbitrary agent's keys, you'll just need a way to get his/her key. Finding someone's key by name isn't easy in SL, I generally have the various seats of the vehicle send the key of whoever is sitting on them by link message to the vehicle script when needed.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
10-13-2005 09:48
In abbrieviated form without proper validation checking, I think what you are after is: // PSEUDOCODE WARNING!
// Define a global to hold the named pilot name string named_pilot = "";
//...in your listen for owner commands... listen(...) { ...
if (llSubStringIndex(llToUpper(message), "NAME ") == 0) { named_pilot = llGetSubString(message, llStringLength("NAME "), llStringLength(message) - 1); // i.e.the avatar name argument }
... //...in your sit detection/link change changed(integer change) { if (change & CHANGED_LINK) { ... key agent = llAvatarOnSitTarget(); if (agent != NULL_KEY) { if (agent == llGetOwner() || named_pilot == llKey2Name(agent)) { llRequestPermissions(agent, (PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS)); } else { llUnSit(agent); .... } }
Is that what you were after?
_____________________
http://slurl.com/secondlife/Together
|
|
Copper Surface
Wandering Carroteer
Join date: 6 Jul 2005
Posts: 157
|
10-13-2005 21:29
If you use the above script on that jet you were working on, Ginge, be aware that the cockpit sliding open/shut also triggers a CHANGED_LINK event. You may find that this causes any instructions which you wanted to execute when someone gets on/off (e.g. request permissions, startup/shutdown sounds) to execute again when the canopy opens/shuts. Some people use a start/stop command to get around this, but I just use a boolean to keep track of whether the ship is piloted.
|
|
Ginge Reymont
Registered User
Join date: 10 Oct 2005
Posts: 190
|
10-14-2005 04:40
That is what im looking for is it possible to take the abrivations out?
|