Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

diolog problem?

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-13-2007 11:29
i have no idea if this is doing what it is saposed to, when you say team it brings up a diolog box like it should but when you selcet a team 1 or 2 it is saposed to display your team number in text after you selcet it but it isnt

CODE

string Team1 = "";
string Team2 = "";
integer handle;
integer chat = 0;
integer weapon = -50;
string Team = "";
integer damage;
text()
{
llSetText(Team + "\nDamage " + (string)(damage * 10) + "% \n",<1,1,1>,1);
}
default
{
state_entry()
{

llSetTimerEvent(.1);
llSay(0, "Laser Tag Loaded");
llListen(weapon,"","","");
llListen(chat,"","","");
Team = "Team undefined";
Team1 = "Team 1";
Team2 = "Team 2";
text();
damage = 0;
}
on_rez(integer start)
{
llResetScript();
}
listen(integer channel, string name, key id, string message)
{
if(channel == chat)
{
if(message == "team" || message == "TEAM")
{
llDialog(id, "Laser Tag Menu", ["Team 1", "Team 2"], -1000);
handle = llListen(-1000, "", llGetObjectName(), "");
llListen(-1000, "", llGetObjectName(), "");
}
if(message == "Team 1")
{
llListenRemove(handle);
Team = "Team 1";
}
if((message == "Team 2"))
{
llListenRemove(handle);
Team = "Team 2";
}
}
else if(channel == weapon)
{
if((message == "hit " + llKey2Name(llGetOwner())) && (damage < 10))
{
damage += 1;
text();
}
if(damage >= 10)
{
llMessageLinked(LINK_ALL_CHILDREN,0,"dead","");
llOwnerSay("you have been Defeated");
}
if((message == "Revive " + llKey2Name(llGetOwner())) && (damage < 11))
{
damage = 0;
llMessageLinked(LINK_ALL_CHILDREN,0,"alive","");
text();
}
}
}
timer()
{
text();
}
}
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
12-13-2007 11:35
You have TWO llListen function and you do not have a listen event at all...
The second llListen SHOULD be a listen event not another llListen function
Renee Roundfield
Registered User
Join date: 10 Mar 2006
Posts: 278
12-13-2007 12:07
The biggest thing is that dialogs come in the name of the key of the button pusher, not the object.
MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
12-13-2007 14:19
that is correct and you have seen some of my dialog boxes Mrc (I think)
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
12-13-2007 15:03
From: Deja Vu?
llDialog(id, "Laser Tag Menu", ["Team 1", "Team 2"], -1000);
handle = llListen(-1000, "", llGetObjectName(), "";);
llListen(-1000, "", llGetObjectName(), "";);
hm... didn't we have this code in an earlier thread?

Try this:

handle = llListen(-1000, "", id, "";);
llDialog(id, "Laser Tag Menu", ["Team 1", "Team 2"], -1000);