da_gad_pader Posted June 2, 2011 Author Share Posted June 2, 2011 can someone tell me how to open shop by clicking and not walking on it? Link to comment Share on other sites More sharing options...
Yxxe Posted June 2, 2011 Share Posted June 2, 2011 Do you mean clicking the NPC set to "Shopkeeper", or just clicking the "Shop" tile? Link to comment Share on other sites More sharing options...
da_gad_pader Posted June 2, 2011 Author Share Posted June 2, 2011 in other words i can make an npc pic shown by just putting it on tilesets, then put it on map , so i can put an attribute for a shop on its location, but i want to open a shop by clicking on it not by walking on it? Link to comment Share on other sites More sharing options...
Yxxe Posted June 2, 2011 Share Posted June 2, 2011 Find "Sub HandleSearch" server-side and paste this just above "End Sub":```If Map(GetPlayerMap(Index)).Tile(x, y).Type = TILE_TYPE_SHOP Then ShopNum = Map(GetPlayerMap(Index)).Tile(x, y).Data1 If ShopNum > 0 Then ' shop exists? If Len(Trim$(Shop(ShopNum).Name)) > 0 Then ' name exists? SendOpenShop Index, ShopNum TempPlayer(Index).InShop = ShopNum ' stops movement and the like End If End IfEnd If```It's untested, but it should work, seeing as I just copied the code from the PlayerMove procedure. Don't forget to declare "ShopNum As Long" at the beginning of the procedure! Link to comment Share on other sites More sharing options...
da_gad_pader Posted June 2, 2011 Author Share Posted June 2, 2011 like this? ```If Map(GetPlayerMap(index)).Tile(x, y).Type = TILE_TYPE_SHOP Then If x > 0 Then ' shop exists? If Len(Trim$(Shop(x).Name)) > 0 Then ' name exists? SendOpenShop index, x TempPlayer(index).InShop = x ' stops movement and the like End If End If End IfEnd Sub``` Link to comment Share on other sites More sharing options...
Yxxe Posted June 2, 2011 Share Posted June 2, 2011 I posted the code you need above. ;] x is already defined so we don't want to mess with that… so I just replaced "x" with "ShopNum", to keep it nice and simple. :P Link to comment Share on other sites More sharing options...
da_gad_pader Posted June 2, 2011 Author Share Posted June 2, 2011 it worked , tnx again lightning , i owe u 2 now , lol Link to comment Share on other sites More sharing options...
maxi_d_great Posted June 4, 2011 Share Posted June 4, 2011 how about on bank? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now