Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Second life scripting is totally screwed up!!!!!!!!

Chaos Bikcin
Registered User
Join date: 10 Jun 2007
Posts: 296
08-27-2007 08:03
someone gave me a script for renting out shops/homes etc and when i try to add the "Simple Notecard vendor" it gives my a syntax error

I'm assuming that its completely screwed and i gotta wait til the next update for them 2 fix it. this is the problem....

list splitwith;
list splitname;
string ownername;
integer not_registered = TRUE;
vector original_location;
vector original_scale;
integer objects = 1; // objects
integer price = 9999999; // price
integer weeks = 1; // weaks
vector offset = <0, 0, 2>;
integer mature = 0;
string rentor;
string rentorkey;
integer rented = FALSE;
string rentperiod;
integer numListen;
integer randchannel;
integer editmode;
integer stopper;
string daterented;
integer rentedweeks;
integer timerevent;

default
{
on_rez(integer change)
{
llInstantMessage(llGetOwner(),"for help click item then select help from menu";);
llSetTexture("rentit", ALL_SIDES);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
llListen(0,"","","";);
randchannel = (integer)llFrand(10000000);
llListen(randchannel,"","","";);
editmode = 0;
timerevent = 0;
rented == FALSE;
}
listen(integer c, string n, key id, string m)
{
stopper = 0;
string objectname;
objectname = llGetObjectName();
if (m == "Vacent" && c == randchannel && id == llGetOwner() && rented == TRUE)
{
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
llListenRemove(numListen);
numListen = llListen(0, "", "", "" );
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
rented = FALSE;
daterented = "";
rentedweeks = 0;
timerevent = 0;
llSetTimerEvent(0);
llSay(0, objectname + " is vacent";);
}
if (m == "Mature" && c == randchannel && id == llGetOwner())
{
mature = 1;
llSay(0,"set to Mature Area";);
}
if (m == "Renter info" && c == randchannel && id == llGetOwner())
{
integer weeks2;
weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days;
days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours;
hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins;
mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds;
seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llInstantMessage(llGetOwner(),"Renter name: " + rentor);
llInstantMessage(llGetOwner(),"Rented Date: " + daterented);
llInstantMessage(llGetOwner(),"Rented Left: " + (string)weeks2 + " weeks | " + (string)days + " days | " + (string)hours + ":" + (string)mins + ";" +(string)seconds);
if (rentedweeks >= 2)
{
llInstantMessage(llGetOwner(),"Rented amount: " + (string)rentedweeks + " weeks";);
}
if (rentedweeks == 1)
{
llInstantMessage(llGetOwner(),"Rented amount: " + (string)rentedweeks + " week";);
}
if (rentedweeks <= 0)
{
llInstantMessage(llGetOwner(),"Rented amount: N/A";);
}
}
if (m == "PG" && c == randchannel && id == llGetOwner())
{
mature = 0;
llSay(0,"set to PG Area";);
}
if (m == "Status" && c == randchannel && id == llGetOwner())
{
string mit;
llInstantMessage(llGetOwner(),"Prim's set to " + (string)objects);
llInstantMessage(llGetOwner(),"Week's set to " + (string)weeks);
llInstantMessage(llGetOwner(),"Offset set to " + (string)offset);
if (mature == 1)
{
mit = "Yes";
}
else
{
mit = "No";
}
llInstantMessage(llGetOwner(),"Regen Mature: " + (string)mit);
}
if(m == "Edit Mode" && editmode == 0 && stopper == 0 && c == randchannel && id == llGetOwner())
{
stopper = 1;
editmode = 1;
llInstantMessage(llGetOwner(),"editmode on";);
}
if(m == "Edit Mode" && editmode == 1 && stopper == 0 && c == randchannel && id == llGetOwner())
{
stopper = 1;
editmode = 0;
llInstantMessage(llGetOwner(),"editmode off";);
}

if (m == "Help" && c == randchannel && id == llGetOwner())
{
llGiveInventory(llGetOwner(), "Rentals Help";);
}
if (llGetSubString(m,0,8) == "set weeks" && id==llGetOwner() && editmode == 1)
{
weeks = (integer)llGetSubString(m,9,llStringLength(m));
llSay(0,"weeks set to " + (string)weeks);
}
if (llGetSubString(m,0,10) == "set renter " && id==llGetOwner() && editmode == 1)
{
rentor = llGetSubString(m,11,llStringLength(m));
llSay(0,"renter set to " + rentor);
}
if (llGetSubString(m,0,9) == "set split " && id==llGetOwner() && editmode == 1)
{
key id = (key)llGetSubString(m,10,llStringLength(m));
splitwith += id;
splitname += llKey2Name(id);
llSay(0,llKey2Name(id) + " added to split with list";);
}
if (llGetSubString(m,0,12) == "split remove " && id==llGetOwner() && editmode == 1)
{
string name = llGetSubString(m,13,llStringLength(m));
integer finddata = llListFindList(splitname,(list)name);
if(finddata == -1)
{
llSay(0,"sorry " + name + " not found";);
}else
{
llDeleteSubList(splitwith,finddata,finddata);
llDeleteSubList(splitname,finddata,finddata);
llSay(0,name +" removed from shared list";);
}
}
if (llGetSubString(m,0,13) == "set rentedfor " && id==llGetOwner() && editmode == 1)
{
string date = llGetTimestamp();
daterented = llGetSubString(date,8,9) + "/" + llGetSubString(date,5,6) + "/" + llGetSubString(date,0,3) + " | Time " + llGetSubString(date,11,15);
original_scale = llGetScale();
original_location = llGetPos();
list renttime = llParseStringKeepNulls(llGetSubString(m,14,llStringLength(m)), [":"], []);
integer days = llList2Integer(renttime,0);
integer hours = llList2Integer(renttime,1);
integer minites = llList2Integer(renttime,2);
integer seconds = llList2Integer(renttime,3);
integer total;
total = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minites * 60) + (seconds);
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236,0.236,0.236>;);
timerevent = total;
llSetTimerEvent(1);
llWhisper(0,"set to " + (string)days + " days " + (string)hours + " hours " + (string)minites + " mins " + (string)seconds + " seconds";);
rented = TRUE;
}
if (llGetSubString(m,0,10) == "set offset " && id==llGetOwner() && editmode == 1)
{
offset = (vector)llGetSubString(m,11,llStringLength(m));
llSay(0,"Offset set to " + (string)offset);
}
if (llGetSubString(m,0,8) == "set prims" && id==llGetOwner() && editmode == 1)
{
objects = (integer)llGetSubString(m,9,llStringLength(m));
llSay(0,"Prims set to " + (string)objects);
}
if (llGetSubString(m,0,8) == "set price" && id==llGetOwner() && editmode == 1)
{
price = (integer)llGetSubString(m,9,llStringLength(m));
llSay(0,"Price set to L$" + (string)price);
}

}
state_entry()
{
editmode = 0;
randchannel = (integer)llFrand(10000000);
llWhisper(0, "Activating...";);
ownername = llKey2Name(llGetOwner());
llWhisper(0, "Asking for permission from owner " + ownername + ".";);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
original_location = llGetPos();
original_scale = llGetScale();
llListenRemove(numListen);
rentedweeks = 0;
numListen = llListen(0, "", "", "" );
llListen(randchannel,"","","";);
timerevent = 0;
}

