Jump to content

MOGA672002

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by MOGA672002

  1. answer again i want you to help me with GTI resources
  2. Help me to fix this problem https://imgur.com/a/pH24aYj
  3. How to make "GTIHousing" mod work ?? i had written house-add alot and tried all acl groups (admin5 , arch5,......etc) what should i do ?
  4. السلام عليكم الشباب اتمني تكونو بخير تم افتتاح شركة Global Host Company نوزع سرفرات مجاينة مقابل بستات شهرية قلية جدا وكذلك في سرفرات مدفوعة طبعا لسا بنبدا عشان كدا اتنمي تدعمونا في سرفر MTA/SAMP ومحتاجين مبرمجين وادمنية معانا صفحة الفيس بوكلوحة التحكم المنتدي الخاص بينا صور https://imgur.com/8w1lL9S https://imgur.com/U4646eE https://imgur.com/pVjE9RS
  5. Order your free MTA server hosting now 1-you can take afree server only make afew posts monthly 2- We provide protection for you 3-Support 24 hours what's new ?? well, 1-You can take a server ready for money 2-We can provide an assistant for you to monitor your server and help you download resources and database (for beginners) 3-We will provide you with a special programmer to spread all your thoughts Contact us here :- FaceBook Our Forum ScreenShoots :- https://imgur.com/8w1lL9S https://imgur.com/U4646eE https://imgur.com/pVjE9RS
  6. Anyone help me please Fix this problem couldnt start the irc resource . the sockets module isnt loaded https://imgur.com/FQ48N3n
  7. [2018-06-01 05:46:00] INFO: could not start the irc resource, the sockets module isn't loaded! [2018-06-01 05:46:00] INFO: try to start the resource again to retry [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIgovt/irc.slua:33: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIircg/Server.lua:159: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIircg/Server.lua:159: call: failed to call 'GTIirc:ircRaw' [string "?"] [DUP x5] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [DUP x5] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [DUP x5] [2018-06-01 05:46:00] ERROR: GTIbugReporter/igbugreport_s.lua:151: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] Start up of resource GTIirc cancelled by script [2018-06-01 05:46:00] Stopping GTIirc [2018-06-01 05:46:00] startResource: Failed to start resource 'GTIirc' [2018-06-01 05:46:03] ERROR: AresMisc/irc.lua:24: exports: Call to non-running server resource (GTIirc) [string "?"] GTIirc problemAll resource are working vert well but GTIircplease fix this problem
  8. GTIirc problem All resource are working vert well but GTIirc please fix this problem [2018-06-01 05:46:00] INFO: could not start the irc resource, the sockets module isn't loaded! [2018-06-01 05:46:00] INFO: try to start the resource again to retry [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIgovt/irc.slua:33: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIircg/Server.lua:159: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [2018-06-01 05:46:00] ERROR: GTIircg/Server.lua:159: call: failed to call 'GTIirc:ircRaw' [string "?"] [DUP x5] [2018-06-01 05:46:00] WARNING: GTIirc/scripts/channels.lua:37: Bad argument @ 'getElementParent' [Expected element at argument 1, got boolean] [DUP x5] [2018-06-01 05:46:00] ERROR: GTIirc/scripts/servers.lua:16: attempt to index field '?' (a nil value) [DUP x5] [2018-06-01 05:46:00] ERROR: GTIbugReporter/igbugreport_s.lua:151: call: failed to call 'GTIirc:ircRaw' [string "?"] [2018-06-01 05:46:00] Start up of resource GTIirc cancelled by script [2018-06-01 05:46:00] Stopping GTIirc [2018-06-01 05:46:00] startResource: Failed to start resource 'GTIirc' [2018-06-01 05:46:03] ERROR: AresMisc/irc.lua:24: exports: Call to non-running server resource (GTIirc) [string "?"]
  9. Very good idea but the only problem with it is that it will need to aot of players from the first
  10. MOGA672002

    SQL

    I have db.sql file and i want to know How to upload it to PHPMyAdmin and i want to know how to cotact it with "mysql" to make my scripts work again https://imgur.com/a/jME03L7 And this is my file https://imgur.com/a/elgRyNu
  11. MOGA672002

    code ?

    thanks its working
  12. MOGA672002

    code ?

    like this spawnPlayer(source, x, y, z, rot, skin, 0, 0, team) ? please edit it and post it as i am not aprogrammer so i cant fix it
  13. MOGA672002

    code ?

    tell me what should i do ? or edit the code then post it please
  14. MOGA672002

    code ?

    function select() local account = getPlayerAccount(source) local x, y, z, rot = 2700.04272, -2327.13013, 13.33250, 269 local skin = 29 local team = getTeamFromName("Unemployed") setAccountData(account, "WWRPG.playerX", x) setAccountData(account, "WWRPG.playerY", y) setAccountData(account, "WWRPG.playerZ", z) setAccountData(account, "WWRPG.playerRot", rot) setAccountData(account, "WWRPG.playerSkin", skin) setAccountData(account, "WWRPG.playerInt", 0) setAccountData(account, "WWRPG.playerDim", 0) setAccountData(account, "WWRPG.playerTeam", "Unemployed") fadeCamera(source, true) spawnPlayer(source, x, y, z, rot, skin, 0, team) local dimension = getFreeDimension() cleanNotUsedBoats() if isElement(boats[source]) then destroyElement(boats[source]) end boats[source] = createVehicle(493, 2731.7016601563, -2322.798828125, 2, 0, 0, 359) setElementFrozen(boats[source], true) setElementDimension(boats[source], dimension) setElementDimension(source, dimension) triggerClientEvent(source,"startIntro",source,dimension) end https://imgur.com/a/Qvpf9WQ what the problem with this line spawnPlayer(source, x, y, z, rot, skin, 0, team)
  15. MOGA672002

    code ?

    function select() local account = getPlayerAccount(source) local x, y, z, rot = 2700.04272, -2327.13013, 13.33250, 269 local skin = 29 local team = getTeamFromName("Unemployed") setAccountData(account, "WWRPG.playerX", x) setAccountData(account, "WWRPG.playerY", y) setAccountData(account, "WWRPG.playerZ", z) setAccountData(account, "WWRPG.playerRot", rot) setAccountData(account, "WWRPG.playerSkin", skin) setAccountData(account, "WWRPG.playerInt", 0) setAccountData(account, "WWRPG.playerDim", 0) setAccountData(account, "WWRPG.playerTeam", "Unemployed") fadeCamera(source, true) spawnPlayer(source, x, y, z, rot, skin, 0, team) local dimension = getFreeDimension() cleanNotUsedBoats() if isElement(boats[source]) then destroyElement(boats[source]) end boats[source] = createVehicle(493, 2731.7016601563, -2322.798828125, 2, 0, 0, 359) setElementFrozen(boats[source], true) setElementDimension(boats[source], dimension) setElementDimension(source, dimension) triggerClientEvent(source,"startIntro",source,dimension) end https://imgur.com/a/Qvpf9WQ what the problem with this line spawnPlayer(source, x, y, z, rot, skin, 0, team)
  16. function func_ircRaw (server,data) if servers[server][15] then writeLog("-> "..data) return sockWrite(servers[server][1],data.."\r\n") end table.insert(servers[server][16],data) return true end registerFunction("ircRaw","func_ircRaw","irc-server","string") this line if servers[server][15] then
  17. function func_ircRaw (server,data) if servers[server][15] then writeLog("-> "..data) return sockWrite(servers[server][1],data.."\r\n") end table.insert(servers[server][16],data) return true end registerFunction("ircRaw","func_ircRaw","irc-server","string") this line if servers[server][15] then
  18. -- Positions for the matrix view for the login screen local matrixViewPositions = { {2060.693359375, 1323.3287353516, 65.554336547852, 2154.0563964844, 1301.9788818359, 36.787712097168}, {-488.73297119141, 2129.7478027344, 131.07089233398, -577.43792724609, 2095.4423828125, 100.17473602295}, {355.38235473633, -1999.6640625, 34.214122772217, 401.36798095703, -2077.3337402344, -8.8294067382813}, {2373.4975585938, 69.472595214844, 68.322166442871, 2420.0559082031, -10.329551696777, 30.060695648193}, {2055.7841796875, 1197.9633789063, 25.738883972168, 2141.7668457031, 1147.1596679688, 20.643169403076}, {2321.8068847656, -1100.53125, 76.947044372559, 2365.5268554688, -1017.3639526367, 42.716026306152}, {-807.52880859375, 2699.8017578125, 75.263061523438, -853.92779541016, 2777.5541992188, 32.816757202148}, {196.63110351563, 2660.5759277344, 53.300601959229, 262.5549621582, 2594.3989257813, 17.598323822021}, {-458.94390869141, -164.11698913574, 123.5959777832, -548.6953125, -195.21823120117, 92.332641601563}, {-1070.3149414063, -1610.5084228516, 94.326530456543, -1135.0595703125, -1682.0073242188, 67.944076538086}, {-632.33306884766, -1473.3518066406, 44.557136535645, -545.33532714844, -1492.6140136719, -0.833984375}, {270.52749633789, -1205.0640869141, 110.60611724854, 321.99029541016, -1128.5759277344, 71.861503601074}, {1156.4423828125, -1441.9432373047, 38.343357086182, 1086.1207275391, -1504.4560546875, 4.4757308959961}, {-1267.3508300781, 1106.96484375, 102.32939910889, -1311.2535400391, 1019.9342041016, 80.008575439453}, {-2662.2238769531, 2242.8115234375, 89.52938079834, -2584.8740234375, 2297.583984375, 57.639293670654}, } local antisaveTimers = {} local loggingIn = {} -- Create teams and set time addEventHandler ( "onResourceStart", resourceRoot, function () setGameType( "CSG V"..getCSGServerVersion() ) setOcclusionsEnabled( false ) createTeam("Staff",255,255,255) local query = exports.DENmysql:query("SELECT * FROM teams ORDER BY list ASC") for k,v in ipairs(query) do createTeam(v["name"],v["cR"],v["cG"],v["cB"]) end local realtime = getRealTime() setTime( realtime.hour, realtime.minute ) setMinuteDuration( 60000 ) setServerPassword("") --set the password to nothing if any password is set. end ) addEventHandler("onResourceStop",resourceRoot, function() setServerPassword(math.random(1239871)) --set a password so that no one can connect back on while the kicking process continues. for k,v in ipairs(getElementsByType("player")) do kickPlayer(v,"Core","Core Stopping / Restarting...") end end) -- Check if there is not already a player ingame with the same serial addEventHandler( "onPlayerConnect", root, function ( playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber ) for k, thePlayer in pairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial( thePlayer ) == playerSerial ) then cancelEvent( true, "There is already a player online with this serial!" ); return end end end ) -- When the player joins spawn him ingame addEventHandler( "onPlayerJoin", root, function () if ( spawnPlayer( source, 0, 0, 0 ) ) then setCameraTarget ( source ) fadeCamera( source, true, 1.0, 0, 0, 0 ) startMatrix(source) showPlayerHudComponent ( source, "radar", false ) showPlayerHudComponent ( source, "area_name", false ) setElementDimension ( source, 1234 ) showChat( source, false ) end end ) local refreshTimers = {} function startMatrix(player) if (isElement(player)) then if (exports.server:isPlayerLoggedIn(player) == false) then fadeCamera(player, false,1.0,0,0,0) setTimer(fadeCamera,1000,1,player, true) local x, y, z, lx, ly, lz = unpack( matrixViewPositions[ math.random ( #matrixViewPositions ) ] ) setTimer(setCameraMatrix,1000,1,player, x, y, z, lx, ly, lz ) refreshTimers[player] = setTimer(startMatrix,5000,1, player) else if (isTimer(refreshTimers[player])) then killTimer(refreshTimers[player]) end return false --no more updating. end else return false end end -- Kick the player when he has a too low resolution --[[addEvent( "doKickPlayer", true ) addEventHandler( "doKickPlayer", root, function () kickPlayer( source, "Connection refused due a too low screen resolution" ) end )]]-- -- When the player spawns check if we show the login screen or draw a ban window addEvent( "doSpawnPlayer", true ) addEventHandler( "doSpawnPlayer", root, function () local time = getRealTime() local banData = exports.DENmysql:query( "SELECT banstamp,bannedby,reason,serial FROM bans WHERE serial=? LIMIT 1", getPlayerSerial( source ) ) if banData and banData[1] then if ( time.timestamp > tonumber( banData[1].banstamp ) ) and not ( tonumber( banData[1].banstamp ) == 0 ) then exports.DENmysql:exec( "DELETE FROM bans WHERE serial = ?", getPlayerSerial( source ) ) triggerClientEvent( source, "setLoginWindowVisable", source ) else setElementData( source, "Occupation", "Banned" ) triggerClientEvent( source, "drawClientBanScreen", source, banData[1].serial, banData[1].reason, banData[1].banstamp, banData.bannedby ) toggleAllControls(source,false) end else triggerClientEvent( source, "setLoginWindowVisable", source ) end end ) -- Timestap convert function timestampConvert ( timeStamp ) local time = getRealTime(timeStamp) local year = time.year + 1900 local month = time.month + 1 local day = time.monthday local hour = time.hour local minute = time.minute return "" .. hour ..":" .. minute .." - " .. month .."/" .. day .."/" .. year .."" end -- When the player creates a new account addEvent( "doAccountRegister", true ) addEventHandler( "doAccountRegister", root, function ( username, password1, password2, email, genderMale, genderFemale ) if ( exports.DENmysql:querySingle( "SELECT username FROM accounts WHERE username=? LIMIT 1", string.lower( username ) ) ) then triggerClientEvent( source, "setWarningLabelText", source, "This username is already taken!", "registerWindow", 225, 0, 0 ) elseif ( #exports.DENmysql:query( "SELECT * FROM accounts WHERE serial = ?", getPlayerSerial( source ) ) >= 2 ) then triggerClientEvent( source, "setWarningLabelText", source, "You can only register 2 accounts for each serial!", "registerWindow", 225, 0, 0 ) else if ( genderFemale ) then theGender = 93 else theGender = 0 end if ( exports.DENmysql:exec( "INSERT INTO accounts SET username=?, password=?, email=?, serial=?, skin=?", string.lower( username ), sha512( password1 ), email, getPlayerSerial( source ), theGender ) ) then local userData = exports.DENmysql:querySingle( "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", string.lower( username ), sha512( password1 ) ) exports.DENmysql:exec("INSERT INTO weapons SET userid=?", tonumber( userData.id ) ) exports.DENmysql:exec("INSERT INTO playerstats SET userid=?", tonumber( userData.id ) ) triggerClientEvent( source, "setPopupWindowVisable", source ) end end end ) -- When the player password changed function onPasswordRequestCallback () -- callBack functie after password is changed nothing important though end -- Password reset function addEvent( "doPlayerPasswordReset", true ) addEventHandler( "doPlayerPasswordReset", root, function ( email, username, newPassword ) local userData = exports.DENmysql:querySingle( "SELECT email FROM accounts WHERE username = ? LIMIT 1", string.lower(username) ) if ( userData ) then if ( userData.email == "" ) or ( userData.email == " " ) then triggerClientEvent( source, "setWarningLabelText", source, "No email found with this account!", "passwordWindow", 225, 0, 0 ) elseif not ( string.match(tostring(userData.email), "^.+@.+%.%a%a%a*%.*%a*%a*%a*") )then triggerClientEvent( source, "setWarningLabelText", source, "You didn't enter a vaild email adress!", "passwordWindow", 225, 0, 0 ) elseif not ( string.lower(userData.email) == string.lower(email) ) then triggerClientEvent( source, "setWarningLabelText", source, "The email with this account doesn't match!", "passwordWindow", 225, 0, 0 ) else if ( exports.DENmysql:exec( "UPDATE accounts SET password=? WHERE username=? AND email=?", sha512(newPassword), string.lower(username), email ) ) then callRemote( "http://csgmta.net/mail/password.php", onPasswordRequestCallback, username, email, newPassword ) exports.DENdxmsg:createNewDxMessage(source, "Your password is changed and sent to your email!", 0, 225, 0) triggerClientEvent( source, "setWarningLabelText", source, "A new password has been sent!", "passwordWindow", 225, 0, 0 ) triggerClientEvent ( source, "setLoginWindowVisable", source ) end end else triggerClientEvent( source, "setWarningLabelText", source, "No account found with this name!", "passwordWindow", 225, 0, 0 ) end end ) -- When the player send the login forum addEvent( "doPlayerLogin", true ) addEventHandler( "doPlayerLogin", root, function ( username, password, usernameTick, passwordTick ) if not (exports.DENmysql:getConnection()) then triggerClientEvent(source,"setWarningLabelText",source,"Database is down! Please contact a developer!","loginWindow",255,0,0) return false end local accountID = false local idQuery = exports.DENmysql:query("SELECT id FROM accounts WHERE username=? LIMIT 1",username:lower()) if idQuery and #idQuery == 1 then accountID = idQuery[1].id end if not accountID then triggerClientEvent( source, "setWarningLabelText", source, "Wrong username and/or password!", "loginWindow", 225, 0, 0 ) triggerClientEvent(source,"toggleLoginButton",source,true) return end if ( #exports.DENmysql:query( "SELECT id FROM accounts WHERE id=? AND password=? LIMIT 1", accountID, md5( password ) ) == 1 ) then -- If the password is a MD5 password from the old system then force the player to change it triggerClientEvent( source, "setWarningLabelText", source, "Unable to login, please change password first!", "loginWindow", 225, 0, 0 ) triggerClientEvent( source, "setNewPasswordWindowVisable", source ) setElementData( source, "temp:UsernameData", string.lower( username ) ) setElementData( source, "temp:PasswordData", md5( password ) ) elseif ( #exports.DENmysql:query( "SELECT id FROM accounts WHERE id=? AND password=? LIMIT 1", accountID, sha512( password ) ) == 1 ) then -- If the password is correct and a SHA512 password then log the player in --exports.irc:outputIRC(tostring(loggingIn[username])) if (loggingIn[username] == nil) then loggingIn[username] = true --set this true to prevent it from logging in again --exports.irc:outputIRC(username.." login stored.") elseif (loggingIn[username] == true) then --exports.irc:outputIRC(username.." was refused login since he spammed the :~ out of login.") return false else --exports.irc:outputIRC("Something :Oed up, blame Priyen!") --exports.irc:outputIRC(tostring(loggingIn[username])) end local banData = exports.DENmysql:query( "SELECT banstamp FROM bans WHERE username=? LIMIT 1", username:lower() ) if ( banData and #banData == 1 ) then if ( banData[1].banstamp == 0 ) then triggerClientEvent( source, "setWarningLabelText", source, "This account is Permanently Banned from the server!", "loginWindow", 225, 0, 0 ) elseif ( getRealTime().timestamp < banData[1].banstamp ) then triggerClientEvent( source, "setWarningLabelText", source, "This account is banned from the server til: "..timestampConvert( banData[1].banstamp ), "loginWindow", 225, 0, 0 ) elseif ( banData[1].banstamp > 0 ) and ( getRealTime().timestamp > banData[1].banstamp ) and ( exports.DENmysql:exec( "DELETE FROM bans WHERE account=?", username:lower() ) ) then triggerClientEvent( source, "setWarningLabelText", source, "Your account is now unbanned! Try again.", "loginWindow", 0, 225, 0 ) end else removeElementData( source, "temp:UsernameData" ) removeElementData( source, "temp:PasswordData" ) triggerClientEvent ( source, "updateAccountXMLData", source, username, password, usernameTick, passwordTick ) local accountData = exports.DENmysql:query( "SELECT * FROM accounts WHERE id=? LIMIT 1", accountID ) local groupData = exports.DENmysql:query( "SELECT groupname,grouprank,groupid FROM groups_members WHERE memberid=? LIMIT 1", accountID ) for k,v in ipairs(getElementsByType("player")) do if (getElementData(v,"accountUserID") == accountData[1].id) then kickPlayer(v,"Accounts",getPlayerName(source).." has logged into your account.") end end exports.DENmysql:exec( "INSERT INTO logins SET serial=?, ip=?, nickname=?, accountname=?", getPlayerSerial( source ), getPlayerIP ( source ), getPlayerName( source ), username ) exports.DENmysql:exec( "UPDATE accounts SET serial=?,IP=? WHERE id=?", getPlayerSerial( source ), getPlayerIP( source ), accountData[1].id ) setPlayerTeam ( source, getTeamFromName(accountData[1].team) ) setElementData( source, "accountUserID", accountID ) setElementData( source, "tempdata.accountUserID", accountID ) setElementData( source, "Occupation", accountData[1].occupation ) setElementData( source, "playerAccount", accountData[1].username ) setElementData( source, "playerEmail", accountData[1].email ) setElementData( source, "playerIP", getPlayerIP ( source ) ) setElementData( source, "joinTick", getTickCount() ) setElementData(source,"playerScore",accountData[1].score) setElementData( source, "carLicence", true ) setElementData( source, "planeLicence", true ) setElementData( source, "bikeLicence", true ) setElementData( source, "chopperLicence", true ) setElementData( source, "boatLicence", true ) if ( groupData and #groupData == 1 ) then setElementData( source, "Group", groupData[1].groupname ) setElementData( source, "GroupRank", groupData[1].grouprank ) setElementData( source, "GroupID", tonumber(groupData[1].groupid) ) end if ( tonumber(accountData[1].premium) < 1 ) then setElementData( source, "isPlayerPremium", false ) setElementData( source, "Premium", "No" ) setElementData(source,"premiumType",accountData[1].premiumType) else setElementData( source, "isPlayerPremium", true ) setElementData( source, "Premium", "Yes" ) setElementData(source,"premiumType",accountData[1].premiumType) end setElementData( source, "playTime", accountData[1].playtime ) triggerClientEvent( source, "setAllWindowsHided", source ) triggerClientEvent( source, "clientPlayerLogin", source, accountData[1].id, username ) fadeCamera( source, false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, source, true, 1.0, 0, 0, 0 ) setTimer( createPlayerElementIntoGame, 1000, 1, source, accountData[1] ) antisaveTimers[source] = setTimer(allowSaving,10000,1,source) triggerEvent( "onPlayerLogin", source ) loggingIn[username] = nil end else -- If the password is wrong triggerClientEvent( source, "setWarningLabelText", source, "Wrong username and/or password!", "loginWindow", 225, 0, 0 ) triggerClientEvent(source,"toggleLoginButton",source,true) end end ) function allowSaving(player) if (isElement(player)) then antisaveTimers[source] = nil end end -- Change password addEvent( "onPlayerUpdatePasswords", true ) addEventHandler( "onPlayerUpdatePasswords", root, function ( password ) if ( getElementData( source, "temp:UsernameData" ) ) then if ( exports.DENmysql:exec( "UPDATE accounts SET password=? WHERE username=?", sha512( password ), getElementData( source, "temp:UsernameData" ) ) ) then triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "Your password is changed!", 0, 225, 0 ) else triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "We couldn't change your password try again!", 225, 0, 0 ) end else triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "We couldn't change your password try again!", 225, 0, 0 ) end end ) -- Spawn the player into the world function createPlayerElementIntoGame ( thePlayer, dataTable ) if ( exports.server:isPlayerLoggedIn( thePlayer ) ) then local playerID = exports.server:getPlayerAccountID( thePlayer ) exports.DENdxmsg:createNewDxMessage( thePlayer, "Welcome back to CSG " .. getPlayerName( thePlayer ) .. "!", 238, 154, 0 ) setCameraTarget( thePlayer, thePlayer ) showChat( thePlayer, true ) showPlayerHudComponent ( thePlayer, "radar", true ) showPlayerHudComponent ( thePlayer, "area_name", true ) if ( dataTable.team == "Criminals" ) or ( dataTable.team == "Unemployed" ) or ( dataTable.team == "Unoccupied" ) then spawnPlayer( thePlayer, dataTable.x, dataTable.y, dataTable.z +1, dataTable.rotation, dataTable.skin, dataTable.interior, dataTable.dimension, dataTable.team ) else spawnPlayer( thePlayer, dataTable.x, dataTable.y, dataTable.z +1, dataTable.rotation, dataTable.jobskin, dataTable.interior, dataTable.dimension, dataTable.team ) end local CJCLOTTable = fromJSON( tostring( dataTable.cjskin ) ) if CJCLOTTable then for theType, index in pairs( CJCLOTTable ) do local texture, model = getClothesByTypeIndex ( theType, index ) addPedClothes ( thePlayer, texture, model, theType ) end end local weapons = fromJSON( dataTable.weapons ) if ( weapons ) then for weapon, ammo in pairs( weapons ) do if not ( tonumber(weapon) == 36 ) and not ( tonumber(weapon) == 37 ) and not ( tonumber(weapon) == 38 ) and not ( tonumber(weapon) == 18 ) then giveWeapon( thePlayer, tonumber(weapon), tonumber(ammo) ) end end end local playerStatus = exports.DENmysql:querySingle( "SELECT * FROM playerstats WHERE userid=? LIMIT 1", playerID ) if ( playerStatus ) then local wepSkills = fromJSON( playerStatus.weaponskills ) if ( wepSkills ) then for skillint, valueint in pairs( wepSkills ) do if ( tonumber(valueint) > 950 ) then setPedStat ( thePlayer, tonumber(skillint), 995 ) else setPedStat ( thePlayer, tonumber(skillint), tonumber(valueint) ) end end end end if ( dataTable.health == 0 ) then killPed( thePlayer ) else setElementHealth( thePlayer, tonumber( dataTable.health ) ) end exports.DENmysql:exec( "UPDATE groups_members SET lastonline=? WHERE memberid=?", getRealTime().timestamp, playerID ) setPedArmor( thePlayer, tonumber( dataTable.armor ) ) setPlayerMoney( thePlayer, tonumber( dataTable.money ) ) setPedFightingStyle ( thePlayer, tonumber( dataTable.fightstyle ) ) setElementData ( thePlayer, "isPlayerLoggedin", true ) setElementData ( thePlayer, "wantedPoints", tonumber( dataTable.wanted ) ) local jailData = exports.DENmysql:querySingle("SELECT * FROM jail WHERE userid=? LIMIT 1",dataTable.id) if (jailData) then triggerClientEvent( thePlayer, "onSetPlayerJailed", thePlayer, jailData.jailtime ) end triggerEvent ( "onServerPlayerLogin", thePlayer, playerID, dataTable.username ) exports.DENvehicles:reloadFreeVehicleMarkers( thePlayer ) end end function getCSGServerVersion() query = exports.DENmysql:querySingle("SELECT value FROM settings WHERE settingName=? LIMIT 1","serverVersion") if (query) then return query["value"] else return "2.1.4" end end addEvent("updatePlayerFPS",true) addEventHandler("updatePlayerFPS",root, function(fps) if (isElement(source)) and fps then setElementData(source,"FPS",fps) end end) --[[function updatePlayerTeamToElementData() for k,v in ipairs(getElementsByType("player")) do team = getPlayerTeam(v) if (team ~= nil) then setElementData(v,"playerTeam",team) outputDebugString(getTeamFromName(team)) end end end setTimer(updatePlayerTeamToElementData,2000,0)]]-- function isAllowedToSave(player) if (isTimer(antisaveTimers[player])) then return false else return true end end
  19. Whenever I press the "Create Account" button it tells me there is a problem in line 150 and I cant understand the problem This is the code from line 147 to line 161 The problem is in line 150 so please fix it https://imgur.com/a/Wyp4Mzv function ( username, password1, password2, email, genderMale, genderFemale ) if ( exports.DENmysql:querySingle( "SELECT username FROM accounts WHERE username=? LIMIT 1", string.lower( username ) ) ) then triggerClientEvent( source, "setWarningLabelText", source, "This username is already taken!", "registerWindow", 225, 0, 0 ) elseif ( #exports.DENmysql:query( "SELECT * FROM accounts WHERE serial = ?", getPlayerSerial( source ) ) >= 2 ) then triggerClientEvent( source, "setWarningLabelText", source, "You can only register 2 accounts for each serial!", "registerWindow", 225, 0, 0 ) else if ( genderFemale ) then theGender = 93 else theGender = 0 end if ( exports.DENmysql:exec( "INSERT INTO accounts SET username=?, password=?, email=?, serial=?, skin=?", string.lower( username ), sha512( password1 ), email, getPlayerSerial( source ), theGender ) ) then local userData = exports.DENmysql:querySingle( "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", string.lower( username ), sha512( password1 ) ) exports.DENmysql:exec("INSERT INTO weapons SET userid=?", tonumber( userData.id ) ) exports.DENmysql:exec("INSERT INTO playerstats SET userid=?", tonumber( userData.id ) ) triggerClientEvent( source, "setPopupWindowVisable", source ) end end end
  20. كل ما اضغط create account يقلي في مشكلة في سطر 150 وانا مش قادر افهم ايه هي المشكلة ديالمشكلة في سطر 150 https://imgur.com/a/Wyp4Mzv -- Positions for the matrix view for the login screen local matrixViewPositions = { {2060.693359375, 1323.3287353516, 65.554336547852, 2154.0563964844, 1301.9788818359, 36.787712097168}, {-488.73297119141, 2129.7478027344, 131.07089233398, -577.43792724609, 2095.4423828125, 100.17473602295}, {355.38235473633, -1999.6640625, 34.214122772217, 401.36798095703, -2077.3337402344, -8.8294067382813}, {2373.4975585938, 69.472595214844, 68.322166442871, 2420.0559082031, -10.329551696777, 30.060695648193}, {2055.7841796875, 1197.9633789063, 25.738883972168, 2141.7668457031, 1147.1596679688, 20.643169403076}, {2321.8068847656, -1100.53125, 76.947044372559, 2365.5268554688, -1017.3639526367, 42.716026306152}, {-807.52880859375, 2699.8017578125, 75.263061523438, -853.92779541016, 2777.5541992188, 32.816757202148}, {196.63110351563, 2660.5759277344, 53.300601959229, 262.5549621582, 2594.3989257813, 17.598323822021}, {-458.94390869141, -164.11698913574, 123.5959777832, -548.6953125, -195.21823120117, 92.332641601563}, {-1070.3149414063, -1610.5084228516, 94.326530456543, -1135.0595703125, -1682.0073242188, 67.944076538086}, {-632.33306884766, -1473.3518066406, 44.557136535645, -545.33532714844, -1492.6140136719, -0.833984375}, {270.52749633789, -1205.0640869141, 110.60611724854, 321.99029541016, -1128.5759277344, 71.861503601074}, {1156.4423828125, -1441.9432373047, 38.343357086182, 1086.1207275391, -1504.4560546875, 4.4757308959961}, {-1267.3508300781, 1106.96484375, 102.32939910889, -1311.2535400391, 1019.9342041016, 80.008575439453}, {-2662.2238769531, 2242.8115234375, 89.52938079834, -2584.8740234375, 2297.583984375, 57.639293670654}, } local antisaveTimers = {} local loggingIn = {} -- Create teams and set time addEventHandler ( "onResourceStart", resourceRoot, function () setGameType( "CSG V"..getCSGServerVersion() ) setOcclusionsEnabled( false ) createTeam("Staff",255,255,255) local query = exports.DENmysql:query("SELECT * FROM teams ORDER BY list ASC") for k,v in ipairs(query) do createTeam(v["name"],v["cR"],v["cG"],v["cB"]) end local realtime = getRealTime() setTime( realtime.hour, realtime.minute ) setMinuteDuration( 60000 ) setServerPassword("") --set the password to nothing if any password is set. end ) addEventHandler("onResourceStop",resourceRoot, function() setServerPassword(math.random(1239871)) --set a password so that no one can connect back on while the kicking process continues. for k,v in ipairs(getElementsByType("player")) do kickPlayer(v,"Core","Core Stopping / Restarting...") end end) -- Check if there is not already a player ingame with the same serial addEventHandler( "onPlayerConnect", root, function ( playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber ) for k, thePlayer in pairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial( thePlayer ) == playerSerial ) then cancelEvent( true, "There is already a player online with this serial!" ); return end end end ) -- When the player joins spawn him ingame addEventHandler( "onPlayerJoin", root, function () if ( spawnPlayer( source, 0, 0, 0 ) ) then setCameraTarget ( source ) fadeCamera( source, true, 1.0, 0, 0, 0 ) startMatrix(source) showPlayerHudComponent ( source, "radar", false ) showPlayerHudComponent ( source, "area_name", false ) setElementDimension ( source, 1234 ) showChat( source, false ) end end ) local refreshTimers = {} function startMatrix(player) if (isElement(player)) then if (exports.server:isPlayerLoggedIn(player) == false) then fadeCamera(player, false,1.0,0,0,0) setTimer(fadeCamera,1000,1,player, true) local x, y, z, lx, ly, lz = unpack( matrixViewPositions[ math.random ( #matrixViewPositions ) ] ) setTimer(setCameraMatrix,1000,1,player, x, y, z, lx, ly, lz ) refreshTimers[player] = setTimer(startMatrix,5000,1, player) else if (isTimer(refreshTimers[player])) then killTimer(refreshTimers[player]) end return false --no more updating. end else return false end end -- Kick the player when he has a too low resolution --[[addEvent( "doKickPlayer", true ) addEventHandler( "doKickPlayer", root, function () kickPlayer( source, "Connection refused due a too low screen resolution" ) end )]]-- -- When the player spawns check if we show the login screen or draw a ban window addEvent( "doSpawnPlayer", true ) addEventHandler( "doSpawnPlayer", root, function () local time = getRealTime() local banData = exports.DENmysql:query( "SELECT banstamp,bannedby,reason,serial FROM bans WHERE serial=? LIMIT 1", getPlayerSerial( source ) ) if banData and banData[1] then if ( time.timestamp > tonumber( banData[1].banstamp ) ) and not ( tonumber( banData[1].banstamp ) == 0 ) then exports.DENmysql:exec( "DELETE FROM bans WHERE serial = ?", getPlayerSerial( source ) ) triggerClientEvent( source, "setLoginWindowVisable", source ) else setElementData( source, "Occupation", "Banned" ) triggerClientEvent( source, "drawClientBanScreen", source, banData[1].serial, banData[1].reason, banData[1].banstamp, banData.bannedby ) toggleAllControls(source,false) end else triggerClientEvent( source, "setLoginWindowVisable", source ) end end ) -- Timestap convert function timestampConvert ( timeStamp ) local time = getRealTime(timeStamp) local year = time.year + 1900 local month = time.month + 1 local day = time.monthday local hour = time.hour local minute = time.minute return "" .. hour ..":" .. minute .." - " .. month .."/" .. day .."/" .. year .."" end -- When the player creates a new account addEvent( "doAccountRegister", true ) addEventHandler( "doAccountRegister", root, function ( username, password1, password2, email, genderMale, genderFemale ) if ( exports.DENmysql:querySingle( "SELECT username FROM accounts WHERE username=? LIMIT 1", string.lower( username ) ) ) then triggerClientEvent( source, "setWarningLabelText", source, "This username is already taken!", "registerWindow", 225, 0, 0 ) elseif ( #exports.DENmysql:query( "SELECT * FROM accounts WHERE serial = ?", getPlayerSerial( source ) ) >= 2 ) then triggerClientEvent( source, "setWarningLabelText", source, "You can only register 2 accounts for each serial!", "registerWindow", 225, 0, 0 ) else if ( genderFemale ) then theGender = 93 else theGender = 0 end if ( exports.DENmysql:exec( "INSERT INTO accounts SET username=?, password=?, email=?, serial=?, skin=?", string.lower( username ), sha512( password1 ), email, getPlayerSerial( source ), theGender ) ) then local userData = exports.DENmysql:querySingle( "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", string.lower( username ), sha512( password1 ) ) exports.DENmysql:exec("INSERT INTO weapons SET userid=?", tonumber( userData.id ) ) exports.DENmysql:exec("INSERT INTO playerstats SET userid=?", tonumber( userData.id ) ) triggerClientEvent( source, "setPopupWindowVisable", source ) end end end ) -- When the player password changed function onPasswordRequestCallback () -- callBack functie after password is changed nothing important though end -- Password reset function addEvent( "doPlayerPasswordReset", true ) addEventHandler( "doPlayerPasswordReset", root, function ( email, username, newPassword ) local userData = exports.DENmysql:querySingle( "SELECT email FROM accounts WHERE username = ? LIMIT 1", string.lower(username) ) if ( userData ) then if ( userData.email == "" ) or ( userData.email == " " ) then triggerClientEvent( source, "setWarningLabelText", source, "No email found with this account!", "passwordWindow", 225, 0, 0 ) elseif not ( string.match(tostring(userData.email), "^.+@.+%.%a%a%a*%.*%a*%a*%a*") )then triggerClientEvent( source, "setWarningLabelText", source, "You didn't enter a vaild email adress!", "passwordWindow", 225, 0, 0 ) elseif not ( string.lower(userData.email) == string.lower(email) ) then triggerClientEvent( source, "setWarningLabelText", source, "The email with this account doesn't match!", "passwordWindow", 225, 0, 0 ) else if ( exports.DENmysql:exec( "UPDATE accounts SET password=? WHERE username=? AND email=?", sha512(newPassword), string.lower(username), email ) ) then callRemote( "http://csgmta.net/mail/password.php", onPasswordRequestCallback, username, email, newPassword ) exports.DENdxmsg:createNewDxMessage(source, "Your password is changed and sent to your email!", 0, 225, 0) triggerClientEvent( source, "setWarningLabelText", source, "A new password has been sent!", "passwordWindow", 225, 0, 0 ) triggerClientEvent ( source, "setLoginWindowVisable", source ) end end else triggerClientEvent( source, "setWarningLabelText", source, "No account found with this name!", "passwordWindow", 225, 0, 0 ) end end ) -- When the player send the login forum addEvent( "doPlayerLogin", true ) addEventHandler( "doPlayerLogin", root, function ( username, password, usernameTick, passwordTick ) if not (exports.DENmysql:getConnection()) then triggerClientEvent(source,"setWarningLabelText",source,"Database is down! Please contact a developer!","loginWindow",255,0,0) return false end local accountID = false local idQuery = exports.DENmysql:query("SELECT id FROM accounts WHERE username=? LIMIT 1",username:lower()) if idQuery and #idQuery == 1 then accountID = idQuery[1].id end if not accountID then triggerClientEvent( source, "setWarningLabelText", source, "Wrong username and/or password!", "loginWindow", 225, 0, 0 ) triggerClientEvent(source,"toggleLoginButton",source,true) return end if ( #exports.DENmysql:query( "SELECT id FROM accounts WHERE id=? AND password=? LIMIT 1", accountID, md5( password ) ) == 1 ) then -- If the password is a MD5 password from the old system then force the player to change it triggerClientEvent( source, "setWarningLabelText", source, "Unable to login, please change password first!", "loginWindow", 225, 0, 0 ) triggerClientEvent( source, "setNewPasswordWindowVisable", source ) setElementData( source, "temp:UsernameData", string.lower( username ) ) setElementData( source, "temp:PasswordData", md5( password ) ) elseif ( #exports.DENmysql:query( "SELECT id FROM accounts WHERE id=? AND password=? LIMIT 1", accountID, sha512( password ) ) == 1 ) then -- If the password is correct and a SHA512 password then log the player in --exports.irc:outputIRC(tostring(loggingIn[username])) if (loggingIn[username] == nil) then loggingIn[username] = true --set this true to prevent it from logging in again --exports.irc:outputIRC(username.." login stored.") elseif (loggingIn[username] == true) then --exports.irc:outputIRC(username.." was refused login since he spammed the :~ out of login.") return false else --exports.irc:outputIRC("Something :Oed up, blame Priyen!") --exports.irc:outputIRC(tostring(loggingIn[username])) end local banData = exports.DENmysql:query( "SELECT banstamp FROM bans WHERE username=? LIMIT 1", username:lower() ) if ( banData and #banData == 1 ) then if ( banData[1].banstamp == 0 ) then triggerClientEvent( source, "setWarningLabelText", source, "This account is Permanently Banned from the server!", "loginWindow", 225, 0, 0 ) elseif ( getRealTime().timestamp < banData[1].banstamp ) then triggerClientEvent( source, "setWarningLabelText", source, "This account is banned from the server til: "..timestampConvert( banData[1].banstamp ), "loginWindow", 225, 0, 0 ) elseif ( banData[1].banstamp > 0 ) and ( getRealTime().timestamp > banData[1].banstamp ) and ( exports.DENmysql:exec( "DELETE FROM bans WHERE account=?", username:lower() ) ) then triggerClientEvent( source, "setWarningLabelText", source, "Your account is now unbanned! Try again.", "loginWindow", 0, 225, 0 ) end else removeElementData( source, "temp:UsernameData" ) removeElementData( source, "temp:PasswordData" ) triggerClientEvent ( source, "updateAccountXMLData", source, username, password, usernameTick, passwordTick ) local accountData = exports.DENmysql:query( "SELECT * FROM accounts WHERE id=? LIMIT 1", accountID ) local groupData = exports.DENmysql:query( "SELECT groupname,grouprank,groupid FROM groups_members WHERE memberid=? LIMIT 1", accountID ) for k,v in ipairs(getElementsByType("player")) do if (getElementData(v,"accountUserID") == accountData[1].id) then kickPlayer(v,"Accounts",getPlayerName(source).." has logged into your account.") end end exports.DENmysql:exec( "INSERT INTO logins SET serial=?, ip=?, nickname=?, accountname=?", getPlayerSerial( source ), getPlayerIP ( source ), getPlayerName( source ), username ) exports.DENmysql:exec( "UPDATE accounts SET serial=?,IP=? WHERE id=?", getPlayerSerial( source ), getPlayerIP( source ), accountData[1].id ) setPlayerTeam ( source, getTeamFromName(accountData[1].team) ) setElementData( source, "accountUserID", accountID ) setElementData( source, "tempdata.accountUserID", accountID ) setElementData( source, "Occupation", accountData[1].occupation ) setElementData( source, "playerAccount", accountData[1].username ) setElementData( source, "playerEmail", accountData[1].email ) setElementData( source, "playerIP", getPlayerIP ( source ) ) setElementData( source, "joinTick", getTickCount() ) setElementData(source,"playerScore",accountData[1].score) setElementData( source, "carLicence", true ) setElementData( source, "planeLicence", true ) setElementData( source, "bikeLicence", true ) setElementData( source, "chopperLicence", true ) setElementData( source, "boatLicence", true ) if ( groupData and #groupData == 1 ) then setElementData( source, "Group", groupData[1].groupname ) setElementData( source, "GroupRank", groupData[1].grouprank ) setElementData( source, "GroupID", tonumber(groupData[1].groupid) ) end if ( tonumber(accountData[1].premium) < 1 ) then setElementData( source, "isPlayerPremium", false ) setElementData( source, "Premium", "No" ) setElementData(source,"premiumType",accountData[1].premiumType) else setElementData( source, "isPlayerPremium", true ) setElementData( source, "Premium", "Yes" ) setElementData(source,"premiumType",accountData[1].premiumType) end setElementData( source, "playTime", accountData[1].playtime ) triggerClientEvent( source, "setAllWindowsHided", source ) triggerClientEvent( source, "clientPlayerLogin", source, accountData[1].id, username ) fadeCamera( source, false, 1.0, 0, 0, 0 ) setTimer( fadeCamera, 2000, 1, source, true, 1.0, 0, 0, 0 ) setTimer( createPlayerElementIntoGame, 1000, 1, source, accountData[1] ) antisaveTimers[source] = setTimer(allowSaving,10000,1,source) triggerEvent( "onPlayerLogin", source ) loggingIn[username] = nil end else -- If the password is wrong triggerClientEvent( source, "setWarningLabelText", source, "Wrong username and/or password!", "loginWindow", 225, 0, 0 ) triggerClientEvent(source,"toggleLoginButton",source,true) end end ) function allowSaving(player) if (isElement(player)) then antisaveTimers[source] = nil end end -- Change password addEvent( "onPlayerUpdatePasswords", true ) addEventHandler( "onPlayerUpdatePasswords", root, function ( password ) if ( getElementData( source, "temp:UsernameData" ) ) then if ( exports.DENmysql:exec( "UPDATE accounts SET password=? WHERE username=?", sha512( password ), getElementData( source, "temp:UsernameData" ) ) ) then triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "Your password is changed!", 0, 225, 0 ) else triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "We couldn't change your password try again!", 225, 0, 0 ) end else triggerClientEvent ( source, "setLoginWindowVisable", source ) exports.DENdxmsg:createNewDxMessage( thePlayer, "We couldn't change your password try again!", 225, 0, 0 ) end end ) -- Spawn the player into the world function createPlayerElementIntoGame ( thePlayer, dataTable ) if ( exports.server:isPlayerLoggedIn( thePlayer ) ) then local playerID = exports.server:getPlayerAccountID( thePlayer ) exports.DENdxmsg:createNewDxMessage( thePlayer, "Welcome back to CSG " .. getPlayerName( thePlayer ) .. "!", 238, 154, 0 ) setCameraTarget( thePlayer, thePlayer ) showChat( thePlayer, true ) showPlayerHudComponent ( thePlayer, "radar", true ) showPlayerHudComponent ( thePlayer, "area_name", true ) if ( dataTable.team == "Criminals" ) or ( dataTable.team == "Unemployed" ) or ( dataTable.team == "Unoccupied" ) then spawnPlayer( thePlayer, dataTable.x, dataTable.y, dataTable.z +1, dataTable.rotation, dataTable.skin, dataTable.interior, dataTable.dimension, dataTable.team ) else spawnPlayer( thePlayer, dataTable.x, dataTable.y, dataTable.z +1, dataTable.rotation, dataTable.jobskin, dataTable.interior, dataTable.dimension, dataTable.team ) end local CJCLOTTable = fromJSON( tostring( dataTable.cjskin ) ) if CJCLOTTable then for theType, index in pairs( CJCLOTTable ) do local texture, model = getClothesByTypeIndex ( theType, index ) addPedClothes ( thePlayer, texture, model, theType ) end end local weapons = fromJSON( dataTable.weapons ) if ( weapons ) then for weapon, ammo in pairs( weapons ) do if not ( tonumber(weapon) == 36 ) and not ( tonumber(weapon) == 37 ) and not ( tonumber(weapon) == 38 ) and not ( tonumber(weapon) == 18 ) then giveWeapon( thePlayer, tonumber(weapon), tonumber(ammo) ) end end end local playerStatus = exports.DENmysql:querySingle( "SELECT * FROM playerstats WHERE userid=? LIMIT 1", playerID ) if ( playerStatus ) then local wepSkills = fromJSON( playerStatus.weaponskills ) if ( wepSkills ) then for skillint, valueint in pairs( wepSkills ) do if ( tonumber(valueint) > 950 ) then setPedStat ( thePlayer, tonumber(skillint), 995 ) else setPedStat ( thePlayer, tonumber(skillint), tonumber(valueint) ) end end end end if ( dataTable.health == 0 ) then killPed( thePlayer ) else setElementHealth( thePlayer, tonumber( dataTable.health ) ) end exports.DENmysql:exec( "UPDATE groups_members SET lastonline=? WHERE memberid=?", getRealTime().timestamp, playerID ) setPedArmor( thePlayer, tonumber( dataTable.armor ) ) setPlayerMoney( thePlayer, tonumber( dataTable.money ) ) setPedFightingStyle ( thePlayer, tonumber( dataTable.fightstyle ) ) setElementData ( thePlayer, "isPlayerLoggedin", true ) setElementData ( thePlayer, "wantedPoints", tonumber( dataTable.wanted ) ) local jailData = exports.DENmysql:querySingle("SELECT * FROM jail WHERE userid=? LIMIT 1",dataTable.id) if (jailData) then triggerClientEvent( thePlayer, "onSetPlayerJailed", thePlayer, jailData.jailtime ) end triggerEvent ( "onServerPlayerLogin", thePlayer, playerID, dataTable.username ) exports.DENvehicles:reloadFreeVehicleMarkers( thePlayer ) end end function getCSGServerVersion() query = exports.DENmysql:querySingle("SELECT value FROM settings WHERE settingName=? LIMIT 1","serverVersion") if (query) then return query["value"] else return "2.1.4" end end addEvent("updatePlayerFPS",true) addEventHandler("updatePlayerFPS",root, function(fps) if (isElement(source)) and fps then setElementData(source,"FPS",fps) end end) --[[function updatePlayerTeamToElementData() for k,v in ipairs(getElementsByType("player")) do team = getPlayerTeam(v) if (team ~= nil) then setElementData(v,"playerTeam",team) outputDebugString(getTeamFromName(team)) end end end setTimer(updatePlayerTeamToElementData,2000,0)]]-- function isAllowedToSave(player) if (isTimer(antisaveTimers[player])) then return false else return true end end
  21. I have a big problem as my hud is working very good but there is another hud (the normal hud) working with it so i must do restart for my hud every 5 minutes to do it work alone how can i solve this prob or how can i delete the normal hud https://imgur.com/a/EOmFzvL
  22. بقالي اسبوعين باعتلك طلب الصداقة وانت مقبلتش لحد دلوقتي https://www.facebook.com/Bokl2002
  23. local blipTable = {} meleeBlips = { {1833.703, -1842.807}, {1352.487, -1758.57}, {1315.459, -898.688}, {-1562.522, -2733.185}, {-2442.557, 754.996}, {2194.932, 1988.895}, {2099.141, 2224.299}, {1937.835, 2305.65}, {2246.179, 2396.23}, {2454.381, 2065.184}, {2547.9677, 1972.663}, {2885.638, 2455.107}, {-180.894, 1033.388}, {999.837, -921.802}, } ammublips = { {1369, -1279}, {2400, -1981}, {-2625, 208}, {-2099, -2469}, {2539, 2082}, {2159, 941}, {777, 1871}, {-315, 832}, {240, -178}, {-1508, 2608}, {2335, 61}, } bikeBlips = { {2230.491, 1400.998}, } gymBlips = { { 2228.623, -1722.583, 13.554 }, { -2269.058, -155.894, 35.32 }, { 1968.712, 2295.872, 16.455 }, { 654.065, -1869.551, 4.5 } } cluckinBlips = { {172, 1176}, {-1213, 1830}, {-2155, -2460}, {2419, -1509}, {2397, -1898}, {928, -1352}, {-1815, 618}, {-2671, 258}, {2638, 1671}, {2393, 2041}, {2838, 2407}, {2102, 2228}, {-3667, -383}, {-5206, 52} } carShops = { {-1667.2753, 1206.4147}, {-1961.498, 287.344}, {-1706.175, 407.25}, {552.82, -1261.418}, {2294.025, -2324.841}, {-1534.272, 2626.144}, {1273.746, 187.222}, {-2097.08, -2258.84}, {1952.82, 2039.7199}, {2131.88, -1149.31}, {1658.332, 2195.125}, } planeShops = { {-1675, -404}, {1581, 1648}, {1939, -2285}, {374, 2542}, } boatShops = { {2293.6, 532.18} } modShopBlips = { {-2723, 217}, {1990, 2056}, {1041, -1018}, {-1936, 245}, {2412, -2471}, {-1561, 1247}, {1643, -1516}, {1431, -2439}, {-1598, -631}, {1409, 1811}, {-3723, -440} } local fsc = { {1937.16, -1769.35}, {-2238, -2563}, {-1613, -2723}, {2142, 2747}, {616, 1690}, {2120, 920}, {2643, 1106}, {2203, 2471}, {-1330, 2672}, {-1477, 1864}, {-1681, 408}, {-2406, 970}, {78, 1217}, {1386, 461}, {653, -559}, {1009, -933}, {2155, -1153}, {2581, 57}, {2530, -1520}, {286, -1788}, {1980, -2635}, {2464, -2243}, {-479, -502}, {1592, 2200}, {-1721, -452}, {-2225, -216}, { -2873, 439, 5 }, {-2238, 2291}, {69, 2045}, {1282, 1422}, {-89, -1163}, {989, -1304}, {-3480, -370}, {-5380, -18}, {-5152, 24} } function blipCreate() local drugBlip = exports.CRGcustomblips:createCustomBlip(2540, -1307, 13, 9, "blips/Drug_Pill.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(drugBlip, 1) for key, mblips in pairs(meleeBlips) do local meleeBlip = exports.CRGcustomblips:createCustomBlip(mblips[1], mblips[2], 20, 20, "blips/Hammer-icon.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(meleeBlip, 1) blipTable[meleeBlip] = "store" end for key, ablips in pairs(ammublips) do local ammuBlip = exports.CRGcustomblips:createCustomBlip(ablips[1], ablips[2], 25, 25, "blips/ammu.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(ammuBlip, 1) blipTable[ammuBlip] = "ammu" end for key, bblips in pairs(bikeBlips) do local bikeBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/mc.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(bikeBlip, 1) blipTable[bikeBlip] = "vehshop" end for key, bblips in pairs(carShops) do local carBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid55.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(carBlip, 1) blipTable[carBlip] = "vehshop" end for key, bblips in pairs(planeShops) do local planeBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid5.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(planeBlip, 1) blipTable[planeBlip] = "vehshop" end for key, bblips in pairs(boatShops) do local boatBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid9.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(boatBlip, 1) blipTable[boatBlip] = "vehshop" end for key, bblips in pairs(burgerBlips) do local burgBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid10.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(burgBlip, 1) blipTable[burgBlip] = "food" end for key, bblips in pairs(pizzaBlips) do local pizzaBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid29.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(pizzaBlip, 1) blipTable[pizzaBlip] = "food" end for key, bblips in pairs(cluckinBlips) do local cluckinBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid14.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(cluckinBlip, 1) blipTable[cluckinBlip] = "food" end for key, bblips in pairs(restaurantBlips) do local restBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid50.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(restBlip, 1) blipTable[restBlip] = "food" end for key, bblips in pairs(modShopBlips) do local modBlip = exports.CRGcustomblips:createCustomBlip(bblips[1], bblips[2], 20, 20, "blips/Blipid27.png", 180) exports.CRGcustomblips:setCustomBlipRadarScale(modBlip, 1) blipTable[modBlip] = "repairmod" end for key, gymblip in pairs(gymBlips) do local gymBlip = createBlip(gymblip[1], gymblip[2], gymblip[3], 54, 2, 0, 0, 0, 255, 0, 230) end local LSbank = exports.CRGcustomblips:createCustomBlip(1462.4, -1012.1, 20, 20, "blips/Blipid52.png", 400) local SFbank = exports.CRGcustomblips:createCustomBlip(-1882.5, 718.7, 20, 20, "blips/Blipid52.png", 400) exports.CRGcustomblips:setCustomBlipRadarScale(LSbank, 1) exports.CRGcustomblips:setCustomBlipRadarScale(SFbank, 1) for key, ent in pairs(fsc) do local fuelBlip = exports.CRGcustomblips:createCustomBlip(ent[1], ent[2], 20, 20, "gas.png", 200) exports.CRGcustomblips:setCustomBlipRadarScale(fuelBlip, 1) blipTable[fuelBlip] = "fuel" end startClientGangBlips() end addEventHandler("onClientResourceStart", resourceRoot, blipCreate, true, "low") function toggleBlipsCITPhone(blipType, alpha) for blip, btype in pairs(blipTable) do if blipType == btype then exports.CRGcustomblips:setCustomBlipAlpha(blip, alpha) end end end addEvent("CITblips.blipOn", true) addEventHandler("CITblips.blipOn", root, toggleBlipsCITPhone) function toggleBlipsSetting (blipTType, oldsadasd, typee) if typee == "No" then for blip, btype in pairs(blipTable) do if blipTType == btype then exports.CRGcustomblips:setCustomBlipAlpha(blip, 0) end end end end addEventHandler("onClientSettingChange", root, toggleBlipsSetting) function toggleBlipsSetting3 (blipTType, oldsadasd, typee) if blipTType ~= "radarBlips" then return end if typee == "No" then for blip123, btype123 in pairs(blipTable) do exports.CRGcustomblips:setCustomBlipRadarScale(blip123, 1) end -- Retrieve a table containing all the blips that exist blips = getElementsByType ( "blip" ) -- Loop through the list, storing the blip from the table in the variable blipValue for blipKey, blipValue in ipairs(blips) do -- Retrieve the blip's icon into the variable 'blipIcon' blipIcon = getBlipIcon ( blipValue ) -- If the blip's icon wasn't the default already if ( blipIcon ~= 0 ) then -- Set the blip's icon to the default setBlipVisibleDistance ( blipValue, getElementData(blipValue,"visnum") ) end end end end addEventHandler("onClientSettingChange", root, toggleBlipsSetting3) function toggleBlipsSetting4 (blipTType, oldsadasd, typee) if blipTType ~= "radarBlips" then return end if typee == "Yes" then for blip123, btype123 in pairs(blipTable) do exports.CRGcustomblips:setCustomBlipRadarScale(blip123, 0) end -- Retrieve a table containing all the blips that exist blips = getElementsByType ( "blip" ) -- Loop through the list, storing the blip from the table in the variable blipValue for blipKey, blipValue in ipairs(blips) do -- Retrieve the blip's icon into the variable 'blipIcon' blipIcon = getBlipIcon ( blipValue ) -- If the blip's icon wasn't the default already if ( blipIcon ~= 0 ) then setElementData(blipValue,"visnum",getBlipVisibleDistance(blipValue)) -- Set the blip's icon to the default setBlipVisibleDistance ( blipValue, 0 ) end end end end addEventHandler("onClientSettingChange", root, toggleBlipsSetting4) function toggleBlipsSetting2 (blipTType, oldsadasd, typee) if typee == "Yes" then for blip, btype in pairs(blipTable) do if blipTType == btype then exports.CRGcustomblips:setCustomBlipAlpha(blip, 1) end end end end addEventHandler("onClientSettingChange", root, toggleBlipsSetting2) local friendBlips = {} local viewBlips = true local allyList = {} function doThisWhenRestStarted() local alliedGroups = xmlLoadFile("alliedgroups.xml") alliedGroups = alliedGroups or xmlCreateFile("alliedgroups.xml", "allies") local allyNodes = xmlNodeGetChildren(alliedGroups) local allianceGroups = exports.CRGalliance:getAllianceGroups() or {} for index, node in pairs(allyNodes) do local ally = xmlNodeGetValue(node) for i, ally2 in pairs(allianceGroups) do if ally2 == ally then allyList[ally] = true end end end end setTimer(doThisWhenRestStarted, 5000, 1) function isInSameAlliance(plr) local ally = getElementData(plr, "g") local found = false for i, ally2 in pairs(exports.CRGalliance:getAllianceGroups()) do if ally2 == ally then return true end end return false end function addAllyCommand(cmd, ...) local ally = table.concat({ ... }, " ") if ally then local found = false for i, ally2 in pairs(exports.CRGalliance:getAllianceGroups()) do if ally2 == ally then found = true break end end if not found then exports.CRGtexts:output("You are not in an alliance with " .. ally, 255, 0, 0) return end allyList[ally] = true local child = xmlCreateChild(alliedGroups, "ally") xmlNodeSetValue(child, ally) xmlSaveFile(alliedGroups) for index, player in pairs(getElementsByType("player")) do if ally == getElementData(player, "g") and player ~= localPlayer and not friendBlips[player] and isPlayerNametagShowing(player) then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20Green.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "allianceMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) end end outputChatBox("Added " .. ally .. " members to your radar", 0, 255, 0) else outputChatBox("Usage /addally group name", 255, 0, 0) end end addCommandHandler("addally", addAllyCommand) function deleteAllyCommand(cmd, ...) local ally = table.concat({ ... }, " ") if not ally then outputChatBox("Usage /deleteally group name", 255, 0, 0) return end allyList[ally] = nil local allyNodes = xmlNodeGetChildren(alliedGroups) for index, node in pairs(allyNodes) do if xmlNodeGetValue(node) == ally then xmlDestroyNode(node) end end xmlSaveFile(alliedGroups) for index, player in pairs(getElementsByType("player")) do if ally == getElementData(player, "g") and friendBlips[player] then exports.CRGcustomblips:destroyCustomBlip(friendBlips[player]) friendBlips[player] = nil end end outputChatBox("Removed " .. ally .. " members to your radar", 0, 255, 0) end addCommandHandler("deleteally", deleteAllyCommand) function startClientGangBlips() local myGang = getElementData(localPlayer, "g") if not myGang then return end for index, player in pairs(getElementsByType("player")) do if myGang == getElementData(player, "g") and player ~= localPlayer then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "groupMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) elseif allyList[getElementData(player, "g")] and player ~= localPlayer then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20Green.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "allianceMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) end end for i, ally22 in pairs(exports.CRGalliance:getAllianceGroups()) do if ally22 then for index, player in pairs(getElementsByType("player")) do if ally22 == getElementData(player, "g") and player ~= localPlayer and getElementData(player,"g") ~= getElementData(localPlayer,"g") then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20Green.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "allianceMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) end end end end end function clientChange(dataName, oldValue) if dataName ~= "g" then return end if not viewBlips then return end local myGang = getElementData(localPlayer, "g") if not myGang then return end if not isPlayerNametagShowing(source) then return end if source == localPlayer then for index, player in pairs(getElementsByType("player")) do if myGang == getElementData(player, "g") and player ~= localPlayer then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "groupMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) elseif allyList[getElementData(player, "g")] and player ~= localPlayer then friendBlips[player] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20Green.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[player], "allianceMember", player) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[player], player) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[player], 1) local r, g, b = getBlipColor(getAttachedElements(player)[1]) setBlipColor(getAttachedElements(player)[1], r, g, b, 0) end end else local theirGang = getElementData(source, "g") if theirGang == myGang then friendBlips[source] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[source], "groupMember", source) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[source], source) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[source], 1) local r, g, b = getBlipColor(getAttachedElements(source)[1]) setBlipColor(getAttachedElements(source)[1], r, g, b, 0) elseif allyList[theirGang] then friendBlips[source] = exports.CRGcustomblips:createCustomBlip(0, 0, 15, 15, "blips/Blipid20Green.png", 400) exports.CRGcustomblips:setCustomBlipData(friendBlips[source], "allianceMember", source) exports.CRGcustomblips:attachCustomBlipToElement(friendBlips[source], source) exports.CRGcustomblips:setCustomBlipRadarScale(friendBlips[source], 1) local r, g, b = getBlipColor(getAttachedElements(source)[1]) setBlipColor(getAttachedElements(source)[1], r, g, b, 0) elseif (oldValue == myGang or allyList[theirGang]) and friendBlips[source] then exports.CRGcustomblips:destroyCustomBlip(friendBlips[source]) friendBlips[source] = nil local r, g, b = getBlipColor(getAttachedElements(source)[1]) setBlipColor(getAttachedElements(source)[1], r, g, b, 255) end end end addEventHandler("onClientElementDataChange", root, clientChange) function setGroupBlipsVisible() end fileDelete("blips.lua") thats my code please tell me which line and which word should i edit ?
×
×
  • Create New...