Jump to content

TwiX!

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by TwiX!

  1. learn here pls.. https://forum.multitheftauto.com/viewtopic.php?f=148&t=41066
  2. TwiX!

    xml

    for me not have errors
  3. its will working.. /debugscript 3?
  4. TwiX!

    xml

    server local lastTimePlayed local month = {"January","February","March","April","May","June","Juli","August","September","October","November","December"} function timestampToDate(stamp) local time = getRealTime(stamp) return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) end addEventHandler ( 'onMapStarting', root, function ( map.Info ) local mapname = getResourceInfo(exports.mapmanager:getRunningGamemodeMap(),"name") local author = getResourceInfo(exports.mapmanager:getRunningGamemodeMap(),"author") local lastTimePlayed = timestampToDate(mapInfo.lastTimePlayed) local xml = xmlLoadFile("data/ratings.xml") if ( xml ) then local index = findIndexByName ( mapname ) if ( index ) then local map = xmlFindChild ( xml, "map", index ) local rating = xmlNodeGetAttribute ( map, "rating" ) local ratedBy = xmlNodeGetAttribute ( map, "ratedBy" ) local played = xmlNodeGetAttribute ( map, "played" ) triggerClientEvent(source,"INFO",getRootElement(),mapname,author,rating,ratedBy,played,lastTimePlayed) else outputChatBox ( "Map not found in our ratings list.", getRootElement(), 255, 0, 0, true ) end else outputChatBox ( "Unable to load map ratings XML file.", getRootElement(), 255, 0, 0, true ) end end ) function findIndexByName ( mapName ) local ratingsFile = xmlLoadFile("data/ratings.xml") if ( ratingsFile ) then for index, map in ipairs ( xmlNodeGetChildren ( ratingsFile ) ) do local name = xmlNodeGetAttribute ( map, "id" ) if ( name == mapName ) then return index -1 end end xmlUnloadFile(ratingsFile) end end Client local screenWidth, screenHeight = guiGetScreenSize() local endPosition = screenHeight-140 local moveback = false function getDrawText(mapname,author,rating,ratedBy,played,lastTimePlayed) addEventHandler ( "onClientRender", getRootElement(), drawMapInfo) if mapname then textM = "Map: "..mapname else textM = "Unknown" end if author then textA = "Author: "..author else textA = "Unknown" end if rating then textR = "Rate: " ..rating.. "/10 (by " ..ratedBy.. " players)" else textR = "Not rated yet" end if played then textP = "Times played: "..played.." times" else textP = "Never played before" end if lastTimePlayed then textPL = "Last Time Played\n"..lastTimePlayed else textPL = "Unknown" end end addEvent( "INFO", true ) addEventHandler( "INFO", getRootElement(), getDrawText ) function drawMapInfo () if position == endPosition then if tickCount == 0 then moveback = true end tickCount = tickCount-1 movePosition = 0 end if position >= screenHeight+91 then removeEventHandler("onClientRender",getRootElement(),drawMapInfo) end if moveback then movePosition = -2.5 alpha = alpha - 10 end alpha = alpha + 5 if alpha > 255 then alpha = 255 elseif alpha < 0 then alpha = 0 end local heighResize = dxGetFontHeight(1.15, "default-bold") local widthRezise1 = dxGetTextWidth("Map - "..name,1.15,"default-bold") local widthRezise2 = dxGetTextWidth("Lasttime played - "..lastTimePlayed,1.15,"default-bold") local widthRezise3 = dxGetTextWidth("By - "..author,1.15,"default-bold") if widthRezise1 > widthRezise2 and widthRezise1 > widthRezise3 then widthRezise = widthRezise1 elseif widthRezise2 > widthRezise1 and widthRezise2 > widthRezise3 then widthRezise = widthRezise2 elseif widthRezise3 > widthRezise1 and widthRezise3 > widthRezise2 then widthRezise = widthRezise3 end dxDrawText ( textR,screenWidth/2-150,screenHeight/2+275,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( textP,screenWidth/2-150,screenHeight/2+250,636.0,675.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawImage(screenWidth/2-200,screenHeight/2+185,420.0,176.0, "images/info_bgr.png",0,0,0,tocolor(200,200,200,alpha)) dxDrawText ( textM,screenWidth/2-150,screenHeight/2+200,636.0,675.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( textA,screenWidth/2-150,screenHeight/2+225.0,636.0,619.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( textPL,screenWidth/2-150,screenHeight/2+300,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( "Mode: Destruction Derby",screenWidth/2-150,screenHeight/2+325,506.0,699.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) position = position - movePosition end
  5. TwiX!

    xml

    server addEventHandler ( 'onGamemodeMapStart', root, function ( uMapStart ) local mapname = getResourceName( uMapStart ) local xml = xmlLoadFile("data/ratings.xml") if ( xml ) then local index = findIndexByName ( mapname ) if ( index ) then local map = xmlFindChild ( xml, "map", index ) local rating = xmlNodeGetAttribute ( map, "rating" ) local ratedBy = xmlNodeGetAttribute ( map, "ratedBy" ) local played = xmlNodeGetAttribute ( map, "played" ) triggerClientEvent(source,"INFO",thePlayer,rating,ratedBy,played) outputChatBox ( "rated: ".. rating .." ratedBy: ".. ratedBy .." played ".. played, getRootElement(), 255, 0, 0, true ) else outputChatBox ( "Map not found in our ratings list.", getRootElement(), 255, 0, 0, true ) end else outputChatBox ( "Unable to load map ratings XML file.", getRootElement(), 255, 0, 0, true ) end end ) function findIndexByName ( mapName ) local ratingsFile = xmlLoadFile("data/ratings.xml") if ( ratingsFile ) then for index, map in ipairs ( xmlNodeGetChildren ( ratingsFile ) ) do local name = xmlNodeGetAttribute ( map, "id" ) if ( name == mapName ) then return index -1 end end xmlUnloadFile(ratingsFile) end end Client local screenWidth,screenHeight = guiGetScreenSize() function drawningText (thePlayer,rating,ratedBy,played) if rating and ratedBy and played then dxDrawText ( "Rate: " ..rating.. "/10",screenWidth/2-150,screenHeight/2+275,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( "(by " ..ratedBy.. " players)",screenWidth/2-150,screenHeight/2+275,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( "Times played: "..played.." times",screenWidth/2-150,screenHeight/2+250,636.0,675.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) else dxDrawText ( "Never rating before",screenWidth/2-150,screenHeight/2+275,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( "",screenWidth/2-150,screenHeight/2+275,684.0,647.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) dxDrawText ( "Never played before",screenWidth/2-150,screenHeight/2+250,636.0,675.0,tocolor(255,255,255,255),1.5,"default-bold","left","top",false,false,false) end end addEvent( "INFO", true ) addEventHandler( "INFO", getRootElement(), drawningText )
  6. i'm have '$' , 'euro', 'RU','UA(hryvnia), not have Pounds ;D paypal/webmoney ^^ It gets converted, look up British currency you'll find its higher than all of those you stated What proof do you have regarding scripts you have made in the past? updated old post -EDIT If interested talk on pm, bb
  7. i'm have '$' , 'euro', 'RU','UA(hryvnia), not have Pounds ;D paypal/webmoney ^^ a lot of scripts. user panels/some rp/g scripts etc.. (sql/mysql/xml/accounts ;D)(can make gamemode) If you like the price, then we can talk in pm, now I'm going to bed 20euro ~= 17 Pounds Read up, Not have publick scripts much time working with the race gamemode, btw not a problem to move to other game mode depends on what you want
  8. price will be between 20 euros and above
  9. завтра посмотрю =) таблицы эти есть (при старте ресурса)
  10. в чём проблема? ошибки какие? function workingReplaceFiles () txd = engineLoadTXD ( "Library_Skr1.txd" ) engineImportTXD ( txd, 4603 ) dff = engineLoadDFF ( "PLibrary_1.dff", 4603 ) engineReplaceModel ( dff, 4603 ) col = engineLoadCOL ( "Library.col", 4603 ) engineReplaceCOL ( col, 4603 ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), workingReplaceFiles ) ошибка может быть в самой текстуре
  11. function hornPlayForthePlayer(thePlayer,playerHorns,alreadySet) outputChatBox ('лалала код удалил, дабы не скомуниздили ^^') end Прикол в том, что если я использую сигнал всё норм, но если какой то (рандомный игрок) на сервере, то иногда этот варнинг
  12. BASS ERROR 2 in LoadMedia path:C:\Program Files (x86)\MTA San Andreas 1.3\mods\deathmatch\resources\panel\nil 3d:1 loop:0 BASS ERROR 2 in LoadMedia path:C:\Program Files (x86)\MTA San Andreas 1.3\mods\deathmatch\resources\panel\nil 3d:1 loop:0 BASS ERROR 2 in LoadMedia pat в чём может быть проблема? иногда ругается на варнинг что интервал таймера меньше 50, но этого не может быть, так как стоит таймер на 3 секунды (для HORN(сигнала)) а сам файл идёт 2 секунды, возникает это у некоторых игроков..
  13. TwiX!

    Help me

    by MX_MASTER
  14. nope, to reflex -___- I dont play on TG,and dont looking on this server. And if i wanna to do this script,this is dont saying that i copy TG server. liar
  15. не правда, линукс всегда был быстрее. мои данные --------------------------------------------------------------------------------------- Система | Кол-во скачиваемых файлов | Время скачивания | --------------------------------------------------------------------------------------- 1) Windows | 16 мб | 1 минута 10 секунд | --------------------------------------------------------------------------------------- 2) Linux | 16 мб | 28.341 секунд | --------------------------------------------------------------------------------------- найди "WTF//" или "ffs" или "tg" или "epg(вроде тоже линукс") на много быстрее качает, даже ффс - 80 игроков, 9мб ~= 4 секунды(мощный хост)
  16. Copy paste why all new servers try to copy 'TG' Idea about this gamemode map name? it doesn't make you more popular ._.
  17. stolen ideam from russian forum
  18. someone? lolz, pls close the topic
  19. TwiX!

    Tag

    lol wtf? -- server!!! function stafftag(text, msgtype) local root = getRootElement() -- get player local account = getAccountName(getPlayerAccount(source)) -- get account (admin) local name = getPlayerName(source) --your name if (msgtype == 0) then -- the type if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then -- check if admin outputChatBox("#000000[sTAFF] #0066FF" .. name .. ":#0066FF " .. text, root, 255, 255, 255, true) -- replace with [sTAFF] Name and text else outputChatBox(name .. ":#0066FF " .. text, root, 255, 255, 255, true) end end end addEventHandler("onPlayerChat", root, stafftag)
  20. client ------------- -- AFK killer ------------- local MaxAFKtime = 30 local warnTime = 20 local v = 0 local AFKtime = 0 local sx,sy = guiGetScreenSize() local wEvent = false function rWarn() dxDrawImage( sx/2 - 300, sy/2 - 100, 600, 200, "img/warn.png") dxDrawText("You will be killed in "..tostring(tCount).." seconds",sx/2 - 255, sy/2 + 45,sx,sy,tocolor(255,186,0,255),1.01,"bankgothic") end function stopWarn() if(wEvent) then removeEventHandler("onClientRender", getRootElement(), rWarn) wEvent = false end end function imgHandler() stopWarn() end addEventHandler("onClientPlayerWasted",getLocalPlayer(),imgHandler) function checkMain() if isPedInVehicle ( getLocalPlayer() ) then aTimeAdd() end end function aTimeAdd() AFKtime = AFKtime + 1 local isFinished = getElementData ( getLocalPlayer(), "dead") if(isVehicleFrozen ( getPedOccupiedVehicle ( getLocalPlayer() )) and isFinished == false) then aTimeClear() end local isNew = getElementData (getLocalPlayer(), "state") if isNew == "waiting" or isNew == "dead" then aTimeClear() end if(getPedOccupiedVehicle ( getLocalPlayer() ) ~= false) then local player = getLocalPlayer() if(AFKtime >= MaxAFKtime) then if (afkCounter <= 2) then triggerServerEvent ( "afkWarn", player, 1, afkCounter) afkCounter = afkCounter+1 triggerServerEvent ( "afkSlap", player) stopWarn() elseif (afkCounter > 2) then triggerServerEvent ( "afkWarn", player, 1, afkCounter) triggerServerEvent ( "afkWarn", player, 2) afkCounter = 1 triggerServerEvent ( "afkKick", player , player) end elseif(AFKtime >= warnTime) then tCount = tCount - 1 if(not wEvent) then addEventHandler("onClientRender", getRootElement(), rWarn) wEvent = true end end end end setTimer ( checkMain, 1000, -1) function aTimeClear() AFKtime = 0 tCount = 11 stopWarn() end bindKey("accelerate","down",aTimeClear) bindKey("vehicle_left","down",aTimeClear) bindKey("vehicle_right","down",aTimeClear) bindKey("brake_reverse","down",aTimeClear) function onClientLoaded(res) triggerServerEvent("onClientLoaded",getLocalPlayer()) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),onClientLoaded) function loadSettings(maxtime, wtime ) MaxAFKtime = tonumber(maxtime) warnTime = tonumber(wtime) end addEvent( "onSettingsReady", true ) addEventHandler( "onSettingsReady", getRootElement(), loadSettings ) function setKBA(thePlayer) killedByAfk = 1 end function deathReset() if killedByAfk == 0 then afkCounter = 0 end end addEventHandler("onClientPlayerWasted",getLocalPlayer(),deathReset) function resetKBA() killedByAfk = 0 end ------------------------------------------ -- Calling function from the client's side ------------------------------------------ function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction) ----------------------- -- Call server function ----------------------- function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end Server local raceState = "" local enableMessages = true local messageColor = "#FF5555" function afkMsg(mtype,afkCounter) if(mtype == 1) then outputChatBox("#FF6600* #FFFFFF".. getPlayerName(source).. "#FF6600 has been killed by the #FFFFFFAFK killer#FF6600 #FF6600[#ABCDEF"..afkCounter.."/3#FF6600]",getRootElement(),255,255,255,true) elseif(mtype == 2) then outputChatBox("#FF6600* #FFFFFF".. getPlayerName(source).. "#FF6600 has been kicked for staying #FFFFFFAFK#FF6600 for 3 rounds!",getRootElement(),255,255,255,true) end end addEvent( "afkWarn", true ) addEventHandler( "afkWarn", getRootElement(), afkMsg) function afkKill() local thePlayer = source callClientFunction(thePlayer,"setKBA",thePlayer) setElementHealth(source, 0) end addEvent( "afkSlap", true ) addEventHandler( "afkSlap", getRootElement(), afkKill) function changeRaceState(newStateName) raceState = newStateName end addEvent("onRaceStateChanging", true) addEventHandler( "onRaceStateChanging", getRootElement(), changeRaceState) function afkKick(player) kickPlayer(player,"AFK") end addEvent( "afkKick", true) addEventHandler( "afkKick", getRootElement(), afkKick) function clientLoaded() local msgenable = get( "msgenable" ) local msgcol = get( "msgcolor" ) if(msgenable) then if(msgenable == "true") then enableMessages = true else enableMessages = false end if(msgcol) then messageColor = msgcol end end local maxtime = get( "maxafktime" ) local wtime = get( "warnTime" ) triggerClientEvent ( "onSettingsReady", getRootElement(), maxtime, wtime) end addEvent("onClientLoaded", true) addEventHandler( "onClientLoaded", getRootElement(), clientLoaded) ------------------------------------------- -- Calling functions from the client's side ------------------------------------------- function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) ----------------------- -- Call client function ----------------------- function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end Why u stolen nextreme script?
  21. so it will be saved on server files. if i move the server files to another hosting, the datas will be moved too? no, u need move rigistry.db internal.db too
×
×
  • Create New...