run_time_permissions(integer type)
{
if (type == PERMISSION_DEBIT)
{
ownername = llKey2Name(llGetOwner());
llWhisper(0, "This space is now available for rent.";);
not_registered = FALSE;
}
}

timer() {
timerevent--;
if (timerevent != 0)
{
}
else
{
if(rentorkey != NULL_KEY)
{
llInstantMessage(rentorkey,"Your rental at " + llGetRegionName() + " has expired";);
}
llSay(0,"rental expired";);
string objectname;
objectname = llGetObjectName();
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
numListen = llListen(0, "", "", "" );
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
daterented = "";
rentedweeks = 0;
rented = FALSE;
timerevent = 0;
llSetTimerEvent(0);
}
}

touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())

{
string edit;
if (editmode == 0)
{
edit = "off";
}
if (editmode == 1)
{
edit = "on";
}
llDialog(llGetOwner(),"vender editor \n editmode is set to: " + edit,["Mature","PG","Vacent","Edit Mode","Renter info","Help","Status"],randchannel);
}
else
{
if(rented == FALSE)
{
llWhisper(0, "This space is for rent. The price is $" +(string)price+ " per week. Prim limit is "+(string)objects+" prims. Obey prim limits to avoid termination of agreement. Rent is non-refundable.";);
if (mature == 1)
{
llWhisper(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease.";);
} else
{
llWhisper(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease. Keep To PG Rules as in PG Sim";);
}

llWhisper(0, "Right click and pay to rent this space. Minimum rental period is "+(string)weeks+" weeks, at $" +(string)(price*weeks)+". If you have any questions, please feel free to IM " + ownername + ". For Help please IM " + ownername + ".";);
}
else
{
integer weeks2;
weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days;
days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours;
hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins;
mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds;
seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llWhisper(0, "This space is occupied by " + rentor + " for " + (string)weeks2 + " weeks | " + (string)days + " days | " + (string)hours + ":" + (string)mins + ";" +(string)seconds);

llWhisper(0, "Max prims is " + (string)objects + ". For help please IM " + ownername + ".";);
}
}
}

money(key giver, integer amount)
{
integer amount2 = amount%price;
integer weeks = amount/price;
if(amount>=price*weeks && amount2==0 && rented == FALSE)
{
rentedweeks = amount/price;
string date = llGetTimestamp();
daterented = llGetSubString(date,8,9) + "/" + llGetSubString(date,5,6) + "/" + llGetSubString(date,0,3) + " | Time " + llGetSubString(date,11,15);
original_scale = llGetScale();
original_location = llGetPos();
timerevent = 604800*weeks;
//vector offset = <-2, 0, -1>;
llWhisper(0, "Correct amount";);
rentor = llKey2Name(giver);
rented = TRUE;
rentperiod = (string)weeks;
llWhisper(0, "Prim limit is "+(string)objects+" prims.";);
llWhisper(0, "Keep prim limits or risk termination of agreement.Rent is non-refundable. IM " + ownername + " with questions.";);
llWhisper(0, "Thank you for renting this space . Thank You For Purchasing "+(string)weeks+" weeks . Feel Free To Put Your stuff in now";);
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236,0.236,0.236>;);
rentorkey = giver;
llSetTimerEvent(1);
if(splitwith != [])
{
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount/devide;
integer no;
while(no < llGetListLength(splitwith))
{
key dest = llList2Key(splitwith,no);
llGiveMoney(dest,totatogive);
llInstantMessage(dest,"you have bee payed L$"+ (string)totatogive +" by " + llGetObjectName());
no ++;
}
}
}
else if(rented == TRUE)
{
if (llKey2Name(giver) == rentor && amount>=price*weeks && amount2==0)
{
timerevent += (604800*weeks);
llSay(0, "you have incresed your rental by " + (string)weeks + " weeks";);
rentedweeks += weeks;
if(splitwith != [])
{
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount/devide;
integer no;
while(no < llGetListLength(splitwith))
{
key dest = llList2Key(splitwith,no);
llGiveMoney(dest,totatogive);
llInstantMessage(dest,"you have bee payed L$"+ (string)totatogive +" by " + llGetObjectName());
no ++;
}
}
}
else
{
llGiveMoney(giver, amount);
llSay(0,"sorry please check rental";);
}

}

else
{
llWhisper(0, "Minimum rental period is "+(string)weeks+" weeks, at $" +(string)(price*weeks)+ ". If you have any questions, please feel free to IM" + ownername + ".";);
llWhisper(0, "Giving money back.";);
llGiveMoney(giver, amount);
}
}
}




