Jump to content

Question Regarding Query Session And Destroy


Usarjjaco

Recommended Posts

Hello,Continuing in my endeavors I've reached the next point.. and another conundrum. Background: A user has 10 locations where they can store items (Location 1 being on the person)A users capacity(location 1) is affected by whether or not they have a vehicle, and what type of vehicle that is.-----What I've done already:Created a table for each item type with location 1 - 10Created a table for location capacitiesCreated a vehicles table that has the values of what each vehicle can hold.---------------------------------------------------The problem:Lets say user Joe by himself has a capacity of 50He then gets a vehicle which brings his capacity to 250He then gets item A which weighs 50, which brings his remaining capacity to 200.Joe decided to switch vehicles; but the new vehicle has less capacity than the first... (My formula is set up like:(UPDATE locationweights SET l1=l1 + new vehicle capacity - old vehicle capacity WHERE username = $uname ) (ignore syntax, just showing))So the problem I run into is this; if the player runs out of capacity by switching vehicles; or if the capacity of the new vehicle cannot hold all the items a player currently has; how do I make it so the player can choose which items to get rid of? .... if it's too complicated to script this I will probably just end up making it so a player can't switch to a vehicle that doesn't have enough capacity to hold what he has currently.Thanks,JJ

Link to comment
Share on other sites

Sounds like you may need to use a server-side language for this.

if (new vehicle cap < old vehicle cap) {  // show items to get rid off}else if (new vehicle cap < total user cap) { // show items to get rid off}else { // your update query}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...