Jump to content

Klesh

Members
  • Posts

    306
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Klesh

  1. addEventHandler("onPlayerLogin", getRootElement(), function () playSound("sounds/login.mp3") -- That will play the sound when player login. setSoundVolume(0.9) end) addEventHandler("onResourceStart", getRootElement(getThisResource()), function () createPed ( skin, x, y, z) --x, y, z are the coords where will be created the ped, the skin is the skin id will be created end) You can see : Skins ids on https://wiki.multitheftauto.com/wiki/Character_Skins
  2. What you put in meta? Server side or client side?
  3. addEventHandler( "onPlayerChat", getRootElement(), function (messageType) if messageType == 0 then outputChatBox("Sorry you cant use this chat, use team chat.", source, 255, 0, 0) cancelEvent() end end)
  4. You can delete maps with this resource, https://community.multitheftauto.com/index.php?p=resources&s=details&id=2091, don`t forget to add it to acl group admin.
  5. That's completely useless, you can kick once if you are in Admin group, if you dont know how to set it go to https://wiki.multitheftauto.com/wiki/ACL, you dont need to script that.
  6. Klesh

    Fixing help

    function vehFix ( thePlayer) theVehicle = getPedOccupiedVehicle ( thePlayer )--Checks if the player is in the vehicle. if (theVehicle) then --If it is in the vehicle fix it fixVehicle(theVehicle) end end addEventHandler("onVehicleDamage",getRootElement(),vehFix)-- Turining on vehFix when vehicle crash setTimer(vehFix, 1000, 1) -- Will be fix the vehicle every second.
  7. You must to bind a key to toggle it. function () bindKey("m", "down", replace) end
  8. Klesh

    Help me!

    My code didn't work? Test it.
  9. function kickPlayerHandler (player,cmd,kickedname) if not (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler)
  10. Klesh

    Help me!

    addEventHandler("onPlayerVehicleEnter", getRootElement(), function (thePlayer) if (getPedOccupiedVehicle(thePlayer) then theVehicle = getPedOccupiedVehicle(player) addVehicleUpgrade(theVehicle, 1010) end end)
  11. addCommandHandler ("kill", function (thePlayer) if (thePlayer) then setElementFrozen (thePlayer, true) setTimer (killPed, 10000, 1, thePlayer) outputChatBox("You will be killed in 10 seconds.", thePlayer, 255, 0, 0) end end) function unfrozen() setElementFrozen (thePlayer, false)--This returns the player to his normal state end addEventHandler("onPlayerSpawn", getRootElement(), unfrozen) That will prevent's to you to getfrozen player before get killed.
  12. Cuz i fixed later, the code you copy is the old one!
  13. I didn't see setElementFrozen, where is it? Also, the code was fixed, see again.
  14. Did you update your mta ?? Cuz if you didn't maybe need to check the new one : https://nightly.multitheftauto.com/
  15. function killMe (thePlayer) outputChatBox("You will be killed in 10 seconds.", thePlayer, 255, 0, 0) setTimer(function(thePlayer) killPed(thePlayer) end, 10000, 1) end addCommandHandler ("kill", killMe) setTimer (killMe, 1000, 1)
  16. Klesh

    function ()

    Thanks for making that edited code.
  17. Klesh

    function ()

    Do you mean set a timer warining to to warn the player, empty vehicles will be respawned? Also, i must set the timer with it?
  18. Klesh

    function ()

    Like always i have little but big mistakes, thanks a lot.
  19. Klesh

    function ()

    local rElement = getRootElement() function respawnVehicles(player) outputChatBox("*In 60 seconds the system will returns the empty vehicles to the start.", rElement, 0, 220, 20, true) setTimer(function (player) local vehicles = getElementsByType ( "vehicle" ) outputChatBox("*Empty Vehicles has been respawned.", rElement, 0, 220, 20, true) outputDebugString(getPlayerName(player) .. " respawned vehicles.") for k, vehicle in ipairs ( vehicles ) do if isEmpty( vehicle ) then respawnVehicle ( vehicle ) end end end,180000, 0) end addEventHandler("onResourceStart", getRootElement(getThisResource()), respawnVehicles) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end Why dont work.
  20. Klesh

    function ()

    Hello, how i can set every time a function, for example i have a respawn vehicle script but i want to set it every 1 hour by itselft, setTimer dont work for it, added addEventHandler("onResourceStart", getRootElement(getThisResource()),respawnVehicles) setTimer(1800000, 1, respawnVehicles) No works, only works when the resource starts. Any recomendation?
  21. Width doesn't change any space betwen the name and the weapon image.
  22. Hello, im make my killmessages in hexadecimal color but the problem is the space beetwen name and weapon image, i was looking and testing codes and i found something, this is the cause of why that space myText2 = string.gsub(myText, "#%x%x%x%x%x%x", "") There is some way to delete that space?
  23. What you change cuz my textlib is edited.
  24. Klesh

    drawColor

    Alredy fixed by my own, but thanks.
  25. Hello, i was asking where i can change the horizontal align, cuz i make a edited killmessages but the name is far of the weapon image.
×
×
  • Create New...