and i want to add this code into it

default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0), "SHOP TO LET";);
}
}



now i know that im supposed to add it in after "default" as that inits the code. but its just not working & im gonna uninstall the whole fuckin thing & leave it if i cant get this done, i've been trying for hours & hours
Colette Meiji
Registered User
Join date: 25 Mar 2005
Posts: 15,556
08-27-2007 08:04
wow ..
Ann Launay
Neko-licious™
Join date: 8 Aug 2006
Posts: 7,893
08-27-2007 08:05
Might be better to post that here: /54/1.html
_____________________
~Now Trout Re-Re-Re-Certified!~
From: someone
I am bumping you to an 8.5 on the Official Trout Measuring Instrument of Sluttiness. You are an enigma - on the one hand a sweet, gentle, intelligent woman who we would like to wrap up in our arms and protect, and on the other, a temptress to whom we would like to do all sorts of unmentionable things.

Congratulations and shame on you! You are a bit of a slut.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-27-2007 08:06
*moves*
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Kevyn Hienke
Curmudgeon
Join date: 21 Dec 2006
Posts: 238
08-27-2007 08:09
Are you trying to give it two default states and two touch_starts? If so, that would be your problem. As mentioned above, this really belongs in a scripting forum, though.
Dnate Mars
Lost
Join date: 27 Jan 2004
Posts: 1,309
08-27-2007 08:12
Saying it is screwing up is not very helpful. What exactly isn't working?
_____________________
Visit my website: www.dnatemars.com
From: Cristiano Midnight
This forum is weird.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
08-27-2007 08:15
Definitely uninstall. go to counselling, learn how to ask simple questions w/o ranting and whining. I think thats your problem.

