Search the Community
Showing results for tags 'codes'.
-
executeSQLQuery("CREATE TABLE IF NOT EXISTS `player_stats` (`username` TEXT, `Thirst` INT, `Hunger` INT)") addEventHandler("onPlayerQuit", function (Player) local atsh = getElementData(source, "Thirst") local hungry = getElementData(source, "Hunger") local username = getAccountName(getPlayerAccount(thePlayer)) local result = executeSQLQuery("SELECT * FROM player_stats WHERE `username` = ?", username) if (#result > 1) then executeSQLQuery("UPDATE `player_stats` SET `Hunger` = ?, `Thirst` = ? WHERE `username` = ?", hungry, atsh, username) else executeSQLQuery("INSERT INTO health (username, Thirst, Hunger) VALUES (?, ?, ?)", username, atsh, hungry) end end) addEventHandler("onPlayerLogin", root, function(_, account) local accountName = getAccountName(account) local result = executeSQLQuery("SELECT * FROM player_stats WHERE username = ?", accountName) if (#result > 1) then setElementData(source, "Thirst", result[1].Thirst) setElementData(source, "Hunger", result[1].Hunger) end end) it isn't working please help
-
والصلاة والسلام علي سيدنا محمد خاتم المرسلين وعلي اَلي وصحبه وسلم أجمعين @HassoN كيفكم إخواني أتمني لكم الخير من كل قلبي وما بمل بشكر أخواني وأعزائي الكرام وخاصة أخي والباقي في القلب - : اليوم طلبان وليس أمر ألا وهم :طلب اللوحة الأدمانية وهو عايز كود يخلي الأسل ما يتفتح إلا لرتب معينة بس :طلب مود الساعات وهو مود الساعات أبي أسوي له داتا باس بمعني السيرفر طفي او سويت ريستارت للمود ساعات الاعبين ما تروح بس كذا ذا الي أحتاجه وأسف لو أكون مأثر علي بعض المطورين هذي الأيام ظروفي ما تسمح لي أني أكون مستوعب والله وحده يعلم وشكرا لكل أحبائي ومسانديني ويكون الإنسان في عون ربه
-
function aAction ( type, action, admin, player, data, more ) if ( aLogMessages[type] ) then function aStripString ( string ) string = tostring ( string ) string = string.gsub ( string, "$admin", getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$data2", more or "" ) if ( player ) then string = string.gsub ( string, "$player", getPlayerName ( player ) ) string = string:gsub("#%x%x%x%x%x%x","") end return tostring ( string.gsub ( string, "$data", data or "" ) ) end local node = aLogMessages[type][action] if ( node ) then local r, g, b = node["r"], node["g"], node["b"] if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b ) end if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b ) end if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end end end end i added this lines to 'admin_server.lua', but doesn't working the script i got a lot of errors from 'admin_sync.lua':194: attempt to index global 'aPlayers' (a nil value) and rom 'admin serverjoiner.lua':48: attempt to call global 'checkClient' (a nil value) but when i add the original 'aActions' function, the errors will disappear. why? how to fix this?