Script seems to confuse businesses and houses..
#1

Alright here is my problem.

Two days ago I finished the housing system for my roleplay script. It worked absolutely perfectly and I was quite happy with it. So I started working on businesses and I've pretty much written all the code for businesses to be finished but things aren't working right.

The way my system works is when you add a business and/or house in the script and it creates the pickup it saves the pickupid as HousePickup[houseid] or BizPickup[bizid]. Then Under OnPlayerPickUpStreamPickup I have a script that loops through the houses/businesses and finds if the pickupid matches a certain house or business. If it does it displays the correct information in accordance to the business/house. Like I said houses worked perfectly but now that I added businesses here is what happens:

If the loop has if(HousePickup[i] == pickupid) first then: Houses display correctly and work well. Businesses display nothing (no gametext) upon pickup

If the loop has if(BizPickup[i] == pickupid) first then : Houses display the gametext a business is suppose to display when it is for sale. Businesses display nothing (no gametext) upon pickup

I use mysql to store my data.

Here is my code.

AddHouse() : http://pastebin.com/m4b7a442c
AddBusiness() : http://pastebin.com/m316e8d77
OnPlayerPickUpStreamPickup : http://pastebin.com/m49e91e01
ShowInfo() : http://pastebin.com/m69faaa54 (my loop)

I hope to find a solution soon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)