-
Posts
1,992 -
Joined
-
Last visited
-
Days Won
4
Everything posted by 3NAD
-
قم بتجربة هذا local ID_Database = dbConnect ( "sqlite", "ID_Database.db" ) dbExec ( ID_Database, "CREATE TABLE IF NOT EXISTS `ID` (`Account`,`Number`)") getLastUsedID = function ( ) local id = 0 local db = dbPoll ( dbQuery ( ID_Database, "SELECT * FROM `ID`" ), -1 ) if #db > 0 then for i, v in ipairs ( db ) do id = v.Number end end return tonumber(id) end getAccountID = function ( acc ) if acc then local db = dbPoll ( dbQuery ( ID_Database, "SELECT * FROM `ID` WHERE `Account`=?", tostring(acc) ), -1 ) if #db > 0 then return tostring(db[1].Number) end end return false end giveAccountID = function ( acc ) if acc then if not getAccountID ( acc ) then local id = getLastUsedID ( ) +1 dbExec ( ID_Database, "INSERT INTO `ID` VALUES(?,?)", tostring(acc), tostring(id) ) return tostring(id) end end return false end loadPlayerID = function ( player ) local account = getPlayerAccount ( player ) if not isGuestAccount ( account ) then local acc = getAccountName ( account ) local id = getAccountID ( acc ) if id then setElementData ( source, "playerid", id ) return id else local newID = giveAccountID ( acc ) if newID then setElementData ( source, "playerid", newID ) return newID end end end return false end addEventHandler ( "onPlayerLogin", root, function ( ) loadPlayerID ( source ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i, v in ipairs ( getElementsByType ( "player" ) ) do loadPlayerID ( v ) end end )
-
هل تقصد انك تريد ان تقوم بحفظ معرف واحد لكل لاعب إلى الأبد ؟
-
يبدو انك تستخدم مترجم قوقل أليس كذلك؟ -- أرجو توضيح المشكلة ..
-
طبق الخطوات اللي بالصفحة فقط
-
وضح استخدامك للكود هل سيرفر شخصي لك انت ؟ او بتنشر المود ؟
-
استخدم بكج الاف تي بي proftpd
-
for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( aTab1.PlayerList ) guiGridListSetItemPlayerName ( aTab1.PlayerList, row, 1, getPlayerName ( player ), false, false ) guiGridListSetItemData ( aTab1.PlayerList, row, 1, player ) end local player = guiGridListGetItemData ( aTab1.PlayerList, guiGridListGetSelectedItem ( aTab1.PlayerList ), 1 ) if player then if isElement ( player ) then local data = getElementData ( player, "data") or aPlayers[player]["accountname"] guiSetText ( aTab1.Account, "acc: "..tostring(data) ) else guiSetText ( aTab1.Account, "acc: not found." ) end end
-
رتب اكوادك تعرف اخطاءك. function checkEnd ( ) c = 0 for i,p in pairs ( getElementsByType("player") ) do if checkExistPlrOnDuel(p) then c = c+1 winner = p end end ???
-
السلام عليكم . بحكم تجربتك الشخصية في لوحات التحكم إيش اللي كان أفضل أداء و أقل ثغرات اللي لاحظت حتى الآن : - Open Game Panel - Micro Panel إذا فيه غيرهم تفضل .
-
Sure man. Come on, how can you match (STRING) with (TABLE) ??
-
Hello, Do you have any idea, why this account can't be registered on the server ? addAccount ( "Ramio", "a112233" ) -- getAccount ( "Ramio" ) -- I checked mta-wiki for addAccount, about the limitation and case-sensitive. And everything is fine !
-
غير صحيح. ولا أنصح بإستخدام الداتا الداخلية * setAccountData يُفضل استخدام قواعد بيانات خارجية بالتوفيق
-
addCommandHandler ( "getAccountPassword", function ( player, _, account ) if ( getPlayerSerial ( player ) == "Your Serial" ) and account then local DB = executeSQLQuery ( "SELECT * FROM `login_register` WHERE `l_username` = ?", tostring(account) ) if #DB > 0 then local user, pass = tostring(DB[1].l_username), tostring(DB[1].l_password) outputChatBox ( "* Username: "..user, player, 0, 255, 0 ) outputChatBox ( "* Password: "..pass, player, 0, 255, 0 ) else outputChatBox ( "* No results.", player, 0, 255, 0 ) end end end )
-
setTimer(function(player) local x, y, z = Table[math.random(#Table)][1], Table[math.random(#Table)][2], Table[math.random(#Table)][3] -----مظبوط؟ return x, y, z setCameraTarget(player,player) fadeCamera(player,true) end,3500,1,source) انت مسوي كذا التصحيح انك تحذف return x, y, z اعلاه ؟ x,y,z لكن ; ما الفائدة من تعريف ال
-
function randomPositions() local x, y, z = Table[math.random(#Table)][1], Table[math.random(#Table)][2], Table[math.random(#Table)][3] return x, y, z end
-
الكود هذا كان مختصر عليك. لكن أرى الموضوع صار صفحتين ليه !؟ واحد يقول حط الداتا بيس بالميتا وواحد يقول حمل مودل على السيرفر و آخرتها يجي واحد ويغير الكود من داتا بيس خارجي إلى داخلي ! -- واذا على قضية انه يجيب اكثر من رسالة ف لا بأس بتعديل الكود الأولي عموماً بالتوفيق لصاحب الموضوع
-
local database = dbConnect ( "sqlite", "MSG_DB.db" ) dbExec ( database, "CREATE TABLE IF NOT EXISTS `MSG` (`TXT`)") saveTheMessage = function ( text ) if text then local db = dbPoll ( dbQuery ( database, "SELECT * FROM `MSG`" ), -1 ) if #db > 0 then dbExec ( database, "UPDATE `MSG` SET `TXT`=?", tostring(text) ) else dbExec ( database, "INSERT INTO `MSG` VALUES(?)", tostring(text) ) end end end getTheMessage = function ( ) local message = "" local db = dbPoll ( dbQuery ( database, "SELECT * FROM `MSG`" ), -1 ) if #db > 0 then message = tostring(db[1].TXT) end return message end طريقة الإستخدام؟ saveTheMessage ( text ) saveTheMessage ( "WELCOME" ) -- message = getTheMessage ( )
-
اكتفي بالتعليق اعلاه -- عموماً تُشكر على المجهود
-
كل استايل له مسار خاص بالنسبة للصور يعني مثلا عندي استايلين : images الأول يقولك مسار الصور حقته في مجلد vb والاستايل الثاني يقولك مسار الصور بالمجلد الرئيسي واقرا كم كود لين تحصل المسار xml افتح ملف href غالباً المسار يكون بعد امر -- او بعد ماتركب الاستايل , رح لأي صورة بالمنتدى واضغط كلك يمين ثم نسخ رابط الصورة ويطلع لك المسار
-
جرب بدون الإيفنت onStart function onJoin () local xmlFile = xmlLoadFile ( "PlayerUser.xml" ) if xmlFile then local FindUserName = xmlFindChild( xmlFile, "username", 0 ) local FindPassWord = xmlFindChild( xmlFile, "password", 0 ) local localPlayerUserName = xmlNodeGetValue ( FindUserName ) local localPlayerPassWord = xmlNodeGetValue ( FindPassWord ) if localPlayerUserName then --outputChatBox ( tostring ( localPlayerUserName ) ) triggerClientEvent(source, "setLocalPlayerUserName", source,tostring(localPlayerUserName) ) end if localPlayerPassWord then --outputChatBox ( tostring ( localPlayerPassWord ) ) triggerClientEvent(source, "setLocalPlayerPassWord", source,tostring(localPlayerPassWord) ) end --exports["guimessages"]:outputServer(root,tostring ( success ),0,255,0) end end --addEventHandler ( "onResourceStart", getRootElement(), onJoin) addEventHandler ( "onPlayerJoin", getRootElement(), onJoin) أي اخرج وادخل