[API] Calling player.createArea() with existing area id

  • I was wondering if calling repeatedly player:createArea(area); player:showArea(areaId); , where area[0] == areaId , with the exact same values created multiple areas with the same id, or was replacing any previous area?

  • I'll answer my own question : Yes, it will create areas of the same id every time, and will not replace a previous area of the same id.



    i think it users AUTO_INCREMENT for the id so id 1 would be area id 1 area 2 would be area id 2 and so on to remove the area you need to be inside it so then it would only remove the right id of that area you are inside

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • that got me thinking what happens when you have two areas of the same name and use /cleanuparea area this time we are not in the area to know the id of the area we want to clean up lol

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • i think it users AUTO_INCREMENT for the id so id 1 would be area id 1 area 2 would be area id 2 and so on to remove the area you need to be inside it so then it would only remove the right id of that area you are inside


    You are mistaking MySQL id (a PRIMARY KEY AUTO_INCREMENT) with an area id, which is defined when calling player:createArea. I am talking about the latter.

  • You are mistaking MySQL id (a PRIMARY KEY AUTO_INCREMENT) with an area id, which is defined when calling player:createArea. I am talking about the latter.




    my mistake was thinking the name area was just a name of a area you used as a example name of a area you protected using the protection script and was only a guess of how the id would work in the DB for that area, i know some php but very little java and lua and to be frank it bores the hell out of me lol

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!