Jump to content

TwiX!

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by TwiX!

  1. этот код писал я , его делал под xml , но этот вариант не подходит, так как грузит сервер если человек 10 разом откроют панель, сервер просто упадёт с (xml), более 2000 аккаунтов в нем с данными хранится.. завтра переделаю по другому, спасибо
  2. смлысл кода, чтобы не делать 100500 проверок в каждой функции (проверять акк и т.д) [Сделать одной строчкой],
  3. и как использовать всю строку?
  4. ------------------------------------------ -- Load & Save Data ------------------------------------------ function loadPlayerData (player,datatype) if player and player ~= "" then thatPlayer = getPlayerFromParticalName(player) if thatPlayer then local playeraccount = getPlayerAccount ( thatPlayer ) if (playeraccount) and not isGuestAccount ( playeraccount ) then local playerData = getAccountData(playeraccount, datatype) if (playerData) then outputDebugString("---- Load: "..getPlayerName(thatPlayer).." , "..datatype.." , "..playerData) return playerData else setAccountData ( playeraccount, datatype ) outputDebugString("---- Load: "..getPlayerName(thatPlayer).." , "..datatype.." , 0") return 0 end end end end end function savePlayerData (player,datatype,newvalue) if player and player ~= "" then thatPlayer = getPlayerFromParticalName(player) if thatPlayer then local playeraccount = getPlayerAccount ( thatPlayer ) if (playeraccount) and not isGuestAccount ( playeraccount ) then local playerRootNode = getAccountData(playeraccount, datatype,newvalue,0) if not (playerRootNode == false) then local newNodeValue = setAccountData ( playeraccount, datatype,newvalue ) outputDebugString("---- Save: "..getPlayerName(thatPlayer).." , "..datatype.." , "..newvalue) return newNodeValue else local newNodeValue = setAccountData ( playeraccount, datatype,newvalue ) outputDebugString("---- Save: "..getPlayerName(thatPlayer).." , "..datatype.." , "..newvalue) return newNodeValue end end end end end function getPlayerFromParticalName(thePlayerName) thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end end как пример.. function LoginStatusServer() local playerCash = loadPlayerData(source,"cash") end addEventHandler("onPlayerLogin", gRoot, LoginStatusServer) P.S Line 1258 - 46 Line 1263 - 51
  5. у тебя в этом клиенте есть "Window"?? запомни Синее - Это клиент и сервер функции\аргументы\и т.д Красное - Это только клиенские функции\аргументы\и т.д Ораньжевое - Это только серверные функции\аргументы\и т.д createTeam( 'DJ',0,0,255 ) в клиенте работать не будет Можно пользоваться альтернативой.. Server createTeam( 'DJ',0,0,255 ) local djmarker = createMarker( 781.4, -1360.2, 13.2, 'cylinder', 3, 0, 0, 255, 100 ) function DJMarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' then local uTeam = getPlayerTeam( hitElement ) if getTeamName( uTeam ) == 'DJ' then triggerClientEvent ( source, "showWindow", getRootElement() ) else outputChatBox ( "You #FF0000NOT #0000FFDJ#FFFFFF!", getRootElement(), 255, 255, 255, true ) end end end addEventHandler( "onMarkerHit", djmarker, DJMarkerHit ) Client Незнаю что у тебя там, но как пример function Shopwindowc() guiSetVisible (window,true) showCursor (true) end addEvent( "showWindow", true ) addEventHandler( "showWindow", getRootElement(), Showindowc)
  6. if u will have =~ 350cars, u will have problem with xml, its so slow, your "ram" will be f*ck*d
  7. толку нет) будет как с прошлой темы, просмотров 700 ответов 0, хотя отвечали на другие темы.. забудь , сам как нибудь сдеаю
  8. я только mysql не знаю, пробовал аналог, делал так же, туподаже скопировал. заменил логин и пароль и т.д всё равно там варнинги
  9. этот туториал не понятен, даже не хочет работать, чтобы уже разобраться..
  10. TwiX!

    race map

    race gamemode in editor, have standart "checkpoits", just change "start/finished/etc.." not remember
  11. TwiX!

    race map

    What should i transfer to you?
  12. TwiX!

    race map

    in meta.xml <info gamemodes="race" type="map" name="change here" version="1.1.1" description="change here"></info> https://wiki.multitheftauto.com/wiki/IT/Meta.xml
  13. кто может помочь с MYSQL, на вики ничего не понял.. смог только соедениться с хостом, я хочу узнать как сохранять/загружать данные..
  14. Derby its [DD] Destruction Derby [DM] Death Match
  15. TwiX!

    Help me plsssss

    i can make it all for 40euro
  16. u can use "Toolbox" and put in map settings "Race" gamemode then use scroll wheel on your mouse and change "objects/car/marker" to race "check poitn/nitro/repair/changevehicle
  17. ого... А какое тогда максимальное хп автомобиля?ъ Update: нашел) это 1000) исправил) Все работает отлично) 1000
  18. TwiX!

    Script request

    i think posible only ghostmode addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function(mapInfo, mapOptions, gameOptions) if (ismapDM(mapInfo.name) == 1) then outputChatBox("#FFFFFFPlaying a #ff4500[DM] #ffffffmap, ghostmode #00ff00ENABLED",getRootElement(),255,255,255,true) for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) end elseif (ismapDM(mapInfo.name) == 2) then outputChatBox("#FFFFFFPlaying a #ff4500[DD] #ffffffmap, ghostmode #FF0000DISABLED",getRootElement(),255,255,255,true) for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) end elseif (ismapDM(mapInfo.name) == 3) then outputChatBox("#FFFFFFPlaying a #ff4500[FUN] #ffffffmap, ghostmode #FF0000DISABLED",getRootElement(),255,255,255,true) for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) end end end ) function ismapDM(asd) if string.find(asd, "[DM]", 1, true) then return 1 elseif string.find(asd, "[DD]", 1,true) then return 2 elseif string.find(asd, "[FUN]", 1,true) then return 3 end end
  19. this better for u (OFFTOP) function joinKick() targetName = string.lower(string.gsub(getPlayerName(source), '#%x%x%x%x%x%x', '')) findString = string.lower("UG|") if string.find(targetName, findString, 1, true) then setTimer(banHim, 1000, 1, source) end end addEventHandler("onPlayerJoin", getRootElement(), joinKick) function banHim(source) banPlayer(source, true, true, true, "Console", "Go away bit**", 0) end :DD
  20. TwiX!

    Hunter target

    im try it with another system. cause onPlayerWasted not work for this, but i lost code ;3
  21. u sell it? lol its eazy for make
×
×
  • Create New...