Jump to content
  • 0

How to write a script for no vending on streets in towns


Hobgeek

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

Okay so one possible solution for my solution is using the mapflag..

How will I write it using mapflag for example I want to implement no vending on streets policy in towns?

Are there any other solutions instead of mapflag?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

*setcell "<map name>",<x1>,<y1>,<x2>,<y2>,<type>,<flag>;

Each map cell has several 'flags' that specify the properties of that cell.

These include ... no vending ...

Examples:

setcell "arena",0,0,300,300,cell_basilica,1;
setcell "arena",140,140,160,160,cell_basilica,0;
setcell "arena",135,135,165,165,cell_walkable,0;
setcell "arena",140,140,160,160,cell_walkable,1;

From const.txt:

cell_walkable 0
cell_shootable 1
cell_water 2
cell_npc 3
cell_basilica 4
cell_landprotector 5
cell_novending 6
cell_nochat 7

Edited by plankt
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Take this one I made as example:

-    script    Setcell#func    -1,{

OnInit:
setcell "dellar",96,119,107,102,cell_novending,1;
setcell "dellar",76,103,121,34,cell_novending,1;
setcell "dellar",54,95,132,32,cell_novending,1;
setcell "dellar",145,97,76,34,cell_novending,1;
setcell "dellar",144,150,120,102,cell_novending,1;
setcell "dellar",62,149,84,101,cell_novending,1;
setcell "dellar",88,126,96,118,cell_novending,1;
setcell "dellar",112,126,119,117,cell_novending,1;
end;
}

This disables vending across the map except for the red zones:

dellarvend.png

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  06/08/12
  • Last Seen:  

Thank you to both of you! These codes are very helpful. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...