Hope it helps!
Dnate Mars
Lost
Join date: 27 Jan 2004
Posts: 1,309
08-27-2007 08:15
I don't know if this could be your issue or not, but this line: "list renttime = llParseStringKeepNulls(llGetSubString(m,14,llStrin gLength(m)), [":"], []);" has an extra space in the middle of llStringLength.
_____________________
Visit my website: www.dnatemars.com
From: Cristiano Midnight
This forum is weird.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-27-2007 08:17
From: Chaos Bikcin
now i know that im supposed to add it in after "default" as that inits the code. but its just not working & im gonna uninstall the whole fuckin thing & leave it if i cant get this done, i've been trying for hours & hours

Ok. Bye!

You're not trying to add another default state are you? If you do something like...
CODE

default
{
// stuff
}

default
{
// other stuff
}


...it's not going to be happy. You've also already got a touch_start event in the code you posted. You're not trying to add another touch_start event, are you? That won't work..
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
08-27-2007 08:20
You can't have two default states, or two touch_starts in one state...

Don't blame LSL if you don't understand it, and please use civilized English.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
08-27-2007 08:20
From: Dnate Mars
I don't know if this could be your issue or not, but this line: "list renttime = llParseStringKeepNulls(llGetSubString(m,14,llStrin gLength(m)), [":"], []);" has an extra space in the middle of llStringLength.

OMGWTHLOLMAO! Why can't LL even write a compiler to figure things like that out?!?!111 My dog took a computer class once and it could write a better comp1l3r!!11
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-27-2007 08:48
First off on line 125 you redefine 'id', which is a big no-no. You do it again on line 309 where you redefine 'weeks'.

P.S. the "llStrin gLength" thing is just the forum software adding a space every 60 characters.

CODE

list splitwith;
list splitname;
string ownername;
integer not_registered = TRUE;
vector original_location;
vector original_scale;
integer objects = 1; // objects
integer price = 9999999; // price
integer weeks = 1; // weaks
vector offset = <0, 0, 2 >;
integer mature = 0;
string rentor;
string rentorkey;
integer rented = FALSE;
string rentperiod;
integer numListen;
integer randchannel;
integer editmode;
string daterented;
integer rentedweeks;
integer timerevent;

string notecard = "SHOP TO LET";
string notecardhelp = "Rentals Help";

//Strife was here

