Jump to content

Prevent how toplayer from taking an item from a container or vendor


genovauk

Recommended Posts

I have a script that checks the amount of an item in the inventory, what Im a bit stuck on is for the script to check the number in a set of variables I have set up and if the player has the same as the variable count then a message pops up sayin they can't carry anymore of that item, But at the same time doesn't remove said item from the container\vendor so the player can go back to it later when they can carry more of that item and take it out

 

Example

 

variable :

short scrapmetalcount 100 (100 being the max the player can have in their inventory)

 

then the script checks the scrapmetal count and if the player already has 100 then the message will display saying they cant carry anymore, and leaves the scrap metal in the container\vendor\ or if its on the floor or shelf leave it there.

 

The thing is I don't want the script to run on the item or items that have a carry limit, the script will be running a low processed quest.

 

I can do it myself to a point where I would let the player add the item to inventory but then the script takes all of that item away and puts back in the maximum they can carry. so if they have 100 scrap metal they pick up 1 more the script would take all 101 out and put back in 100. But then that extra 1 gets lost from the gameworld wherever it was picked up.

Link to comment
Share on other sites

Update :

 

Extensive searching throught the geck wiki I found the drop\GetItemCount commands, Using this I was able to calculate how much scrap metal needed to be dropped if maximum available carry amount was over the maximum.

 

Basically the script looks at the variables for the max amount and counts how much is in inv it then subtracts the max amount and drops the excess on the floor

 

Scrap metal in inv 622

max is 600

22 gets dropped

 

this way the user is able to buy or pick up even if it goes over max but then tell the player they have reached their limit and drops it on the ground, Although this may not be the perfect way as the dropped item could get lost in clutter of the room, It doesn't disapear and is able to pick it back up at a later time.

 

If anyone is interested in the scripts for whatever reason I will be releasing a mod with these scripts in place, Will post here when i'm done.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...