Jump to content

Problem in house system


sckatchof

Recommended Posts

Posted

hello guys i have a problem in house system :

244zguu.png

  
function createhouse(thePlayer, cmd, int, preis) 
    if (isAdminLevel ( thePlayer ) == 3) then 
        if (intids[tonumber(int)]) and (tonumber(int) >= 1) then 
            if (tonumber(preis) >= 5000) and (tonumber(preis) <= 10000000) then 
                x,y,z = getElementPosition(thePlayer) 
                owner = "none" 
            local erg = mysql_query(sqlcon, "INSERT INTO house_data (`Int`, Owner, Preis, X, Y, Z, `Lock`)  
VALUES ('"..tonumber(int).."','"..owner.."','"..tonumber(preis).."','"..x.."','"..y.."','"..z.."','0')") 
                Housspawn() 
                outputChatBox("House created!") 
            else 
                           outputChatBox("Invalid price!", thePlayer,255,0,0) 
            end 
else     
outputChatBox("Invalid interior!", thePlayer,255,0,0) 
    end 
else 
    outputChatBox("You are not authorized!", thePlayer, 255,0,0) 
end 
end 
addCommandHandler("addhouse", createhouse) 

Posted

Try this:

function createhouse(thePlayer, cmd, int, preis) 
    if (isAdminLevel ( thePlayer ) == 3) then 
        if (intids[tonumber(int)]) and (tonumber(int) >= 1) then 
            if (tonumber(preis) >= 5000) and (tonumber(preis) <= 10000000) then 
                x,y,z = getElementPosition(thePlayer) 
                owner = "none" 
            local erg = mysql_query(sqlcon, "INSERT INTO house_data (`Int`, Owner, Preis, X, Y, Z, `Lock`) VALUES ('"..tonumber(int).."','"..owner.."','"..tonumber(preis).."','"..x.."','"..y.."','"..z.."','0')") 
                Housspawn() 
                outputChatBox("House created!") 
            else 
                           outputChatBox("Invalid price!", thePlayer,255,0,0) 
            end 
else    
outputChatBox("Invalid interior!", thePlayer,255,0,0) 
    end 
else 
    outputChatBox("You are not authorized!", thePlayer, 255,0,0) 
end 
end 
addCommandHandler("addhouse", createhouse) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...