default {
on_rez(integer change) {
llInstantMessage(llGetOwner(), "for help click item then select help from menu");
llSetTexture("rentit", ALL_SIDES);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
llListen(0, "", "", "");
randchannel = (integer) llFrand(10000000);
llListen(randchannel, "", "", "");
editmode = 0;
timerevent = 0;
rented == FALSE;
}
listen(integer c, string n, key id, string m) {
if(id == llGetOwner()){
string objectname = llGetObjectName();
if ( c == randchannel ){
if (m == "Vacent" && rented == TRUE) {
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
llListenRemove(numListen);
numListen = llListen(0, "", "", "");
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
rented = FALSE;
daterented = "";
rentedweeks = 0;
timerevent = 0;
llSetTimerEvent(0);
llSay(0, objectname + " is vacent");
}
if (m == "Mature") {
mature = 1;
llSay(0, "set to Mature Area");
}
else if (m == "Renter info") {
integer weeks2 = timerevent / 604800;
integer days = (timerevent / 86400) % 7;
integer hours = (timerevent / 360 ) % 24;
integer mins = (timerevent / 60) % 60;
integer seconds = timerevent % 60;
llOwnerSay("Renter name: " + rentor);
llOwnerSay("Rented Date: " + daterented);
llOwnerSay("Rented Left: " + (string) weeks2 + " weeks | " + (string) days + " days | " + (string) hours + ":" +
(string) mins + ";" + (string) seconds);

if (rentedweeks > 0)
n = (string) rentedweeks + llGetSubString(" weeks", 0, (rentedweeks > 1) - 2);
else
n = "N/A";
llOwnerSay("Rented amount: " + n);
}
else if (m == "PG") {
mature = 0;
llSay(0, "set to PG Area");
}
else if (m == "Status") {
string mit;
llOwnerSay("Prim's set to " + (string) objects);
llOwnerSay("Week's set to " + (string) weeks);
llOwnerSay("Offset set to " + (string) offset);
if (mature == 1) {
mit = "Yes";
} else {
mit = "No";
}
llOwnerSay("Regen Mature: " + (string) mit);
}
else if (m == "Edit Mode"){
editmode = !editmode;
llOwnerSay("editmode "+llList2String(["off","on"], editmode));
}
else if (m == "Help") {
llGiveInventory(id, notecardhelp);
}
}
else if (editmode == 1)
{
if (llGetSubString(m, 0, 8) == "set weeks") {
weeks = (integer) llGetSubString(m, 9, -1);
llSay(0, "weeks set to " + (string) weeks);
}
else if (llGetSubString(m, 0, 10) == "set renter ") {
rentor = llGetSubString(m, 11, -1);
llSay(0, "renter set to " + rentor);
}
else if (llGetSubString(m, 0, 9) == "set split ") {
splitwith += (m = llGetSubString(m, 10, -1));
splitname += (n = llKey2Name(m));
llSay(0, n + " added to split with list");
}
else if (llGetSubString(m, 0, 12) == "split remove ") {
string name = llGetSubString(m, 13, -1);
integer finddata = llListFindList(splitname, (list) name);
if (finddata == -1) {
llSay(0, "sorry " + name + " not found");
} else {
llDeleteSubList(splitwith, finddata, finddata);
llDeleteSubList(splitname, finddata, finddata);
llSay(0, name + " removed from shared list");
}
}
else if (llGetSubString(m, 0, 13) == "set rentedfor ") {
string date = llGetTimestamp();
daterented =
llGetSubString(date, 8, 9) + "/" + llGetSubString(date, 5, 6) + "/" + llGetSubString(date, 0,
3) + " | Time " +
llGetSubString(date, 11, 15);
original_scale = llGetScale();
original_location = llGetPos();
list renttime = llParseStringKeepNulls(llGetSubString(m, 14, -1),[":"],[]);
integer days = llList2Integer(renttime, 0);
integer hours = llList2Integer(renttime, 1);
integer minites = llList2Integer(renttime, 2);
integer seconds = llList2Integer(renttime, 3);
integer total;
total = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minites * 60) + (seconds);
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236, 0.236, 0.236 >);
timerevent = total;
llSetTimerEvent(1);
llWhisper(0,
"set to " + (string) days + " days " + (string) hours + " hours " + (string) minites + " mins " +
(string) seconds + " seconds");
rented = TRUE;
}
else if (llGetSubString(m, 0, 10) == "set offset ") {
offset = (vector) llGetSubString(m, 11, -1);
llSay(0, "Offset set to " + (string) offset);
}
else if (llGetSubString(m, 0, 8) == "set prims") {
objects = (integer) llGetSubString(m, 9, -1);
llSay(0, "Prims set to " + (string) objects);
}
else if (llGetSubString(m, 0, 8) == "set price") {
price = (integer) llGetSubString(m, 9, -1);
llSay(0, "Price set to L$" + (string) price);
}
}
}
}
state_entry() {
editmode = 0;
randchannel = (integer) llFrand(10000000);
llWhisper(0, "Activating...");
ownername = llKey2Name(llGetOwner());
llWhisper(0, "Asking for permission from owner " + ownername + ".");
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
original_location = llGetPos();
original_scale = llGetScale();
llListenRemove(numListen);
rentedweeks = 0;
numListen = llListen(0, "", "", "");
llListen(randchannel, "", "", "");
timerevent = 0;
}

run_time_permissions(integer type) {
if (type == PERMISSION_DEBIT) {
ownername = llKey2Name(llGetOwner());
llWhisper(0, "This space is now available for rent.");
not_registered = FALSE;
}
}

timer() {
--timerevent;
if (timerevent != 0) {
} else {
if (rentorkey != NULL_KEY) {
llInstantMessage(rentorkey, "Your rental at " + llGetRegionName() + " has expired");
}
llSay(0, "rental expired");
string objectname;
objectname = llGetObjectName();
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
numListen = llListen(0, "", "", "");
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
daterented = "";
rentedweeks = 0;
rented = FALSE;
timerevent = 0;
llSetTimerEvent(0);
}
}

