Jump to content

Negriukas

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by Negriukas

  1. Hello people, I recently made a ranking system but it's kinda messed up it does play sound when player login is it possible to cancel it? Server function outputChange(dataName,oldValue) if getElementType(source) == "player" and dataName == "Army.rank" then local newValue = getElementData(source,dataName) outputChatBox("Congratulations your rank now is #FFFFFF'"..tostring(newValue).."'",source, 255, 0, 0, true) triggerClientEvent(source, "onRankUp", source) end end addEventHandler("onElementDataChange",getRootElement(),outputChange) Client local sx, sy = guiGetScreenSize ( ) function onRankUpGreet() dxDrawRectangle(sx*(707/1024), sy*(425/768), sx*(115/1024), sy*(27/768), tocolor(44, 44, 44, 221), true) dxDrawText("Rank up+", sx*(716/1024), sy*(429/768), sx*(808/1024), sy*(448/768), tocolor(0, 255, 0, 221), 0.70, "bankgothic", "left", "top", false, false, true, false, false) end function onRankUp( killer ) local sound = playSound("sounds/level.mp3") setSoundVolume(sound, 50) setSoundMaxDistance( sound, 5000 ) addEventHandler("onClientRender", root, onRankUpGreet) setTimer( function () removeEventHandler ( "onClientRender", root, onRankUpGreet ) end, 6000, 1) end addEvent( "onRankUp", true ) addEventHandler( "onRankUp", getRootElement(), onRankUp ) P.S: My ranking script is working perfectly and no need to post it, It's a hard work though i dont want other get to it, Thanks in advance.
  2. Negriukas

    Scoreboard

    Hello, I'm using dx scoreboard (mta sa one) and i'm trying to mix fps column and ping column in one column, and i'm asking if it's possible to mix 2 element datas into 1 column like example Image and text? Thanks in advance
  3. No not working, pls help
  4. Another problem is showing up, I guess it's the second argument of outputChatBox in line 13
  5. It's clear -.- WARNING: client.lua:15: Bad 'sound/player' pointer @ 'setSoundPaused'(1) WARNING: client.lua:24: Bad argument @ 'stopSound' [Expected sound at argument 1, got nil]
  6. WARNING: client.lua: Bad 'sound/player' pointer @ 'setSoundpaused'(1) WARNING: client.lua: Bad argument @ 'stopSound' [Expected sound at argument 1, got nil]
  7. Negriukas

    Givemoney

    Hi, When i try to send someone money it doesnt output in chat box the text for the local player, but the target player can see the output, It suppose to write in chatbox ("You gave "..money.." to "..getPlayerName(targetPlayer)", source, r, g, b) The problem is that the target player can recieve the text of the money but who send money it doesnt output nothing, here is the code function giveSomeoneMoney(player, cmd, target, amount) if target then if amount then local money = getPlayerMoney(player) local targetplayer = getPlayerFromParticalName(target) local r,g,b = getPlayerNametagColor(source) amount = tonumber(amount) if targetplayer then if money >= amount then givePlayerMoney(targetplayer, amount) takePlayerMoney(player, amount) outputChatBox("You have been given #00FF00$"..amount.." #0096FF from #FFFFFF"..getPlayerName(player) , targetplayer, 0, 81, 255, true) outputChatBox("You gave #00FF00$"..amount.."#0096FF to #FFFFFF"..getPlayerName(target), player, 0, 81, 255, true) else outputChatBox("You don't have enought money!", player, 255, 0, 0) end else outputChatBox("Error: Player not found", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end else outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) end end addCommandHandler("givemoney", giveSomeoneMoney) function getPlayerFromParticalName(thePlayerName) local 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 return false end
  8. Row == 0 to get the first row row == 1 to get the second row, etc..
  9. Negriukas

    MP3 Panel

    Hello people, I'm make this mp3 panel just testing but it seems that it doesn't work, I tried with debugscript 3 to see if there are any errors, but nothing, here is my code, The playing sound part is working but Pausing it or Stopping it doesnt work. Client: function playOne() if source == music.Button[3] then local row = guiGridListGetSelectedItem(music.Gridlist[1]) if row == 0 then local currentPlaying = playSound("sounds/nwa.mp3") setSoundVolume(currentPlaying, 0.5) end end end addEventHandler("onClientGUIClick", guiRoot, playOne) function pauseOne() if source == music.Button[2] then if row == 0 then setSoundPaused(currentPlaying, true) end end end addEventHandler("onClientGUIClick", guiRoot, pauseOne) function stopOne() if source == music.Button[1] then if row == 0 then stopSound(currentPlaying) end end end addEventHandler("onClientGUIClick", guiRoot, stopOne) local currentlyPlaying function playSec() if source == music.Button[3] then local row = guiGridListGetSelectedItem(music.Gridlist[1]) if row == 1 then local currentlyPlaying = playSound("sounds/tremor.mp3") setSoundVolume(currentlyPlaying, 0.5) end end end addEventHandler("onClientGUIClick", guiRoot, playSec) function pauseSec() if source == music.Button[2] then if row == 1 then setSoundPaused(currentlyPlaying, true) end end end addEventHandler("onClientGUIClick", guiRoot, pauseSec) function stopSec() if source == music.Button[1] then if row == 1 then stopSound(currentlyPlaying) end end end addEventHandler("onClientGUIClick", guiRoot, stopSec)
  10. Can you help me with code pls? i am new to this scriptin and i used some codes from https://wiki.multitheftauto.com
  11. Hello guys, I'm new here, so i'm trying to do the following; Open the gate only for a specified team called "Army" Open the gate and close it with the same command. but i failed i have no idea what's wrong gate1 = createObject ( 980, -579.5, -189.7, 80, 0, 0, 90 ) function openMainGate(thePlayer) if getTeamName(getPlayerTeam(thePlayer)) == "Army" then if getElementPosition(gate1, -579.5, -189.7, 80 ) then moveObject (gate1, 3000, -579.5, -179.7, 80 ) else moveObject (gate1, 3000, -579.5, -189.7, 80 ) end end end addCommandHandler("main", openMainGate)
×
×
  • Create New...