PDA

View Full Version : (TSL) Empty inventory script


Malxados
05-27-2009, 08:57 PM
I was wondering if anyone knew how to totally empty someone's inventory (like when you're arrested on Telos).

Also, does anyone know the script that fires the final movie?

Thanks,
Malxados

glovemaster
05-28-2009, 08:30 AM
Well if your talking total item destruction - I warn you though, not many players are going to like that :p - this script will do the trick:

void main() {
object oPerson = GetFirstPC(); // Presumably you want to empty the players inventory.
object oItem = GetFirstItemInInventory(oPerson);
while(oItem != OBJECT_INVALID) {
DestroyObject(oItem);

oItem = GetNextItemInInventory(oPerson);
}
}

R2-X2
05-28-2009, 10:46 AM
What if you want to put all items he has into a locker, so you can get them back? (Like on the leviathan)

Demongo
05-28-2009, 11:17 AM
What if you want to put all items he has into a locker, so you can get them back? (Like on the leviathan)

I think glovemaster's script destroys all item you have and can't get it back. I'm sure there's a script in K1 for that. The problem is that the script is compiled:p

glovemaster
05-28-2009, 11:21 AM
Just a few adjustments to that script will do ^

void main() {
object oPerson = GetFirstPC();
object oStorage = GetObjectByTag("tag_of_locker");
object oItem = GetFirstItemInInventory(oPerson);
while(oItem != OBJECT_INVALID) {
AssignCommand(oStorage, ActionTakeItem(oItem, oPerson));
oItem = GetNextItemInInventory(oPerson);
}
}

That should work :)

R2-X2
05-28-2009, 04:52 PM
Thanks! I can't use it now, but sometimes every single script becomes usable.