Jump to content

Elevator system won't work.


Spliff

Recommended Posts

Hey guys, so, I am working on a RP gamemode atm, which uses very few parts of the Valhalla script.

(Elevator system and half of the item system)

Anyways, I've been trying to get the elevator system to work, yet whenever I try it out ingame, it simply gives me the error: "There was an error while creating an elevator. Try again."

I've posted the code giving trouble below, any suggestions?

Note: The mysql db seems to be fine, yet the query does not get added.

function createElevator(thePlayer, commandName, interior, dimension, ix, iy, iz) 
    if (exports.global:isPlayerSuperAdmin(thePlayer)) or (exports.donators:hasPlayerPerk(thePlayer,14) and exports.global:isPlayerFullAdmin(thePlayer)) then 
        if not (interior) or not (dimension) or not (ix) or not (iy) or not (iz) then 
            outputChatBox("SYNTAX: /" .. commandName .. " [interior ID] [Dimension ID] [X] [Y] [Z]", thePlayer, 255, 194, 14) 
        else 
            local x, y, z = getElementPosition(thePlayer) 
             
            interior = tonumber(interior) 
            dimension = tonumber(dimension) 
            local interiorwithin = getElementInterior(thePlayer) 
            local dimensionwithin = getElementDimension(thePlayer) 
            ix = tonumber(ix) 
            iy = tonumber(iy) 
            iz = tonumber(iz) 
            id = SmallestElevatorID() 
            if id then 
                local query = mysql:query_free("INSERT INTO elevators SET id='" .. mysql:escape_string(id) .. "', x='" .. mysql:escape_string(x) .. "', y='" .. mysql:escape_string(y) .. "', z='" .. mysql:escape_string(z) .. "', tpx='" .. mysql:escape_string(ix) .. "', tpy='" .. mysql:escape_string(iy) .. "', tpz='" .. mysql:escape_string(iz) .. "', dimensionwithin='" .. mysql:escape_string(dimensionwithin) .. "', interiorwithin='" .. mysql:escape_string(interiorwithin) .. "', dimension='" .. mysql:escape_string(dimension) .. "', interior='" .. mysql:escape_string(interior) .. "'") 
                if (query) then 
                    --reloadOneElevator(id, true) 
                    loadOneElevator(id) 
                    outputChatBox("Elevator created with ID #" .. id .. "!", thePlayer, 0, 255, 0) 
                end 
            else 
                outputChatBox("There was an error while creating an elevator. Try again.", thePlayer, 255, 0, 0) 
            end 
        end 
    end 
end 
addCommandHandler("addelevator", createElevator, false, false) 

Link to comment
which uses very few parts of the Valhalla script

A true man, takes great pride in his work. Of the couple thousand lines my game mode is (36 Klocs and growing, so its actually small at the moment but) I would hang anyone who stole even a piece of my scripts. Well.

Yeah, Id find them, and hang them.

Otherwise, be very choosy of your words on this forum. Steal any scripts and we will make sure your stay isn't pleasant.

Link to comment
Samer, this is not the vG script, it's used in it, sure, but this Elevator script was made by Mabako, and given to me by Mabako.

-Therefor, it is not a "vG script".

Nonetheless, I fixed it myself.

You are wrong. It is a Concrete Gaming (Valhalla Gaming, Root Gaming) code snippet. We do not give any support for stolen gamemodes or even its code snippets. If you want help, ask mabako.

So stop lying to us. I have verified that this is a completely same code snippet from the gamemode.

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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