Jump to content

if statement not working correctly!


Mojko

Recommended Posts

    while true do
        local row = mysql_fetch_assoc(result)
        local xx = row["x"]
        local var_1 = 1
        local var_2 = 1
        outputChatBox(row["x"])
        outputChatBox(turfInformation[1][X])
        outputChatBox(row["y"])
        outputChatBox(turfInformation[1][Y])
        outputChatBox(maxZones)
        if(row["x"] == turfInformation[1][X]) then
            outputChatBox("Can't create a turf here")
        end
    end

So, what do we have here?

Basicly I want "Can't create a turf here" be sent as a message to the player if the "X" position in my MySQL table equals to the "X" position of turfInformation.

This is what prints out in game at the moment:

90W2ZhR.png

row["x"] = 2634.71

turfInformation[1][X] = 2634.71

row["y"] = -1649.41

turfInformation[1][Y] = -1649.41

 

So, what's the issue?

"Can't create a turf here" never get's printed out.

 

I've tried to take the value "2634.71" and make an if statement that looks like this:

if(turfInformation[1][x] == 2634.71)

And that works, but that's not what I want, I want to use row["x"] instead.

 

Thank you!

 

EDIT:

Here's the query:

local result = mysql_query(connection,"SELECT * FROM gang_territories")

Edited by Mojko
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...