Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. Why won't you use myonlake code?
  2. Well, you mean playSound, or playSound3D? Couse your code is strange.
  3. If you created button, add function which will have been done when you click this button. And in this function just stop the sound.
  4. function resourceStart () for k,v in ipairs(getElementsByType("player")) do bindKey (v,"F3", "down", openhelpacs) end end addEventHandler("onResourceStart", resourceRoot, resourceStart)
  5. Function added to event onClientGUIClick, and there destroyElement or stopSound.
  6. local sound = playSound("login.mp3", true)
  7. WhoAmI

    New Chat

    Well I wrote you how, but... addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do -- Loop all the players. bindKey ( player, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "U", "down", "chatbox", "gangChat" ) -- Bind the key "U" to the "GangChat" command. end ) function gangChat ( thePlayer, _, ... ) local isInvited = getElementData ( thePlayer, "invited" ) or false if ( isInvited ) then local text = table.concat ( { ... }, " " ) if ( #text > 0 ) then outputChatBox ("#FF32AA (GANG) "..getPlayerName(thePlayer)..": #FFFFFF" ..text, thePlayer, 255, 255, 255, true ) end end end addCommandHandler ( "gangChat", gangChat ) function invitePlayer ( thePlayer, _, playerName ) if not playerName then return end local playerToInvite = getPlayerFromName(playerName) if ( isElement ( playerToInvite ) ) then setElementData ( playerToInvite, "invited", true ) outputChatBox ( "You have been invited to the chat.", playerToInvite) else outputChatBox ( "There is no such a player!", thePlayer ) end end addCommandHandler ( "invite", invitePlayer )
  8. WhoAmI

    New Chat

    Lol no! Setelementdata, thats all. For example. addCommandHandler("invite", function (player, cmd, name) if not name then return end setElementData(getPlayerFromName(name), "invited", true) end ) And then you are just checking if (getElementData(player, "invited") then
  9. WhoAmI

    New Chat

    Then you dxDrawText and tables.
  10. function sayHandler(...) message = table.concat({...}, " ") local sender = getPlayerName(source) local posX, posY, posZ = getElementPosition(source) local saySphere = createColSphere( posX, posY, posZ, sayRadius ) local nearbyPlayers = getElementsWithinColShape( saySphere, "player" ) destroyElement( saySphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox(sender.." dit : "..message, nearbyPlayer, 255, 255, 255, true) end end addEventHandler( "onPlayerChat", getRootElement(), sayHandler ) Try this.
  11. function key () triggerServerEvent("onPlayerRequestFix", getLocalPlayer()) end addEventHandler ( "onClientResourceStart", getRootElement(), function() local gTeam = getPlayerTeam(localPlayer) local StuntageTeam = getTeamFromName("Stuntage Arena") if ( gTeam and StuntageTeam and gTeam == StuntageTeam ) then bindKey("R","down", key) else unbindKey(source,"R","down", key) end end ) Anyway, can't you do like this? function name () if (isPedInVehicle (source)) then theVehicle = getPedOccupiedVehicle(source) fixVehicle(theVehicle) else cancelEvent() end end ) for k,v in ipairs (getElementsByType("players")) do bindKey(v, "R", down, name) end
  12. WhoAmI

    Jail system

    Use missiontimer resource. https://wiki.multitheftauto.com/wiki/Re ... ssiontimer
  13. Copy again. I tested it, and It works. addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then local x,y,z = getElementPosition(localPlayer) for k,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end )
  14. local x,y = guiGetScreenSize() local image = guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) guiMoveToBack(image)
  15. addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then local x,y,z = getElementPosition(localPlayer) for k,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end ) It works.
  16. Don't know if it will work, couse I didn't test it, but... addEventHandler( "onClientRender", root, function( ) local peds = getElementsByType("ped") if (#peds > 0) then for _,ped in ipairs(peds) do if (getElementData(ped, "robberped")) then local pX,pY,pZ = getElementPosition(ped) --ped's position local tX,tY,tZ = pX,pY,pZ+1 --text's position local x,y,z = getElementPosition(localPlayer) --player's position local maxDistance = 30 local distance = getDistanceBetweenPoints3D(x, y, z, tX, tY, tZ) if (distance <= maxDistance) then local wX, wY = getScreenFromWorldPosition(tX, tY, tZ) if (wX and wY) then dxDrawText("Robber Job", wX + 2, wY + 2, _, _, tocolor(0, 0, 0, 200), 2, "arial", "center", "center") dxDrawText("Robber Job", wX, wY, _, _, tocolor(0, 255, 0, 200), 2, "arial", "center", "center") end end end end end end ) And serverside function robberPed () local ped = createPed ( 19, 2054.4609375, -1760.5224609375, 13.546875 ) setElementData(ped, "robberped", true) setElementFrozen ( ped, true ) end addEventHandler ( "onResourceStart", resourceRoot, robberPed )
  17. Well, how did u defined 'p' in serverside script?
  18. WhoAmI

    help

    addCommandHandler("setexp", function(player,cmd,exp) local accountName = getAccountName ( getPlayerAccount ( player ) ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if not tonumber(exp) then return end setElementData(player, "exp", tonumber(exp)) end end)
  19. WhoAmI

    Clear Table

    myTable = {} is good.
  20. Ten skrypt jest ściśle powiązany z gamemodem. Między innymi kara blokady pm, postacie. Musiałbyś się pobawić, żeby to przerobić.
  21. Show how u defined 'p'.
×
×
  • Create New...