summaryrefslogtreecommitdiff
path: root/npc/commands/rent.txt
blob: cafe41e33f842e065ba9924c63bec65c32c3e0d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// TMW2 Script
//
// @rentitem <item> <time>
// Rents an <item> for <time>

-	script	@rentitem	32767,{
    end;

OnCall:
    //.@request$ = "";
	//.@request$ += implode(.@atcmd_parameters$, " ");

    .@item=atoi(.@atcmd_parameters$[0]);
    .@time=atoi(.@atcmd_parameters$[1]);

    if (!.@item || !.@time) {
        dispbottom l("@rentitem <item numeric id> <time in seconds>");
        end;
    }

    // Limiting to 365 days max
    .@time=limit(15, .@time, 31536000);

    rentitem(.@item, .@time);
    end;

OnInit:
    bindatcmd "rentitem", "@rentitem::OnCall", 80, 99, 1;
    end;
}