blob: 2be2ccc61b89888b8579a4c8e1075c3909378a97 (
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
32
33
34
|
// TMW2 Script
//
// @rentitem <item> <time>
// Rents an <item> for <time> seconds
// 1 hour: 3600s
// 1 day: 86400s
// 1 month: 2592000s
- 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;
}
|