Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

update server help

Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
05-28-2006 00:07
i cant figure out what is wrong with this thing i am posting both to see what you guys can do with it(FYI i have been tinkering with this for about a month)


CODE
//SERVER CORE
default
{
state_entry()
{
llSetTimerEvent(6);
}

email(string time, string address, string subj, string message, integer num_left) {
llOwnerSay(address);
llOwnerSay(subj);
llOwnerSay(message);
if (llOwnerSay("AN-SAW 3.1"))
{
llInstantMessage(subj, "you have the most up to date TA-SAW");
}
if (llOwnerSay("AN-SAW 3.0"))
llInstantMessage(subj, "Here is the update say help to see what has been changed :D");
llGiveInventory(subj,llGetInventoryName(INVENTORY_OBJECT, 0));
}


timer() {
llGetNextEmail("", "");
}
}



and the gun sends this
CODE

llEmail("37dd61f5-d861-13d5-0136-0d5f634ea782@lsl.secondlife.com",llGetOwner() , llGetObjectName());
llInstantMessage("37dd61f5-d861-13d5-0136-0d5f634ea782@lsl.secondlife.com", llGetObjectName());

Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
05-28-2006 00:56
CODE
if (llOwnerSay("AN-SAW 3.1"))
{
llInstantMessage(subj, "you have the most up to date TA-SAW");
}
if (llOwnerSay("AN-SAW 3.0"))


Why are you using llOwnerSay?, you should be checking to see if the message is equal.

CODE
if(message == "AN-SAW 3.1")
{
llInstantMessage(subj, "you have the most up to date TA-SAW");
}
else if(message == "AN-SAW 3.0")


although you really don't need the second else if statement, because, from what I understand that your doing, you are just checking to see if the object is the latest version, everything else would be an older version.

Hope that helps
Shadow Keegan
Registered User
Join date: 3 Aug 2004
Posts: 38
05-28-2006 12:54
that did not fix it, it gives me the update with the 3.1...here is what i changed

CODE
//SERVER CORE
default
{
state_entry()
{
llSetTimerEvent(6);
}

email(string time, string address, string subj, string message, integer num_left) {
llOwnerSay(address);
llOwnerSay(subj);
llOwnerSay(message);
if(message == "AN-SAW 3.1")
{
llInstantMessage(subj, "you have the most up to date TA-SAW");
}
else if(message == "AN-SAW 3.0")
llInstantMessage(subj, "Here is the update say help to see what has been changed :D");
llGiveInventory(subj,llGetInventoryName(INVENTORY_OBJECT, 0));
}


timer() {
llGetNextEmail("", "");
}
}
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
05-28-2006 13:37
You're missing an opening brace after the else if, causing the llInstantMessage to be the only thing inside the else if scope.
CODE
//SERVER CORE
default
{
state_entry()
{
llSetTimerEvent(6);
}

email(string time, string address, string subj, string message, integer num_left) {
llOwnerSay(address);
llOwnerSay(subj);
llOwnerSay(message);
if(message == "AN-SAW 3.1")
{
llInstantMessage(subj, "you have the most up to date TA-SAW");
}
else if(message == "AN-SAW 3.0")
{ //<--missing brace
llInstantMessage(subj, "Here is the update say help to see what has been changed :D");
llGiveInventory(subj,llGetInventoryName(INVENTORY_ OBJECT, 0));
}
}//<--also missing to close the email event handler


timer() {
llGetNextEmail("", "");
}
}


Also, why is the gun IM'ing the update server? Objects can't recieve IM's, only send.
_____________________