touch_start(integer total_number) {
if (llDetectedKey(0) == llGetOwner())
{
llDialog(llGetOwner(), "vender editor \n editmode is set to: " + llList2String(["off","on"], editmode),
["Mature", "PG", "Vacent", "Edit Mode", "Renter info", "Help", "Status"], randchannel);
} else {
if (rented == FALSE) {
llGiveInventory(llDetectedKey(0), notecard);
llWhisper(0,
"This space is for rent. The price is $" + (string) price + " per week. Prim limit is " +
(string) objects +
" prims. Obey prim limits to avoid termination of agreement. Rent is non-refundable.");
if (mature == 1) {
llWhisper(0,
"Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease.");
} else {
llWhisper(0,
"Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease. Keep To PG Rules as in PG Sim");
}

llWhisper(0,
"Right click and pay to rent this space. Minimum rental period is " + (string) weeks + " weeks, at $" +
(string) (price * weeks) + ". If you have any questions, please feel free to IM " + ownername +
". For Help please IM " + ownername + ".");
} else {
integer weeks2;
weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days;
days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours;
hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins;
mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds;
seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llWhisper(0,
"This space is occupied by " + rentor + " for " + (string) weeks2 + " weeks | " + (string) days +
" days | " + (string) hours + ":" + (string) mins + ";" + (string) seconds);

llWhisper(0, "Max prims is " + (string) objects + ". For help please IM " + ownername + ".");
}
}
}

money(key giver, integer amount) {
integer amount2 = amount % price;
integer weeks2 = amount / price;
if (amount >= price * weeks2 && amount2 == 0 && rented == FALSE) {
rentedweeks = amount / price;
string date = llGetTimestamp();
daterented =
llGetSubString(date, 8, 9) + "/" + llGetSubString(date, 5, 6) + "/" + llGetSubString(date, 0,
3) + " | Time " +
llGetSubString(date, 11, 15);
original_scale = llGetScale();
original_location = llGetPos();
timerevent = 604800 * weeks2;
//vector offset = <-2, 0, -1>;
llWhisper(0, "Correct amount");
rentor = llKey2Name(giver);
rented = TRUE;
rentperiod = (string) weeks2;
llWhisper(0, "Prim limit is " + (string) objects + " prims.");
llWhisper(0,
"Keep prim limits or risk termination of agreement.Rent is non-refundable. IM " + ownername +
" with questions.");
llWhisper(0,
"Thank you for renting this space . Thank You For Purchasing " + (string) weeks2 +
" weeks . Feel Free To Put Your stuff in now");
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236, 0.236, 0.236 >);
rentorkey = giver;
llSetTimerEvent(1);
if (splitwith !=[]) {
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount / devide;
integer no;
while (no < llGetListLength(splitwith)) {
key dest = llList2Key(splitwith, no);
llGiveMoney(dest, totatogive);
llInstantMessage(dest, "you have bee payed L$" + (string) totatogive + " by " + llGetObjectName());
++no;
}
}
} else if (rented == TRUE) {
if (llKey2Name(giver) == rentor && amount >= price * weeks2 && amount2 == 0) {
timerevent += (604800 * weeks2);
llSay(0, "you have incresed your rental by " + (string) weeks2 + " weeks");
rentedweeks += weeks2;
if (splitwith !=[]) {
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount / devide;
integer no;
while (no < llGetListLength(splitwith)) {
key dest = llList2Key(splitwith, no);
llGiveMoney(dest, totatogive);
llInstantMessage(dest, "you have bee payed L$" + (string) totatogive + " by " + llGetObjectName());
++no;
}
}
} else {
llGiveMoney(giver, amount);
llSay(0, "sorry please check rental");
}

}

else {
llWhisper(0,
"Minimum rental period is " + (string) weeks2 + " weeks, at $" + (string) (price * weeks2) +
". If you have any questions, please feel free to IM" + ownername + ".");
llWhisper(0, "Giving money back.");
llGiveMoney(giver, amount);
}
}
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-27-2007 10:41
From: someone
SL scripting is screwed up! I got a freebie script and I fiddled with it and now it doesn't work! Here it is, fix it for me!

(wall of code ensues)

kthxbye!


Gack!

Erm. Maybe you need to hire a scripter or learn yourself. There's a thread up at the top of this forum for beginners.

There's also Products Wanted and Employment Opportunities forums nearby which you can post ads for paid help.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
08-28-2007 00:47
Why not just add the notecard vendor as a 2nd script in the content window instead of trying to merge 2 scripts into one?