Need Help

this was made for me, and its confusing the hell out of me…can someone simplify it or explain exactly how to work it?

//Example for “Room/House 1”
if (playerchats) {
//server.room1 = Owner,RentBalance,RentDue,UnLocked
if(strequals(#g,Zinijh Hotel Manager)||strequals(#a, Dontar)) { // Manager Controls
if(strequals(#c,Collect Rent)) { // “Collect Rent”
if(strtofloat(#I(server.room1,1)) == strtofloat(#I(server.room1,2))) {
replacestring server.room1,1,0;
playerrupees += strtofloat(#I(server.room1,2));
setplayerprop #c,:Collected Rent:;
} else setplayerprop #c,:Failed to Collect Rent:;
} else if(startswith(setrent ,#c) && strlen(#c) > 8) { // "SetRent "
tokenize #c; replacestring server.room1,2,#t(1);
setplayerprop #c,:Rent set to #v(strtofloat(#I(server.room1,2))):;
} else if(startswith(setowner ,#c) && strlen(#c) > 8) { // "SetOwner "
tokenize #c; replacestring server.room1,0,#t(1);
setplayerprop #c,:Owner set to #I(server.room1,0):;
}
} else if(strequals(#I(server.room1,0),#a)) { // Rent Controls
if(strequals(#c,Pay Rent)) { // “Pay Rent”
if(playerrupees >= strtofloat(#I(server.room1,2))-strtofloat(#I(server.room1,1))) {
this.temp -= strtofloat(#I(server.room1,2))-strtofloat(#I(server.room1,1));
playerrupees -= this.temp;
replacestring server.room1,1,#v(strtofloat(#I(server.room1,1))+this.temp);
setplayerprop #c,:Rent Paid (#v(strtofloat(#I(server.room1,1)))/#v(strtofloat(#I(server.room1,2)))):;
} else setplayerprop #c,:Insufficient Funds:;
} else if(strequals(#c,Lock Door)) { // “Lock Door”
replacestring server.room1,3,0;
setplayerprop #c,:Locked:;
} else if(strequals(#c,Unlock Door)) { // “Unlock Door”
replacestring server.room1,3,1;
setplayerprop #c,:Unlocked:;
}
}
}

if(playertouchsme) { //If its a Door
if(strequals(#g,Zinijh Hotel Manager) // Manager
|| strequals(#I(server.room1,0),#a) // Owner
|| strequals(#I(server.room1,3),1)) { // Unlocked
setlevel2 level,x,y; // Warp to Inside Level
}
}

I can explain how it works in general, not completely sure about the server stuff, but whatever.

First chunk there obviously kicks in when any player says something. First half of that chunk relates to either your account as the owner “strequals(#a, Dontar)”, or a manager by means of guild tag (#g,Zinijh Hotel Manager). From there the different if statments relate to collecting rent, setting rent, or setting the owner. They are all managed by altering server side string that is set to include data on a specific room, the rent, and the owner. Same goes for the second half of that chunk, checking for the owner who can alter the string by paying rent and locking/unlocking the door.

Second chunk isn’t too complex, as it either lets the manager and owner through regardless of whether it’s locked, but will only let other players through when it’s unlocked.

Not sure you even needed that other stuff, as it’s probably the string editing that’s throwing you off.

Looks like:
server.room1,0 represents the owner’s account name
server.room1,1 is the payment for rent, if paid it will be equal to server.room1,2
server.room1,2 is the actual rent, set by the manager
server.room1,3,0 means the door is locked
server.room1,3,1 means the door is locked

I assume #I calls server side strings, never used it before.

[QUOTE=Garacat;9820]I assume #I calls server side strings, never used it before.[/QUOTE]
Grabs a string at a certain index in a string array

so when I say like setowner Beholder it will give room1 to beholder, then change it to server.room2,0 it will give room2 to like dangerless. currect?

so I add the script to everyroom,l changing the server.room# depending on room…

when explained it does sound simple

ok I somewhat understand it know…

now is there a string thing in there to keep track of the rent due? and is there a script that I can add to an npc that tells whoever owns server.room1 his rent due, and server.room2 his rent without showing room1 or visa versa? in one npc, cause I wanna have an npc like that in main lobby (in chat text) cause right now I have a placeholder npc thats chest.gif

EDIT: erm, I cant get payrent to work, I used it to give ownership of room to me, set rent to 500, gave myself 5000 rupee, said pay rent, nothing happen. >> maybe it would work online <<