Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I said, don't put target with quotes like you did here: local target = getPlayerNameFromNamePart("target") Should be:: local target = getPlayerFromNamePart ( target )
  2. No, you are using "getPlayerNameFromNamePart" which isn't the correct name, use "getPlayerFromNamePart" and don't put target with quotes.
  3. No, you messed everything up, just copy the source code from the wiki and use the new function name, not hard to understand.
  4. Copy the source code from the wiki and then replace "getPlayerFromName" on your code with "getPlayerFromNamePart".
  5. https://wiki.multitheftauto.com/wiki/Ge ... omNamePart
  6. Take a screenshot of the resources folder.
  7. I mean, in which form? did you touch anything? because is saying it can't find the meta.xml of them.
  8. Now you removed the line that mutes the player... also, why is there a bracket at the end of setTimer?
  9. Because you forgot about the setTimer part.
  10. function afterreconnect (source) Remove "source" from there.
  11. Remove that "target" from "afterreconnect" function name, and replace it with 'source' on the setPlayerMuted/getPlayerName functions. You also forgot a ")" to close the event handler.
  12. --Global: local mutedSerials = { } --When you mute: mutedSerials [ getPlayerSerial ( target ) ] = milliseconds --When join: local milliseconds = mutedSerials [ getPlayerSerial ( source ) ] if ( milliseconds ) then -- You mute him again. end
  13. Castillo

    LUA Help.

    local lp = getLocalPlayer ( ) sx, sy = guiGetScreenSize () win = guiCreateWindow( ( sx / 2 - 524 / 2 ), ( sy / 2 - 320 / 2 ), 524, 320, "Car Options", false) buttonOne = guiCreateButton(72, 98, 119, 66, "Engine", false, win) buttonTwo = guiCreateButton(309, 99, 119, 66, "Lights", false, win) buttonThree = guiCreateButton(500, 23, 15, 15, "X", false, win) buttonFour = guiCreateEdit(142, 240, 263, 29, "", false, win) buttonFive = guiCreateLabel(67, 246, 75, 15, "License Plate:", false, win) buttonSix = guiCreateButton(405, 240, 59, 31, "Set", false, win) buttonSeven = guiCreateLabel(148, 271, 219, 32, "Maximum 8 characters\nSetting your license plate costs $1000.", false, win) buttonEight = guiCreateButton(200, 165, 99, 52, "Lock", false, win) guiSetVisible(win,false) bindKey ( "f2", "down", function ( ) if ( isPedInVehicle ( lp ) == false or getVehicleController ( getPedOccupiedVehicle ( lp ) ) ~= lp ) then return end local tostate = not guiGetVisible ( win ) guiSetVisible ( win, tostate ) showCursor ( tostate ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == buttonThree ) then guiSetVisible ( win, false ) showCursor ( false ) elseif ( source == buttonSix ) then local veh = getPedOccupiedVehicle ( lp ) if ( veh ) then triggerServerEvent ( "onVehicleLisenceChange", lp, guiGetText ( buttonFour ) ) end elseif ( source == buttonEight ) then executeCommandHandler ( "lock" ) elseif ( source == buttonOne ) then if ( isVehicleDamageProof ( theVehicle ) ) then return end guiSetEnabled ( buttonOne, false ) setTimer ( guiSetEnabled, 2000, 1, buttonOne, true ) local veh = getPedOccupiedVehicle ( lp ) if ( veh and getVehicleController ( veh ) == lp ) then local state = not getVehicleEngineState ( veh ) setVehicleEngineState ( veh, state ) if ( state ) then playSound ( "start.mp3" ) outputChatBox ( "You have started your car's engine.", 231, 0, 0 ) else playSound ( "stop.mp3" ) outputChatBox ( "You have stopped your car's engine.", 231, 0, 0 ) end end elseif ( source == buttonTwo ) then triggerServerEvent ( "onVehicleLightStateChange", lp ) elseif ( source == buttonSix ) then local text = guiGetText ( butonFour ) local veh = getPedOccupiedVehicle ( lp ) if ( veh ) then triggerServerEvent ( "onVehicleLisenceChange", lp, guiGetText ( buttonFour ) ) end end end ) addEvent ( "onVehicleLightStateChange", true ) addEventHandler ( "onVehicleLightStateChange", root, function ( state, x, y, z ) if ( state ) then SoundPath = "on.mp3" else SoundPath = "on.mp3" end playSound3D ( "on.mp3", x, y, z ) end )
  14. You can store the serials of each player on a table and the time he's muted for, then when they join, check if the serial is on that table.
  15. function muteSomeone ( player, cmd, target, reason, time ) if ( target and reason and time ) then local target = getPlayerFromName ( 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 ) else outputChatBox ( "Syntax: /mmute player reason time and player cannot be muted", player, 255, 255, 0 ) end end end addCommandHandler ( "mmute", muteSomeone )
  16. Seems like you messed up everything, all resources aren't working.
  17. Castillo

    help

    Have you tried restarting MTA?
  18. No offense, but why would anyone just join some random clan?
  19. You can steal the client side scripts, which are downloaded to the player hard drive, but without the server side, they can't do anything on most cases.
  20. Hi. So, I'm creating this topic because we've been having some weird issues since couple of months at my server, the problems are that the colshapes, markers/peds randomly dissapear/change position or get destroyed, I first thought it was one of our scripts, but it's really unlikely, so I would like to know if anyone else has been having these kind of problems at their server. Thanks for your time. Please, if you have no idea what is this about, don't even reply.
  21. Castillo

    help

    You're welcome.
  22. Kingdoms of Amalur Reckoning No es igual que Skyrim, pero esta bueno.
  23. Castillo

    help

    Yes, my bad, I didn't notice that.
×
×
  • Create New...