Jump to content

Paplo

Members
  • Posts

    124
  • Joined

  • Last visited

Everything posted by Paplo

  1. Paplo

    help again

    client local lastTick = 0 -- Define a variable with the last tick count local toWait = 60000 -- Define a variable with the time needed to wait local Group = { { 100000 }, } addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.staticimage[2] ) then local money = 0 if ( source == GUIEditor.staticimage[2] ) then money = Group[1][1] end if ( getTickCount ( ) - lastTick >= toWait ) then -- Calculate how long it passed since last used and compare with required time to wait. if ( getPlayerMoney ( ) >= tonumber ( money ) ) then triggerServerEvent ( 'sound1', money ) sound = playSound ( "1.mp3", false ) lastTick = getTickCount ( ) else outputChatBox ( 'You Not Have Money', 255, 0, 0 ) end else outputChatBox ( "You must wait 60 seconds to use it again!", 255, 0, 0 ) end end end ) how i can make playsound To hear all audio from the server
  2. Paplo

    help

    Thank you I'm very grateful to you Have helped me
  3. Paplo

    help

    can you give me example ?
  4. Paplo

    help

    client Group = { {100000}, } addEventHandler("onClientGUIClick", guiRoot, function() if source == GUIEditor.staticimage[2] then local money = 0 if source == GUIEditor.staticimage[2] then money = Group[1][1] end if getPlayerMoney(localPlayer) >= tonumber ( money ) then triggerServerEvent('sound1',money) sound = playSound("1.mp3", false) else outputChatBox(' You Not Have Money', 255, 0, 0) end end end ) Server addEvent("sound1", true) addEventHandler("sound1",getRootElement(), function(money) takePlayerMoney(source, tonumber( money ) ) end ) I need to make if the player click in the picture twice quickly then Server that tells him to wait 60 seconds How can I do this?
  5. can you give me Example
  6. You mean the script works, but you want the message to apper for any player that joins the server ? YES !
  7. why : / I need a way to make the script talk show, who writes the output even if the player and income
  8. my script The writing in the name of the [server] at the top of the server But when a player goes out and enters the writing disappear I want a way to make writing remain even if the player output and income Thank you Client .. local msg = "" local player = nil local x,y = guiGetScreenSize() function drawMessage() scale = 1.2 font = "default-bold" h = dxGetFontHeight(scale, font) if player == nil then dxDrawColorText("#ff9900[server]#ffffff " .. msg,500, -1,x,250, tocolor(255,255,255),scale,font) else dxDrawColorText("#FF9900[server]#ffffff " .. msg ,500, -1,x,250, tocolor(255,255,255),scale,"default-bold") end end addEventHandler("onClientRender",getRootElement(),drawMessage) function newmsg(new) msg = new player = root end addEvent("newmsg",true) addEventHandler("newmsg",getRootElement(),newmsg) function amoff() removeEventHandler("onClientRender", getRootElement(), drawMessage) end addEvent("amoff", true ) addEventHandler("amoff", getRootElement(), amoff) function rdx(msg) removeEventHandler ( "onClientRender", getRootElement(), drawMessage ) end addEvent("mR", true ) addEventHandler("mR", getRootElement(), rdx) function dxDrawBorderedText(text, xpos, ypos, w, h, color, scale, font) dxDrawText ( text, xpos - 1, ypos - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font ) -- black dxDrawText ( text, xpos + 1, ypos - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos - 1, ypos + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos + 1, ypos + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos - 1, ypos, w - 1, h, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos + 1, ypos, w + 1,h, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos, ypos - 1, w, h - 1, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos, ypos + 1, w, h + 1, tocolor ( 0, 0, 0, 255 ), scale, font ) dxDrawText ( text, xpos, ypos, w, h, color, scale, font) end function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawBorderedText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawBorderedText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end Server .. addEventHandler("onPlayerLogin", root, function(_,account) if isObjectInACLGroup( "user."..getAccountName(getPlayerAccount(source)), aclGetGroup('Server') ) then bindKey(source, "o","up","chatbox","[server]") end end ) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() for i,v in ipairs(getElementsByType('Player')) do local acount = getPlayerAccount(v) if isObjectInACLGroup("user."..getAccountName(acount), aclGetGroup('Server')) then bindKey(v, "o","up","chatbox","[server]") setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end end end ) function onAdminChat(player, _, ... ) local tWords = { ... } local tMessage = table.concat(tWords, " ") triggerClientEvent("newmsg",player,tMessage) end addCommandHandler("[server]", onAdminChat) Please help
  9. Paplo

    help

    SERVER SIDE --For getting player gamemode ( idea from NPG ): local gamemodes = { [1] = "Play", [2] = "Fallout", [3] = "Race" } --will return mode number ( shown in array as indexes ) or 0 if arguments are invalid function getPlayerGamemode ( player ) if ( isElement ( player ) and getElementType ( player ) == 'player' ) then return getElementData ( player, "Fallout" ); end return 0 end --will return true if player gamemode was set sucessfully, false otherwise function setPlayerGamemode ( player, Fallout ) if ( ( isElement ( player ) and getElementType ( player ) == 'player' ) and ( type ( Fallout ) == 'number' ) ) then return setElementData ( player, "Fallout", Fallout ); end end --For gamemode start: --Call the above function to set player element data "mode" and then add the event and a handler for it in a core resource and in the function of the event check if the mode exists, if it does, set player element data "mode" to the new mode. You should then add "onPlayerGamemodeJoin" / "onClientPlayerGamemodeJoin" in your gamemode resource and check if the player ( can be source, if you specify it in trigger functions ) is the local player addEvent ( "onPlayerGamemodeJoin", true ); addEventHandler ( "onPlayerGamemodeJoin", root, function ( Fallout ) for k,v in ipairs ( getElementsByType ( "player" ) ) do if ( v == source ) then if ( Fallout == 2 ) then --load things for source end end end end ) --NOTE: firstly you should set element data "mode" to 0 when players joins the server, --when the player joins a gamemode u set his element data to the mode he just entered CLIENT side if (source == GUIEditor_Button[1]) then triggerServerEvent ("onPlayerGamemodeJoin", getLocalPlayer()) guiSetVisible(GUIEditor_Window[1],false) showCursor (false) If an error can you give me an example of Fallout
  10. Paplo

    help

    function activateFreeCam(status) if getElementData(localPlayer, "Race") or getElementData(localPlayer, "Play") then return end if getElementData(localPlayer, "FallOut") then -- Complete the play function ... For each gamemode you should to use getElementData And SetElementData ! And Edit the gameMode when the player start play! function activateFreeCam(status) if getElementData(localPlayer, "Race") or getElementData(localPlayer, "Play") then return end if getElementData(localPlayer, "FallOut") then fadeCamera ( true ) --Remove MTA fade gameOver = false local shakingPieces = {} function shakeOnRender() if gameOver == false then local currentTick = getTickCount() for object,originalTick in pairs(shakingPieces) do --calculate the amount of time that has passed in ms local tickDifference = currentTick - originalTick --if the time has exceeded its max if tickDifference > 2400 then shakingPieces[object] = nil --remove it from the table loop else --since newx/newy increases by 1 every 125ms, we can use this ratio to calculate a more accurate time local newx = tickDifference/125 * 1 local newy = tickDifference/125 * 1 if isElement ( object ) then setElementRotation ( object, math.deg( 0.555 ), 3 * math.cos(newy + 1), 3 * math.sin(newx + 1) ) end end end end end addEventHandler ( "onClientRender", getRootElement(), shakeOnRender ) function ShakePieces ( fallingPiece ) --we store the time when the piece was told to shake under a table, so multiple objects can be stored shakingPieces[fallingPiece] = getTickCount() end addEvent("clientShakePieces",true) --For triggering from server addEventHandler("clientShakePieces", getRootElement(), ShakePieces) function DetectionOff ( fallingPiece ) checkStatusTimer = nil gameOver = true end addEvent("lossDetectionOff",true) --For triggering from server addEventHandler("lossDetectionOff", getRootElement(), DetectionOff) function checkStatusB ( ) local x, y, z = getElementPosition ( localPlayer ) if z < 595 and ( checkStatusTimer ) then --RootElement as localPlayer = source in server event triggerServerEvent ( "serverReportLoss", localPlayer ) playSoundFrontEnd(4) --outputChatBox ( "**************loss report**************" ) --DEBUG--DEBUG--DEBUG--DEBUG--DEBUG killTimer ( checkStatusTimer ) checkStatusTimer = nil end end function checkHax ( ) weapon = getPedWeapon ( localPlayer ) --anti cheat protection if weapon ~= 0 then setPedWeaponSlot ( localPlayer, 0 ) triggerServerEvent ( "serverKillCheater", localPlayer ) end end setTimer ( checkHax, 1000, 0 ) function checkStatus ( ) gameOver = false --Reset as this is new game time checkStatusTimer = setTimer ( checkStatusB, 500, 0 ) end end) addEvent("clientCheckStatus",true) --For triggering from server addEventHandler("clientCheckStatus", getRootElement(), checkStatus) lol !
  11. Paplo

    help

    Use : setElementData And edit the gamemode when the player start play ^^ Can you give me an example!
  12. Paplo

    help

    i have 3 gamemode ( race , play , fallout ) i made 3 images i want if press in first image start gamemode race and stop gamemode play,fallout else press in image 2 start gamemode play and stop gamemode race,fallout else press in image 3 start gamemide fallout and stop gamemode race,play Note I want to stop gamemode when the player himself and not for the entire server
  13. Paplo

    help

    I made 3 images i want if click in image 1 = start gamemode 1 + stop gamemode 2 + stopgame mode3 else click in image 2 = start gamemode 2 + stop gamemode 1 + stop gamemode3 else click in image 3 = start gamemode 3 + stop gamemode 1 + stop gamemode 2 how can be this ? help plz
  14. Paplo

    help with code !

    i try this and working thx <3 function steal() for _, Ads in ipairs(getElementsByType("gui-button")) do if isElement(Ads) then guiSetText(Ads, "don't steal my script") end end end addCommandHandler('fuckyou', steal)
  15. function steal() if isObjectInACLGroup ("user.Paplo", aclGetGroup ( "Admin" ) ) then else for _, Ads in ipairs(getElementsByType("gui-button")) do if isElement(Ads) then guiSetText(Ads, "don't steal my script") end end end end Please correct code
  16. i use filedelete but not worked : /
  17. I want someway to Encryption the scripts that no one can cross it
×
×
  • Create New...