Eshtiz
Members-
Posts
74 -
Joined
-
Last visited
Everything posted by Eshtiz
-
Yeh, vg scripts. But I discovered how to fix it, quite simple actually but I still need help with two things, Here's the GOOC Script together with the admin tag script. function globalOOC(thePlayer, commandName, ...) local logged = tonumber(getElementData(thePlayer, "loggedin")) if (logged==1) then if not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14) else local oocEnabled = exports.global:getOOCState() message = table.concat({...}, " ") local muted = getElementData(thePlayer, "muted") if (oocEnabled==0) and not (exports.global:isPlayerAdmin(thePlayer)) then outputChatBox("OOC Chat is currently disabled.", thePlayer, 255, 0, 0) elseif (muted==1) then outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0) else local players = exports.pool:getPoolElementsByType("player") local playerName = getPlayerName(thePlayer) local playerID = getElementData(thePlayer, "playerid") exports.logs:logMessage("[OOC: Global Chat] " .. playerName .. ": " .. message, 1) for k, arrayPlayer in ipairs(players) do local logged = tonumber(getElementData(arrayPlayer, "loggedin")) local targetOOCEnabled = getElementData(arrayPlayer, "globalooc") local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) if (logged==1) and (targetOOCEnabled==1) then outputChatBox("(( [GOOC] [" .. tostring(adminTitle) .. "] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204) end end end end end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC) As you see, it was only two lines I had to add, but regular players(admin level 0) has tag name [Player], I need to remove it since it get's weird and not very special. And I need to add a r g b color for the tag, someone knows how I add this to it?
-
No errors, nothing, including no tags , don't have much more to go on so can't tell ya much.
-
It's quite a big one, http://pastebin.com/R1VrebN8 Search for GOOC and you'll find the function etc.. (Posted the whole thing to not leave anything out)
-
Well, I'm trying to get an 'admin tag' behind 'player(admins) names' in GOOC chat, /o and so on. Since it's a Roleplay script, there's three 'main chats', IC = /say, LOOC B = /b, GOOC = /o , when I use your script in a separete resource from the chat-system, it duplicates the /say chat which ain't exactly what I'm trying to achieve, I want/need it to squeeze in an admin tag behind the player names in GOOC.
-
Still the same I'm afraid, tested both, same problem, it creates a new chat in 'T' ( /say ), GOOC is in /o, any way to transfer it?
-
Nop, afraid not Here's my acl, I might of placed the 'HeadAdmin' account wrong( I don't think so, just making sure everything's correct). "Everyone"> "Default"/> "user.*"/> "resource.*"/> "resource.ucp"/> "Moderator"> "Moderator"/> "resource.mapcycler"/> "resource.mapmanager"/> "resource.resourcemanager"/> "resource.votemanager"/> "SuperModerator"> "Moderator"/> "SuperModerator"/> "HeadAdmin"/> "user.testtest"> "Developer"/> "Admin"> "Moderator"/> "SuperModerator"/> "Admin"/>
-
Still the same problem, here's the GOOC Script: function globalOOC(thePlayer, commandName, ...) local logged = tonumber(getElementData(thePlayer, "loggedin")) if (logged==1) then if not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14) else local oocEnabled = exports.global:getOOCState() message = table.concat({...}, " ") local muted = getElementData(thePlayer, "muted") if (oocEnabled==0) and not (exports.global:isPlayerAdmin(thePlayer)) then outputChatBox("OOC Chat is currently disabled.", thePlayer, 255, 0, 0) elseif (muted==1) then outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0) else local players = exports.pool:getPoolElementsByType("player") local playerName = getPlayerName(thePlayer) local playerID = getElementData(thePlayer, "playerid") exports.logs:logMessage("[OOC: Global Chat] " .. playerName .. ": " .. message, 1) for k, arrayPlayer in ipairs(players) do local logged = tonumber(getElementData(arrayPlayer, "loggedin")) local targetOOCEnabled = getElementData(arrayPlayer, "globalooc") if (logged==1) and (targetOOCEnabled==1) then outputChatBox("(( [GOOC] (" .. playerID .. ") " .. playerName .. ": " .. message .. " ))", arrayPlayer, 255, 255, 204) end end end end end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC)
-
So.. what are you saying?
-
I've been trying myself on this script lately, I've been trying to add admin in /o (GOOC), I keep failing, a new chat pops up in T /say instead, I'm getting really confused about it. here's the script I'm trying on: function globalOOC(thePlayer, commandName, ...) local root = getRootElement() local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) if (msgtype == 0) then if isObjectInACLGroup("user." .. account, aclGetGroup("HeadAdmin")) then cancelEvent(true) outputChatBox("#855863[HEAD] #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [HEAD] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent(true) outputChatBox("#855863[sMOD] #FFFFFF" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [sMOD] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then cancelEvent(true) outputChatBox("#855863[MOD] #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: [MOD] " .. name .. ": " .. text) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent(true) outputChatBox(name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) outputServerLog("CHAT: " .. name .. ": " .. text) end elseif (msgtype == 2) then end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC) function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end https://community.multitheftauto.com/index.php?p= ... ls&id=2963 (Global Out Of Character) Would be awesome if I could get some help with this.
-
Small problem, ERROR: maruis-shop/shop.lua:26: attempt to index field 'position' (a nil value) for some reasons, the boats somewhat fly & kill people, it's getting quite annoying and I have no idea what to do, (also about all my old topics, they're solved). here's the script: local function populateSpots( force ) -- get all players positions to check if there's no nearby player local players = { } if not force then for key, value in ipairs( getElementsByType( "player" ) ) do if getElementDimension( value ) == 0 and getElementInterior( value ) == 0 then players[ #players + 1 ] = { getElementPosition( value ) } end end end -- get vehicle positions in case any is near local vehicles = { } for key, value in ipairs( getElementsByType( "vehicle" ) ) do if getElementDimension( value ) == 0 and getElementInterior( value ) == 0 then vehicles[ #vehicles + 1 ] = { getElementPosition( value ) } end end for key, value in ipairs( shops ) do if #value.spots > 0 and #value.prices then -- check that no player is near the first spot (as it should be close with the rest) local canPopulate = true for k, v in ipairs( players ) do if getDistanceBetweenPoints3D( value.position[1], value.position[2], value.position[3], v[1], v[2], v[3] ) < 200 then canPopulate = false break end end if canPopulate then -- create new ones instead for k, v in ipairs( value.spots ) do local data = value.prices[ math.random( 1, #value.prices ) ] if v.vehicle and isElement( v.vehicle ) then -- set it back to its respawn position respawnVehicle( v.vehicle ) -- already have a car, change it with another one if setElementModel( v.vehicle, data.model ) then -- if we actually changed the model, assign a random color if we can local color1, color2 = getRandomVehicleColor( v.vehicle ) if color1 then setVehicleColor( v.vehicle, color1, color2 or color1, color1, color2 or color1 ) end end else -- make sure no vehicle is nearby local canPopulate = true for _, x in ipairs( vehicles ) do if getDistanceBetweenPoints3D( x[1], x[2], x[3], v[1], v[2], v[3] ) < 1 then canPopulate = false break end end if canPopulate then -- create a new vehicle as we didn't have one before local vehicle = createVehicle( data.model, unpack( v ) ) setTimer(setVehicleFrozen, 1500, 1, vehicle, true) -- assign it to our shop setElementParent( vehicle, value.root ) -- it's locked or people would drive it off setVehicleLocked( vehicle, true ) setElementData(vehicle, "shop.car", true, true) -- we don't want people to trash 'em up really setVehicleDamageProof( vehicle, true ) -- save it v.vehicle = vehicle end end end else -- shouldn't update the old ones, respawn ours for k, v in ipairs( value.spots ) do if v.vehicle and isElement( v.vehicle ) then -- already have a car, respawn it respawnVehicle( v.vehicle ) end end end end end end addEventHandler( "onResourceStart", resourceRoot, function( ) for key, value in ipairs( shops ) do -- create an element for every shop value.root = createElement( "vehicle-shop", "vehicle-shop " .. key ) -- easier lookup shops[ value.root ] = value end -- initalize our vehicles populateSpots( true ) -- populate with other cars every minute setTimer( populateSpots, 60000, 0 ) end ) addEventHandler( "onVehicleStartEnter", resourceRoot, function( player ) if not isPedDead( player ) then -- show popup for buying triggerClientEvent( player, getResourceName( resource ) .. ":buyPopup", source ) end -- don't let him enter the vehicle cancelEvent( ) end ) addEventHandler( "onVehicleEnter", resourceRoot, function( ) -- vehicles can't be entered cancelEvent( ) end ) addEvent( getResourceName( resource ) .. ":buyVehicle", true ) addEventHandler( getResourceName( resource ) .. ":buyVehicle", getRootElement(), function ( vehicle ) if (isElement(vehicle)) then if (client) then if exports.global:hasMoney( client, getVehiclePrice( vehicle ) ) then local cost = getVehiclePrice( vehicle ) local create_vehicle = exports['vehicle-system']:create( client, vehicle, cost ) else outputChatBox("You do not have enough money to buy this vehicle.", client, 255, 0, 0) end end end end )
-
Got a tiny error in my mdc-system, this is actually found in like 10 other scripts, I guess the line is outdated but can't really do it myself, I've started learning scripting recently. Here's the error message: WARNING: mdc-system\c_mdc.lua:1738:bad argument @ 'guiGetVisible' [Expected gui-element at argument 1, got nil] Here's the script line (1738, whole function): function toggleInputEnabled2(key, keyState) -- check to see if its m and down if(key == "m") then if(guiGetVisible(guiMdcWindow)) then if (guiGetInputEnabled( )) then guiSetInputEnabled(false) outputChatBox("Chatbox active", 0, 255, 0, true) outputChatBox("Press M on the keyboard to toggle back and use the MDT") else guiSetInputEnabled(true) outputChatBox("MDT window active", 0, 255, 0, true) end end end end bindKey ( "m", "down", toggleInputEnabled2)
-
Me & my friends have some problems regarding interiors, they don't exist. I mean, we can create 'em and all. the "map-system" resource works, but they're not there. It's the vG script, legalized btw. but anything inside the map-system doesn't appear IG, I don't even get error messages, I can start it without problems so it's hard to provide you all with information, scripts etc. Basically, LSPD, city hall, bank etc.. Does anyone have a similar problem or the solution to this?
-
I got it. Full log when you start the server, login & register (tries, doesn't actually work). (Skype/teamviewer via PM would be appreciated) Server is on 1.1 [2012-02-01 15:11:13] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-02-01 15:11:13] ERROR: call: failed to call 'mysql:query' [string "?"] [2012-02-01 15:11:13] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-02-01 15:11:13] ERROR: call: failed to call 'mysql:query' [string "?"] [2012-02-01 15:12:13] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-02-01 15:12:13] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"] [2012-02-01 15:12:49] ERROR: Client triggered serverside event itemResourceStarted, but event is not added serverside [2012-02-01 15:12:50] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:50] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:50] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-02-01 15:12:50] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:50] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:50] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-02-01 15:12:50] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-02-01 15:12:53] ERROR: Client triggered serverside event attemptRegister, but event is not added serverside [2012-02-01 15:12:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-02-01 15:12:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-02-01 15:12:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-02-01 15:12:53] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value)
-
[2012-01-31 16:35:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:35:25] ERROR: call: failed to call 'mysql:query' [string "?"] [2012-01-31 16:35:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:35:25] ERROR: call: failed to call 'mysql:query' [string "?"] [2012-01-31 16:36:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:36:25] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"] [2012-01-31 16:37:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:37:25] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"] [2012-01-31 16:38:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:38:25] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"] [2012-01-31 16:38:47] ERROR: Client triggered serverside event itemResourceStarted, but event is not added serverside [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:53] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:53] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:53] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-01-31 16:38:53] ERROR: Client triggered serverside event attemptRegister, but event is not added serverside [2012-01-31 16:38:54] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:54] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:54] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:54] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:54] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:54] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:54] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-01-31 16:38:55] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:55] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:55] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:55] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:55] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:55] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:55] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-01-31 16:38:56] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:56] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:56] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:56] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:56] ERROR: mysql/connection.lua:206: attempt to call global 'mysql_escape_string' (a nil value) [2012-01-31 16:38:56] ERROR: call: failed to call 'mysql:escape_string' [string "?"] [2012-01-31 16:38:56] ERROR: account-system/s_account_system_sapphire.lua:678: attempt to concatenate local 'safepassword' (a boolean value) [2012-01-31 16:39:25] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value) [2012-01-31 16:39:25] ERROR: call: failed to call 'mysql:query_fetch_assoc' [string "?"] script: -- connection settings local hostname = "lxx" local username = "xxx" local password = "xxx" local database = "xxx" local port = tonumber( get( "port" ) ) or 3306 -- global things. local MySQLConnection = nil local resultPool = { } local sqllog = false local countqueries = 0 -- connectToDatabase - Internal function, to spawn a DB connection function connectToDatabase(res) MySQLConnection = mysql_connect(hostname, username, password, database, port) if (not MySQLConnection) then if (res == getThisResource()) then cancelEvent(true, "Cannot connect to the database.") end return nil end return nil end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connectToDatabase, false) -- destroyDatabaseConnection - Internal function, kill the connection if theres one. function destroyDatabaseConnection() if (not MySQLConnection) then return nil end mysql_close(MySQLConnection) return nil end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), destroyDatabaseConnection, false) -- do something usefull here function logSQLError(str) local message = str or 'N/A' outputDebugString("MYSQL ERROR "..mysql_errno(MySQLConnection) .. ": " .. mysql_error(MySQLConnection)) exports['logs']:logMessage("MYSQL ERROR ! [QUERY] " .. message .. " [ERROR] " .. mysql_errno(MySQLConnection) .. ": " .. mysql_error(MySQLConnection), 24) end function getFreeResultPoolID() local size = #resultPool if (size == 0) then return 1 end for index, query in ipairs(resultPool) do if (query == nil) then return index end end return (size + 1) end ------------ EXPORTED FUNCTIONS --------------- function ping() if (mysql_ping(MySQLConnection) == false) then -- FUU, NO MOAR CONNECTION destroyDatabaseConnection() connectToDatabase(nil) if (mysql_ping(MySQLConnection) == false) then logSQLError() return false end return true end return true end function escape_string(str) if (ping()) then return mysql_escape_string(MySQLConnection, str) end return false end function query(str) if sqllog then exports['logs']:logMessage(str, 24) end countqueries = countqueries + 1 if (ping()) then local result = mysql_query(MySQLConnection, str) if (not result) then logSQLError(str) return false end local resultid = getFreeResultPoolID() resultPool[resultid] = result return resultid end return false end function unbuffered_query(str) if sqllog then exports['logs']:logMessage(str, 24) end countqueries = countqueries + 1 if (ping()) then local result = mysql_unbuffered_query(MySQLConnection, str) if (not result) then logSQLError(str) return false end local resultid = getFreeResultPoolID() resultPool[resultid] = result return resultid end return false end function query_free(str) local queryresult = query(str) if not (queryresult == false) then free_result(queryresult) return true end return false end function rows_assoc(resultid) if (not resultPool[resultid]) then return false end return mysql_rows_assoc(resultPool[resultid]) end function fetch_assoc(resultid) if (not resultPool[resultid]) then return false end return mysql_fetch_assoc(resultPool[resultid]) end function free_result(resultid) if (not resultPool[resultid]) then return false end mysql_free_result(resultPool[resultid]) table.remove(resultPool, resultid) return nil end -- incase a nub wants to use it, FINE function result(resultid, row_offset, field_offset) if (not resultPool[resultid]) then return false end return mysql_result(resultPool[resultid], row_offset, field_offset) end function num_rows(resultid) if (not resultPool[resultid]) then return false end return mysql_num_rows(resultPool[resultid]) end function insert_id() return mysql_insert_id(MySQLConnection) or false end function query_fetch_assoc(str) local queryresult = query(str) if not (queryresult == false) then local result = fetch_assoc(queryresult) free_result(queryresult) return result end return false end function query_rows_assoc(str) local queryresult = query(str) if not (queryresult == false) then local result = rows_assoc(queryresult) free_result(queryresult) return result end return false end function query_insert_free(str) local queryresult = query(str) if not (queryresult == false) then local result = insert_id() free_result(queryresult) return result end return false end function escape_string(str) return mysql_escape_string(MySQLConnection, str) end function debugMode() if (sqllog) then sqllog = false else sqllog = true end return sqllog end function returnQueryStats() return countqueries -- maybe later more end
-
So, example: Someone comes with a script which just has a empty function and it was supposed to be a drug system, and he'll say: "The scripts exists, they just have to be modified.". If you want to pay someone to do it, he/she will put the price. Right, well nevermind the registration, I fixed it right this second. I'm browsing around in the scripts to check what's needed atm. Mostly interiors/peds that's a problem right now.
-
Well, for starters, I like the registration, I just can't get it to work. & the looks/design on the inventory/scoreboard, I can provide you with images as I'm a graphic designer. You just have to make them fit
-
The scripts exists, they just have to be modified.
-
Ok, hello. I'm working on my own server, based on the GM: mta-paradise. As I need help with a lot of things, registration panel, scoreboard, new inventory system (the default one is just terrible, hate it). I'm willing to pay a few dollars over paypal. Don't expect it to be much as there's not much to do, giving me a price would help a lot. PM me, if you're not interested in money, we could figure something else out.
-
I encountered a new problem, for some reason, I can't enable registrations. They're enabled in settings.xml, all there's left is registration.lau Here's the script:[registration.lau] local allowRegistration = get('allow_registration') and true or false local registrationErrorMessage = get( 'registration_error_message' ) if registrationErrorMessage then -- fix for newlines in message registrationErrorMessage = registrationErrorMessage:gsub( "\\n", "\n" ) end addEventHandler( "onResourceStart", resourceRoot, function( ) setElementData( source, "allowRegistration", allowRegistration ) setElementData( source, "registrationErrorMessage", registrationErrorMessage ) end ) local function trim( str ) return str:gsub("^%s*(.-)%s*$", "%1") end addEvent( getResourceName( resource ) .. ":register", true ) addEventHandler( getResourceName( resource ) .. ":register", root, function( username, password ) if source == client then if allowRegistration then if username and password then username = trim( username ) password = trim( password ) -- client length checks are the same if #username >= 3 and #password >= 8 then -- see if that username is free at all local info = exports.sql:query_assoc_single( "SELECT COUNT(userID) AS usercount FROM wcf1_user WHERE username = '%s'", username ) if not info then triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 1 ) elseif info.usercount == 0 then -- generate a salt (SHA1) local salt = '' local chars = { 'a', 'b', 'c', 'd', 'e', 'f', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } for i = 1, 40 do salt = salt .. chars[ math.random( 1, #chars ) ] end -- create the user if exports.sql:query_free( "INSERT INTO wcf1_user (username,salt,password) VALUES ('%s', '%s', SHA1(CONCAT('%s', SHA1(CONCAT('%s', '" .. sha1( password ) .. "')))))", username, salt, salt, salt ) then triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 0 ) -- will automatically login when this is sent else triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 4 ) end else triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 3 ) end else -- shouldn't happen triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 1 ) end else -- can't do much without a username and password triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 1 ) end else triggerClientEvent( source, getResourceName( resource ) .. ":registrationResult", source, 2, registrationErrorMessage ) end end end ) Here's the line in settings.xml: It's tagged, no worries. -- MySQL Configuration --> "@sql.username" value="xxxx" /> "@sql.password" value="xxxx" /> "@sql.database" value="xxxx" /> "@sql.hostname" value="xxxx" /> "@sql.port" value="3306" /> "@sql.socket" value="/var/run/mysql/mysql.sock" /> -- Registration --> "@players.allow_registration" value="1" /> -- Change to 0 to disable registration and show an error message --> "@players.registration_error_message" value="Edit this to show the user a message when registration is disabled" /> EDIT: I don't know if it's important or not regarding this, but it's a problem, I manually created an account in the internal.db, when I started the server, it deleted the account, I either missed out on something or am stupid, anyways. I need urgent help, PM me for skype if you can't find the words for it here.
-
Mhm, Ok, but I still have the exact same problem as before, I replaced those two with my old ones without success.
-
Same thing there ;/ =========================================================== [2012-01-29 07:58:18] Resources: 30 loaded, 0 failed [2012-01-29 07:58:18] Querying game-monitor.com master server... success! [2012-01-29 07:58:18] Querying backup master server... success! [2012-01-29 07:58:18] MODULE: Unable to find modules/mta_mysql.dll! [2012-01-29 07:58:18] MODULE: Unable to find modules/sha.dll! [2012-01-29 07:58:18] Starting resources..... [2012-01-29 07:58:18] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:18] Start up of resource sql cancelled by script [2012-01-29 07:58:18] ERROR: Unable to start resource sql; Start up of resource cancelled by script [2012-01-29 07:58:18] Start up of resource irc cancelled by script [2012-01-29 07:58:18] ERROR: Unable to start resource irc; Start up of resource cancelled by script [2012-01-29 07:58:18] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:18] Start up of resource sql cancelled by script [2012-01-29 07:58:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:18] Start up of resource players cancelled by script [2012-01-29 07:58:18] ERROR: Unable to start resource players; Start up of resource cancelled by script [2012-01-29 07:58:18] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:18] Start up of resource sql cancelled by script [2012-01-29 07:58:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:18] Start up of resource vehicles cancelled by script [2012-01-29 07:58:18] ERROR: Unable to start resource vehicles; Start up of resource cancelled by script [2012-01-29 07:58:18] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:18] Start up of resource sql cancelled by script [2012-01-29 07:58:18] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:18] Start up of resource interiors cancelled by script [2012-01-29 07:58:18] ERROR: Unable to start resource interiors; Start up of resource cancelled by script [2012-01-29 07:58:18] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:18] Start up of resource sql cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource items cancelled by script [2012-01-29 07:58:19] ERROR: Unable to start resource items; Start up of resource cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource vehicles cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource items cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource items cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource players cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:19] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:19] Start up of resource shops cancelled by script [2012-01-29 07:58:19] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:19] Start up of resource sql cancelled by script [2012-01-29 07:58:20] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:20] Start up of resource sql cancelled by script [2012-01-29 07:58:20] ERROR: exports: Call to non-running server resource (sql) [string "?"] [2012-01-29 07:58:20] Start up of resource players cancelled by script [2012-01-29 07:58:20] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 07:58:20] Start up of resource sql cancelled by script [2012-01-29 07:58:20] ERROR: exports: Call to non-running server resource (sql) [string "?"]
-
Looks like everything's fine, here it is: <!-- Specifies the module(s) which are loaded with the server. To load several modules, add more <module> parameter(s). Optional parameter. --> <module src="mta_mysql.dll"/> <module src="sha.dll"/> <!-- <module src="ml_sockets.dll"/> <module src="mta_mysql.so"/> <module src="sha.so"/> <module src="ml_sockets.so"/> --> EDIT: everything I use can be find here: https://github.com/mabako/mta-paradise *expects flammers* It's an open source, relax.
-
Yup, they're there, but the server keeps crashing, telling me that they're missing which they ain't.
-
Ok, so I started to finger on my resources, I'm actually a complete noob, you'll find out by yourself in like five seconds, anyway, I started to play around, fix some things & edit, currently on a RP script, and no, I'm not copying vG if you must know (I've seen so much trolls/flammers around while I've been lurking about, just saying). On-topic, my chat/crash logs, "Module: Unable to find modules, blablabla". They're actually inside resources => modules, no idea if I placed them wrong or not, anyhow, I need assistance. edit: I just realized, I barely gave you anything to go on, truly sorry, I would if I could! [2012-01-29 04:37:12] Resources: 30 loaded, 0 failed [2012-01-29 04:37:12] Querying game-monitor.com master server... success! [2012-01-29 04:37:12] Querying backup master server... success! [2012-01-29 04:37:13] MODULE: Unable to find modules/mta_mysql.dll! [2012-01-29 04:37:13] MODULE: Unable to find modules/sha.dll! [2012-01-29 04:37:13] Starting resources..... [2012-01-29 04:37:13] Server shutdown as requested by resource sql (MySQL module missing.) [2012-01-29 04:37:13] Start up of resource sql cancelled by script [2012-01-29 04:37:13] ERROR: Unable to start resource sql; Start up of resource cancelled by script [2012-01-29 04:37:13] Start up of resource irc cancelled by script [2012-01-29 04:37:13] ERROR: Unable to start resource irc; Start up of resource cancelled by script ^It crashes every resource there is.
