function script rent_villas {
set @t, getarg(3);
mes "^FF0000[Villas " + getarg(0) + "]^000000";
mes "The best place to rent...";
mes "" + @t + " Houses for rent.";
mes "Cost of Property: ^0000FF" + getarg(1) + " Zeny^000000";
set @j, 22;
for (set @i, 1; @i <= @t; set @i, @i + 1) {
if (getd("$house" + getarg(2) + @i + "_rent") == 1) set @j, @j - 1;
}
if (@j == 0) mes "There are no properties available.";
else mes "Properties Available: ^0000FF" + @j + "^000000.";
close;
}
//============================================================
//= Functions of the Signboard that shows the owners and GM options
//= (id of Villa,Amount of Houses)
//============================================================
function script rent_letrero {
mes "[Rental Information]";
mes "Current Owners:";
set @t, getarg(1);
for (set @i, 1; @i <= @t; set @i, @i + 1) {
if (getd("$house" + getarg(0) + @i + "_rent") == 1) {
if (@Color$ == "^0000FF")
set @Color$, "^FF0000";
else
set @Color$, "^0000FF";
// Detalle de Casa
mes @Color$ + "House N?" + @i + " rented a " + getd("$house" + getarg(0) + @i + "_user$") + ".";
if (getgmlevel())
mes "Accessed " + getd("$house" + getarg(0) + @i + "_accesos") + " time from last reset";
mes "Final: " + getd("$house" + getarg(0) + @i + "_buy_day") + "-" + getd("$house" + getarg(0) + @i + "_buy_month") + "-" + getd("$house" + getarg(0) + @i + "_buy_year") + ".^000000";
}
}
if (getgmlevel()) goto L_GMmenu;
close;
L_GMmenu:
next;
menu "Release a house",L_Liberar,"Clean Accounts",L_Limpiar,"Cancel",-;
L_Salir:
mes "^FF0000[Rental Information]^000000";
mes "Level of administrative access";
mes "Goodbye...";
close;
L_Limpiar:
mes "^FF0000[Rental Information]^000000";
for (set @i, 1; @i <= @t; set @i, @i + 1) {
setd "$house" + getarg(0) + @i + "_access", 0;
}
mes "Logs in accessing the house has been reseted.";
close;
L_Liberar:
mes "^FF0000[Rental Information]^000000";
mes "You want to release a house?(1 - " + @t + ")";
mes "Enter the number of the house you want to release. (0 o mayor que " + @t + " para cancelar).";
next;
input @house;
if (@house < 1) goto L_Salir;
if (@house > @t) goto L_Salir;
if (getd("$house" + getarg(0) + @house + "_rent") == 1) {
mes "^FF0000[Information on Rents]^000000";
setd "$house" + getarg(0) + @house + "_rent", 0;
mes "The house " + @house + " has been released.";
killmonsterall "rentin" + getarg(0) + @house + ".gat"; // Kills the small monsters
} else {
mes "^FF0000[Rental Information]^000000";
mes "I'm sorry, but this house doesn't have an owner right now!";
mes "Please try again with a different number.";
}
close;
}
Question
jimmyyheah
use codebox
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.