Jump to content

SycroX

Members
  • Posts

    2,141
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by SycroX

  1. ذا مو صاحب الموضوع ._. صاحب الموضوع قال هيك .. لاكن واحد اخر معرف حب يطلب مع الموضوع ذا فانت سويت له اظن
  2. الحين لما السياره تقع في الماء ما يحصل لها دامج لهيك كودك بيكون غير مفيد لصاحب الموضوع لهيك مثل ما قال تريفور يستخدم كودي و بعدين يسوي تايمر و يتحقق لواللاعب في الماء يجيب الداتا بتاعت اخر واحد خبطه و يستخدم killPed
  3. ما تحس ان المفروض تحط الموضوع في قسم الـبرمجه ؟ @!#NssoR_) + ما له سلبيه بس يفضل تستخدم cache="false" في الميتا
  4. then check your database and check if the table exist or not
  5. ما فيها مشكله ما دام يبي يستفيد و ذي من نصائح العامه للمنتدي .إذا يوجد موضوع مشابه لذلك الذي تريد أن تُنشئه، شارك في هذا الموضوع، بدلاً من إنشاء موضوع جديد يمكنك رفع موضوع قديم إذا قد تم إنشاؤه بواسطتك، أو إذا الموضوع يخص مشكلة أنت أيضاً تواجهها. يرجى القيام بهذا باعتدال، وفقط بعد مرور بعض الوقت منذ أن شاركت.
  6. local animationManagerWindow = nil local replaceAnimationLabel, playAnimationLabel = nil, nil local restoreDefaultsButton, stopAnimationButton = nil, nil local replaceAnimationGridList, playAnimationGridList = nil, nil local isShowingAnimationBlocksInPlayGridList = true local currentBlockNameSelected = nil local isLocalPlayerAnimating = false local function PopulatePlayAnimationGridListWithBlocks () isShowingAnimationBlocksInPlayGridList = true currentBlockNameSelected = nil guiGridListClear ( playAnimationGridList ) -- Add IFP blocks to the play animation gridlist for customAnimationBlockIndex, customAnimationBlock in ipairs ( globalLoadedIfps ) do local rowIndex = guiGridListAddRow ( playAnimationGridList, " + "..customAnimationBlock.friendlyName ) guiGridListSetItemData ( playAnimationGridList, rowIndex, 1, customAnimationBlockIndex ) end end local function PopulatePlayAnimationGridListWithCustomBlockAnimations ( ifpIndex ) isShowingAnimationBlocksInPlayGridList = false currentBlockNameSelected = globalLoadedIfps [ifpIndex].blockName guiGridListClear ( playAnimationGridList ) guiGridListAddRow ( playAnimationGridList, ".." ) -- Add IFP blocks to the play animation gridlist for _, customAnimationName in ipairs ( globalLoadedIfps [ifpIndex].animations ) do local rowIndex = guiGridListAddRow ( playAnimationGridList, " "..customAnimationName ) guiGridListSetItemData ( playAnimationGridList, rowIndex, 1, customAnimationName ) end end addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent ( "onCustomAnimationSyncRequest", resourceRoot, localPlayer ) outputChatBox ("Press 'X' to toggle Animation Manager", 255, 255, 255) animationManagerWindow = guiCreateWindow(118, 116, 558, 371, "Animation Manager", false) guiWindowSetSizable(animationManagerWindow, false) guiSetVisible(animationManagerWindow, false) replaceAnimationLabel = guiCreateLabel(12, 26, 245, 19, "Replace Animations With", false, animationManagerWindow) guiSetFont(replaceAnimationLabel, "default-bold-small") guiLabelSetHorizontalAlign(replaceAnimationLabel, "center", false) replaceAnimationGridList = guiCreateGridList(12, 49, 245, 255, false, animationManagerWindow) guiGridListAddColumn(replaceAnimationGridList, "Animation Blocks", 0.9) restoreDefaultsButton = guiCreateButton(49, 314, 174, 41, "Restore Defaults", false, animationManagerWindow) playAnimationLabel = guiCreateLabel(294, 26, 245, 19, "Play Animation", false, animationManagerWindow) guiSetFont(playAnimationLabel, "default-bold-small") guiLabelSetHorizontalAlign(playAnimationLabel, "center", false) stopAnimationButton = guiCreateButton(329, 314, 174, 41, "Stop Animation", false, animationManagerWindow) playAnimationGridList = guiCreateGridList(294, 49, 245, 255, false, animationManagerWindow) guiGridListAddColumn(playAnimationGridList, "Animation Blocks", 0.9) -- load IFP files and add them to the play animation gridlist for customAnimationBlockIndex, customAnimationBlock in ipairs ( globalLoadedIfps ) do local ifp = engineLoadIFP ( customAnimationBlock.path, customAnimationBlock.blockName ) if not ifp then outputChatBox ("Failed to load '"..customAnimationBlock.path.."'") end end -- now add replaceable ifps to the other grid list for _, ifpIndex in ipairs ( globalReplaceableIfpsIndices ) do local customAnimationBlock = globalLoadedIfps [ ifpIndex ] local rowIndex = guiGridListAddRow ( replaceAnimationGridList, customAnimationBlock.friendlyName ) guiGridListSetItemData ( replaceAnimationGridList, rowIndex, 1, ifpIndex ) end PopulatePlayAnimationGridListWithBlocks () end ) local function ReplacePedBlockAnimations ( player, ifpIndex ) local customIfpBlockName = globalLoadedIfps [ ifpIndex ].blockName for _, animationName in pairs ( globalPedAnimationBlock.animations ) do -- make sure that we don't replace a partial animation if not globalPedAnimationBlock.partialAnimations [ animationName ] then engineReplaceAnimation ( player, "ped", animationName, customIfpBlockName, animationName ) end end end local function HandleReplacedAnimationGridListDoubleClick () local replacedAnimGridSelectedRow, replacedAnimGridSelectedCol = guiGridListGetSelectedItem ( replaceAnimationGridList ); if replacedAnimGridSelectedRow and replacedAnimGridSelectedRow ~= -1 then local ifpFriendlyName = guiGridListGetItemText( replaceAnimationGridList, replacedAnimGridSelectedRow, replacedAnimGridSelectedCol ) local ifpIndex = guiGridListGetItemData(replaceAnimationGridList, replacedAnimGridSelectedRow, replacedAnimGridSelectedCol ) ReplacePedBlockAnimations ( localPlayer, ifpIndex ) triggerServerEvent ( "onCustomAnimationReplace", resourceRoot, localPlayer, ifpIndex ) outputChatBox ("Replaced 'ped' block animations with '"..ifpFriendlyName.."'", 255, 255, 255) end end local function HandlePlayAnimationGridListDoubleClick () local playAnimGridSelectedRow, playAnimGridSelectedCol = guiGridListGetSelectedItem ( playAnimationGridList ); if playAnimGridSelectedRow and playAnimGridSelectedRow ~= -1 then local itemText = guiGridListGetItemText( playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol ) if isShowingAnimationBlocksInPlayGridList then local ifpIndex = guiGridListGetItemData(playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol ) PopulatePlayAnimationGridListWithCustomBlockAnimations ( ifpIndex ) else if itemText == ".." then PopulatePlayAnimationGridListWithBlocks ( ) else local animationName = guiGridListGetItemData(playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol ) setPedAnimation ( localPlayer, currentBlockNameSelected, animationName ) triggerServerEvent ( "onCustomAnimationSet", resourceRoot, localPlayer, currentBlockNameSelected, animationName ) isLocalPlayerAnimating = true end end end end addEventHandler( "onClientGUIDoubleClick", resourceRoot, function ( button, state, absoluteX, absoluteY ) if button == "left" and state == "up" then if source == replaceAnimationGridList then HandleReplacedAnimationGridListDoubleClick ( ) elseif source == playAnimationGridList then HandlePlayAnimationGridListDoubleClick ( ) end end end ) addEventHandler( "onClientGUIClick", resourceRoot, function ( button, state ) if button == "left" and state == "up" then if source == restoreDefaultsButton then -- restore all replaced animations of "ped" block engineRestoreAnimation ( localPlayer, "ped" ) triggerServerEvent ( "onCustomAnimationRestore", resourceRoot, localPlayer, "ped" ) outputChatBox ("Restored ped block animations", 255, 255, 255) elseif source == stopAnimationButton then setPedAnimation ( localPlayer, false ) triggerServerEvent ( "onCustomAnimationSet", resourceRoot, localPlayer, false, false ) end end end ) bindKey ( "X", "down", function ( key, keyState ) if ( keyState == "down" ) then local isAnimationMangerWindowVisible = guiGetVisible ( animationManagerWindow ) guiSetVisible ( animationManagerWindow, not isAnimationMangerWindowVisible ) showCursor ( not isAnimationMangerWindowVisible ) end end ) addEvent ("onClientCustomAnimationSyncRequest", true ) addEventHandler ("onClientCustomAnimationSyncRequest", root, function ( playerAnimations ) for player, anims in pairs ( playerAnimations ) do if isElement ( player ) then if anims.current then setPedAnimation ( player, anims.current[1], anims.current[2] ) end if anims.replacedPedBlock then ReplacePedBlockAnimations ( player, anims.replacedPedBlock ) end end end end ) addEvent ("onClientCustomAnimationSet", true ) addEventHandler ("onClientCustomAnimationSet", root, function ( blockName, animationName ) if source == localPlayer then return end if blockName == false then setPedAnimation ( source, false ) return end setPedAnimation ( source, blockName, animationName ) end ) addEvent ("onClientCustomAnimationReplace", true ) addEventHandler ("onClientCustomAnimationReplace", root, function ( ifpIndex ) if source == localPlayer then return end ReplacePedBlockAnimations ( source, ifpIndex ) end ) addEvent ("onClientCustomAnimationRestore", true ) addEventHandler ("onClientCustomAnimationRestore", root, function ( blockName ) if source == localPlayer then return end engineRestoreAnimation ( source, blockName ) end ) setTimer ( function () if isLocalPlayerAnimating then if not getPedAnimation (localPlayer) then isLocalPlayerAnimating = false triggerServerEvent ( "onCustomAnimationStop", resourceRoot, localPlayer ) end end end, 100, 0 )
  7. تسلم + فكره كويسه ان شاء الله اضفها في الأصدار الجديد لما افضي
  8. =?and same , huh ? local connection = exports["mysql"]:getConnection() function loginHandler(thePlayer, username, password) local account = getAccount(username) local hashedPassword = getAccountData(account, "hashedPassword") local query = dbQuery(connection, "SELECT * FROM accounts WHERE username = ? AND password = ?", tostring(username), tostring(hashedPassword)) local result, num_affected_row = dbPoll(query, -1) if account ~= nil and passwordVerify(password, hashedPassword, function(isVaild) if not isVaild then exports["notification-system"]:sendClientMessage("ERROR :Password is invaild!", thePlayer, 255, 0, 0) end end) and num_affected_row > 1 then if (logIn(thePlayer, account, hashedPassword) == true ) then triggerClientEvent(thePlayer, "hideLoginWindow", root) setElementData(thePlayer, "account:id", result.id) dbExec(connection, "UPDATE accounts SET lastlogin=? WHERE username=?", "NOW()", tostring(username)) exports["notification-system"]:sendClientMessage("INFO: You successfuly logged in!", thePlayer ,0, 255, 0) else exports["notification-system"]:sendClientMessage("ERROR: That account is already logged in!", thePlayer, 255, 0, 0) end else exports["notification-system"]:sendClientMessage("ERROR: Username or passwrod is invailed!", thePlayer, 255, 0, 0) end end function reigsterHandler(thePlayer, username, email, password) local account = getAccount(username) local query = dbQuery(connection, "SELECT * FROM accounts WHERE username =?",tostring(username)) local result, num_affected_row = dbPoll(query, -1) if account ~= nil and num_affected_row > 1 then exports["notification-system"]:sendClientMessage("ERROR: That username is already exist!", thePlayer, 255, 0, 0) else passwordHash(password, "bcrypt", {}, function(hashedPassword) local account = addAccount(username,hashedPassword) setAccountData(account, "hashedPassword", hashedPassword) local ip = getPlayerIP(thePlayer) local serial = getPlayerSerial(thePlayer) local r = getRealTime() local regDate = ("%04d-%02d-%02d %02d:%02d:%02d"):format(r.year+1900, r.month+1, r.monthday, r.hour, r.minute, r.second) dbExec(connection, "INSERT INTO accounts (username, password ,email, ip, serial, registerdate) VALUES(?, ?, ?, ?, ?, ?)", tostring(username), tostring(hashedPassword), tostring(email), tostring(ip), tostring(serial), tostring(regDate)) triggerClientEvent(thePlayer, "hideRegisterWindow", root) exports["notification-system"]:sendClientMessage("INFO: You successfuly register!", thePlayer, 0, 255, 0) end) end end addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, reigsterHandler)
  9. LUA is an easy language to learn it wont take a lot of time to learn it + there's a multitheftauto.wiki it will be very helpful for you and i suggest to look there first before asking here
  10. re-register your account + change this ( in login handler code ) ( line 6 ) local query = dbQuery(connection, "SELECT * FROM accounts WHERE username and password =?", tostring(username), tostring(hashedPassword)) to this local query = dbQuery(connection, "SELECT * FROM accounts WHERE username = ? AND password = ?", tostring(username), tostring(hashedPassword))
  11. local query = dbQuery(connection, "SELECT *FROM accounts WHERE username =?",tostring(username)) change this to local query = dbQuery(connection, "SELECT * FROM accounts WHERE username = ?", tostring(username))
  12. addEventHandler("onClientPlayerDamage", root, function() if source == localPlayer and getElementDimension(source) == 1 then cancelEvent() end end )
  13. جهازي مخيس و ما يحصل لي المشكله حقتهم ..
  14. addEventHandler("onClientVehicleDamage", root, function(attacker) if attacker and getElementType(attacker) == "vehicle" then if getPedOccupiedVehicle(localPlayer) == source then local sourcePlayer, attackerPlayer = getVehicleController(source), getVehicleController(attacker) if sourcePlayer and attackerPlayer then setElementData(sourcePlayer, "LastAttacker", attackerPlayer) end end end end )
  15. .لا تقوم بإهانة أو انتحال شخصية أعضاء المنتدى @!#NssoR_)
  16. @djharbi2 sorry bro but i can't help you i think there's not way to do it unless you make 2 labels not one
  17. getAccountData ترجع قيمه في سترنج addEventHandler("onPlayerLogin", root, function(_,acc) if not getAccountData(acc, "isFirstTime") then givePlayerMoney(source, 100) giveWeapon(source, 31, 500) setAccountData(acc, "isFirstTime", true) end end ) Returns[edit] Returns a string containing the stored data or false if no data was stored under that key.
  18. Search يب ترا انا فاكر كويس طلبه ذا سويته لي 5 بالمنتدي و من مده قريبه لو يدور شوي او يبحث من كلمه بيلاقي طلبه
  19. ليه تصعبوها عليه ؟ كل الي يحتاجو اكونت داتا لانه ما قال اول ما اللاعب يدخل السيرفر قال اول ما يسجل في حسابه اول مره عشان كدا يفضل يستخدم setAccountDate
×
×
  • Create New...