Jump to content

TwiX!

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by TwiX!

  1. local timesMapPlayed = 0 local lastMapPlayed = 0 if currentMap ~= lastMapPlayed then timesMapPlayed = 1 lastMapPlayed = currentMap end if currentMap then if timesMapPlayed <= 2 then if currentMap == lastMapPlayed then table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap}) timesMapPlayed = timesMapPlayed + 1 else table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap}) end else timesMapPlayed = 0 end end
  2. killmessages - mta/server/mods/deathmatch/resources/[gamemodes]/[race]/race - meta.xml открой и удали там <include resource="killmessages"/> потом найди <setting name="#addons" удали race_traffic_sensor
  3. https://wiki.multitheftauto.com/wiki/SetElementData https://wiki.multitheftauto.com/wiki/GetElementData
  4. clinet --©TwiX function makeMusicGUI() --тут создавай своё окно или чё там end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), makeMusicGUI) function onStartPlaySound ( key, keyState ) if keyState == "down" then -- если игрок нажал на кнопку 0 тогда if getElementData(getLocalPlayer(),"state") == "alive" then -- наш игрок живой или нет? --тут делай проверку на кнопку или на созданное окно triggerServerEvent ("playSound3DForAll_S", getLocalPlayer()) --зовём на помощь сервер, чтобы музыку слышали все end end end bindKey ( "0", "down", onStartPlaySound ) bindKey ( "num_0", "down", onStartPlaySound ) function playingForALl () local playerCar = getPedOccupiedVehicle ( source ) -- получаем машину игрока if playerCar then -- если игрок в машине то --или тут x,y,z = getElementPosition( playerCar ) -- получаем координаты машины ourMusic = playSound3D("lol.mp3", x,y,z,true) -- начинаем играть музыку setSoundMaxDistance ( ourMusic, 35 ) -- устанавливаем расстояние attachElements (ourMusic,(getPedOccupiedVehicle(source) or source)) -- атачим музыку к машине или к игроку else outputChatBox ('Извини но ты должен быть в машине!',255,255,255,true) -- говорим ему что он должен быть в тачке end end addEvent( "playSound3DForAll_C", true ) addEventHandler( "playSound3DForAll_C", getRootElement(), playingForALl ) server --©TwiX function callClientForPlay () triggerClientEvent ( "playSound3DForAll_C", getRootElement()) -- зовём клиент чтобы всем воспроизвести её end addEvent( "playSound3DForAll_S", true ) addEventHandler( "playSound3DForAll_S", getRootElement(), callClientForPlay ) Прошу соблюдать авторские права
  5. show your client and server
  6. function dxDrawColorText(str, ax, ay, bx, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) if not str then return false end str = " "..str ax= ax - dxGetTextWidth(" ", scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) ax = ax + w color = tocolor(tonumber("0x"..string.sub(col, 1, 2)), tonumber("0x"..string.sub(col, 3, 4)), tonumber("0x"..string.sub(col, 5, 6)), 255) end last = e+1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) end end
  7. local sw,sh = guiGetScreenSize() local w,h = 300,100 guiCreateStaticImage( sw/2-w/2, sh/2-h/2, w, h, "logo.png", false) will on the center
  8. you code is not bugged follow the link//
  9. stop flood dude! learn here https://wiki.multitheftauto.com/wiki/GuiGetScreenSize no one will make it for you
  10. use https://wiki.multitheftauto.com/wiki/OnPlayerWasted event
  11. he want if guy pressed on f10, the window show to everyone,.. i'm made it
  12. you dont know what are you doing --Server script function setVisible(player,key,keyState ) -- our function local accName = getAccountName ( getPlayerAccount ( player ) ) -- get player account if (keyState == "down") then -- if player pressed on "f10" then if isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup( "Admin" ) ) then -- if player have admin rights then triggerClientEvent("showMsgWdw", getRootElement()) -- call client for show window else -- if not outputChatBox ('#ffffffERROR: #ffffffYou not admin',player,255,255,255,true) -- outputchatbox end end end bindKey ( player, "F10", "down", setVisible ) -- bind on f10 our function --Client script to set window visible function showMessageWindow() -- function for trigger if (guiGetVisible(msgWindow) == true) then -- if window opened then guiSetVisible (msgWindow,false ) -- close window showCursor(false) --disable cursor guiSetInputEnabled(false) --disable input focus else guiSetVisible (msgWindow,true ) enable --//-- showCursor(true) -- enable --//-- guiSetInputEnabled(true) --enable --//-- end end addEvent( "showMsgWdw", true ) -- our event addEventHandler( "showMsgWdw", getRootElement(), showMessageWindow ) -- attach our trigger to function
  13. you want image at the center?
  14. function createAnimation() ourImage = guiCreateStaticImage(20, 200, 100, 100, "bos.png", false) Animation.createAndPlay (ourImage, Animation.presets.guiMove ( HERE USE YOUR X ,HERE USE YOUR Y, 2000 ) ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), createAnimation)
  15. TwiX!

    jail error

    you can make it by yourself createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) function createSAPDTeam () SAPDteam = createTeam ("police", 100, 149, 237) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD() setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) setAccountData( playeraccount, "Occupation", "police") outputChatBox("You are now policeman.",source,0,255,0) end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL > 0) then if getTeamName( theTeam ) == "police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" then setElementPosition (source, 4076.3999023438, -1788.5, 3.511967, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) outputChatBox ( "You have been jailed by "..theCop.. " for 10 seconds.", source ) local playeraccount = getPlayerAccount ( attacker ) arrests = getAccountData(playeraccount, "arrest") setAccountData(playeraccount, "arrest", arrests + 1 ) givePlayerMoney (attacker, 100) setTimer ( setElementPosition, 10000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob)
  16. TwiX!

    Team script

    https://community.multitheftauto.com/index.php?p= ... ls&id=2833
  17. TwiX!

    Team script

    why to invent a bicycle? if admin panel already have it
  18. проблема только в тебе, не надо быть ленивым чтобы изучить этот язык как сказал если ты действительно захочешь его изучать, тебе самому будет интересно
×
×
  • Create New...