News:

SimuTranslator
Make Simutrans speak your language.

[Road sign] Player is authorized?

Started by Yona-TYT, February 04, 2018, 03:32:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT




is it possible to know if the player is authorized to use the toll?







Dwachs

Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Thanks !!, I will work with this soon ;)... I hope it works in multiplayer mode  ;D .

Yona-TYT

#3
Here is a script that allows you to share the regions with several players using the toll signs.

script -> region-lite-v2.0.zip

savegame -> http://files.simutrans.com/index.php/s/qBIJrhPsoVzkjpg

function region_shared(pl, tool_id, pos, result)
{
  for (j=0;j<12;j++) {
    if (j == (pl-2))
      continue
    local tile = square_x(coord_label1[j].x+1, coord_label1[j].y).get_ground_tile()
   
    local sign = tile.find_object(mo_roadsign)
    if(sign){
   
    if (sign.can_pass(player_x(pl))){
        if (pos.x+1 >= pl_reg[j].x1 && pos.x <= pl_reg[j].x2+1 && pos.y+1 >= pl_reg[j].y2 && pos.y<= pl_reg[j].y1+1 ) {
          return null
        }
    }
    }
  }
  return result
}