Jump to content

Chaos

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by Chaos

  1. Chaos

    Ping 0

    function packetLossCheck() local loss = getNetworkStats() ["packetlossLastSecond"] if(loss > 0) then outputChatBox ("Packet loss detected when communicating with server, gameplay may be affected", 255, 0, 0) end end setTimer(packetLossCheck, 1000, 0) is that what i need it?
  2. Chaos

    Ping 0

    I heard there is such a bug in MTA, but it happens very often in my Server. Sometimes player gets timed out, but he is still in the Server. He has 0 ping and only kicking him helps. What is causing this problem and how can i fix it?
  3. works perfect thank you bro :3 but the time will starts from the beginning if the player reconnect if he muted ?
  4. i really need help pleaseee
  5. yes thanks it works but the problem when the timer of mute is finished then when the player is reconnect he will return muted also i can't put space with reason
  6. hi, i have some bugs with this code 1.when the timer of mute is finished then when the player is reconnect he will return muted 2.i can't put space with reason 3.there is no outputchatbox when the timer is finished here is the script: local mutedSerials = { } function muteSomeone ( player, cmd, target, reason, time ) if ( target and reason and time ) then local target = getPlayerFromNamePart ( target ) if ( not isElement ( target ) ) then outputChatBox ( "There is no player with this name", player, 255, 255, 0 ) return end local time = tonumber ( time ) if ( time and time >= 1 and not isPlayerMuted ( target ) ) then local milliseconds = math.floor ( time * 60000 ) outputChatBox ( getPlayerName ( target ) .." has been muted for ".. tostring ( time ) .." minutes (".. reason ..") .", root, 255, 0, 0 ) setPlayerMuted ( target, true ) setTimer ( setPlayerMuted, milliseconds, 1, target, false ) mutedSerials [ getPlayerSerial ( target ) ] = milliseconds else outputChatBox ( "Syntax: /mmute player reason time and player cannot be muted", player, 255, 255, 0 ) end end end addCommandHandler ( "mmute", muteSomeone ) function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end function afterreconnect () local milliseconds = mutedSerials [ getPlayerSerial ( source ) ] if ( milliseconds ) then setPlayerMuted ( source, true ) setTimer ( setPlayerMuted, milliseconds, 1, source, false ) else setPlayerMuted ( source, false ) end end addEventHandler ( "onPlayerJoin", getRootElement(), afterreconnect )
  7. that's just an example the chatbox it is not my problem
  8. Chaoshas got :108213 [uST]XxJaviNpxX: dime Chaos: type /checkMoney Chaos: type /checkMoney Chaos: type /checkMoney rulocardenas: oye espera a que se junten muchos [uST]XxJaviNpxXhas got :406 [uST]XxJaviNpxX: ya [uST]XxJaviNpxX: pero quiero un arma o algo look here when i did /checkMoney the timer only works for me but when the other type /checkMoney the timer won't works for him i don't want the time only for the player who did it i need to all should wait example when i type /checkmoney then all must wait 30 secs not only me and not only who did the command
  9. this will be for all commands ?
  10. it's compiled and not helping
  11. i don't want to kick the player and i want all players should waiting 30 secs if the command activated
  12. hi, i need when someone do /checkMoney then all players should have to wait 30 secs to use the command again function checkMoney(thePlayer, command) local money = getPlayerMoney(thePlayer) outputChatBox(getPlayerName (thePlayer).. "has got :" .. tostring(money), root,0,255,0) end addCommandHandler("checkMoney", checkMoney)
  13. i'm plan to make a marker is that possible? addEvent ( "test", true ) addEventHandler ( "test", getRootElement(), function( ) local x, y, z = getElementPosition ( source ) local theMarker = createMarker ( x , y , z, "cylinder", 2, 0, 0, 0, 0 ) addEventHandler( "onMarkerHit", theMarker, antizombies ) end) function antizombies(h) if not isElement(h) then return end if getElementData(h,"zombie") then killPed(h) end end
  14. Chaos

    convertNumber

    thanks TAPL and MIKI785
  15. Chaos

    convertNumber

    oh thanks but how to add $ with number ?
  16. onClientPlayerDamage and setElementHealth works fine but onClientPlayerStealthKill not working
  17. function stopDamage ( ) addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), stopMinigunDamage ) end function stopMinigunDamage() player = getLocalPlayer() setElementHealth (player,getElementHealth (player) +100) cancelEvent () end correct?
  18. Chaos

    convertNumber

    where should i add it ?
  19. Chaos

    convertNumber

    hi, how to use that function convertNumber with money scoreboard ?? exports [ "scoreboard" ]:addScoreboardColumn ( "Money", 3 ) -- Add the "Money" column to the scoreboard. function updatePlayersMoney ( ) -- Create "updatePlayersMoney" function. for index, player in ipairs ( getElementsByType "player" ) do -- Loop through all online players. setElementData ( player, "Money", getPlayerMoney ( player ) ) -- Set "Money" element data to the player money. end -- End our loop. end -- End our function. setTimer ( updatePlayersMoney, 2500, 0 ) -- Set a infinite 2.5 seconds timer to execute "updatePlayersMoney" function.
×
×
  • Create New...