Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. addCommandHandler("grav", function () local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then setVehicleGravity ( vehicle, 0, 0, -0.5 ) end end)
  2. Castillo

    staff

    Works perfectly fine here, I set my ACL group to SuperModerator and the gate opens.
  3. Castillo

    staff

    Does the jail script works fine for Moderators/Super Moderators? and "isStaff" function is the same as the gate script?
  4. You must use a VEHICLE ELEMENT not a VEHICLE MODEL.
  5. If you don't know anything of Lua scripting, then this may help you: https://community.multitheftauto.com/index.php?p= ... ls&id=1224
  6. Castillo

    staff

    If "isStaff" is the same function in both scripts and works in one, then it should also work in the other too.
  7. Castillo

    staff

    What's wrong with it? we can't help you if you don't tell us your problem.
  8. Yeah, I know about Open Vice. P.S: I don't care for what do you use it, I'm here to help.
  9. https://wiki.multitheftauto.com/wiki/SetVehicleGravity I don't know if it's what you're looking for.
  10. -- client side: myPed = createPed(0, 0, 0, 3) function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (element == myPed) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(myGUIWindow, true) end end end end addEventHandler("onClientClick", root, onPedClick)
  11. Ok, I found out what was my problem, I put "temWeapons", I forgot the "P" for "temp". I also added now to save after quit and give them back after login. local spawnpoint addEventHandler("onResourceStart", resourceRoot, function() spawnpoint = getRandomSpawnPoint() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function onPlayerLogin() outputChatBox ( "Welcome to Zer0w's server" , source, 0, 159, 255 ) local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local playerMoney = tonumber(getAccountData(playerAccount, "money")) local playerSkin = tonumber(getAccountData(playerAccount, "skin")) if (playerMoney and playerSkin) then setPlayerMoney(source, playerMoney) setElementModel(source, playerSkin) end local playerWeapons = getAccountData(playerAccount, "weapons") if (playerWeapons and playerWeapons ~= "") then giveWeaponsFromJSON(source, playerWeapons) end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) function spawn(player) if not isElement(player) then return end if get("spawnreset") == "onSpawn" then spawnpoint = getRandomSpawnPoint() end exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) setElementModel(player, tonumber(getElementData(player,"tempSkin")) or math.random(312)) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) local weapons = getElementData(player,"tempWeapons") giveWeaponsFromJSON(player, weapons) end function getRandomSpawnPoint () local spawnpoints = getElementsByType("spawnpoint") return spawnpoints[math.random(1,#spawnpoints)] end addEventHandler("onPlayerJoin", root, function() spawnPlayer (source, -1969.2669677734, 137.71185302734, 30, 0, 0, 0) fadeCamera (source, true) setCameraTarget ( source, source ) spawn(source) end ) addEventHandler("onPlayerQuit",root, function () if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then spawnpoint = getRandomSpawnPoint() end local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local playerMoney = getPlayerMoney(source) local playerSkin = getElementModel(source) setAccountData(playerAccount, "money", playerMoney) setAccountData(playerAccount, "skin", playerSkin) local weapons = convertWeaponsToJSON(source) setAccountData(playerAccount, "weapons", weapons) end end ) addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempSkin",getElementModel(source)) setElementData(source,"tempWeapons",weapons) setTimer(spawn, 1800, 1, source) end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end
  12. -- client side: triggerServerEvent ("rankTab",getLocalPlayer()) -- This will trigger so it get's the rank and set element data, don't trigger it in the event "onClientRender", it must be outside. if NAMETAG_BAR_FRAME == 1 then local nameimage = "rank" local rank = getElementData(localPlayer,"rank") if (not fileExists(":race/img/"..rank..".png")) then return end dxDrawImage(drawX-1, drawY-1, width+2, height+2, ":race/img/"..rank..".png") end -- server side: addEvent("rankTab", true) addEventHandler("rankTab", root, function() local account = getPlayerAccount(source) local rank = getAccountData(account, "rank") setElementData(source,"rank",tostring(rank)) end )
  13. MTA Paradise doesn't use the MTA account system as far as I know, it uses a MySQL one.
  14. We don't accept requests here, you either have to pay someone to do it or you can learn how to do it by your own. https://wiki.multitheftauto.com/wiki/Scr ... troduction https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  15. El tuyo hubiese funcionado si le hubieras puesto dos "=", porque dos "=" quiere decir igual a.
  16. local YaExiste function RobaCasas() if (not YaExiste) then triggerServerEvent ( "PidoCasas", localPlayer) YaExiste = true end end addEventHandler("VerificaCasas",root, RobaCasas)
  17. That's because this only saves when respawn, it doesn't save when you quit and login back.
  18. That resource has a lot of errors and deprecated functions, I would suggest to create your own from scratch other than try to fix it. P.S: I think I had almost everything fixed on it long time ago, but I think I have deleted the files.
  19. Ok, then, try this: local spawnpoint addEventHandler("onResourceStart", resourceRoot, function() spawnpoint = getRandomSpawnPoint() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function joinHandler ( ) spawnPlayer (source, -1969.2669677734, 137.71185302734, 30, 0, 0, 0) fadeCamera (source, true) setCameraTarget ( source, source ) end addEventHandler ( "onPlayerJoin" , getRootElement ( ) , joinHandler ) function greetPlayer ( ) outputChatBox ( "Welcome to Zer0w's server" , source, 0, 159, 255 ) end addEventHandler ( "onPlayerLogin", getRootElement(), greetPlayer ) function onPlayerQuit() local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local playerMoney = getPlayerMoney(source) local playerSkin = getElementModel(source) setAccountData(playerAccount, "money", playerMoney) setAccountData(playerAccount, "skin", playerSkin) end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) function onPlayerLogin() local playerAccount = getPlayerAccount(source) if (playerAccount) and not isGuestAccount(playerAccount) then local playerMoney = tonumber(getAccountData(playerAccount, "money")) local playerSkin = tonumber(getAccountData(playerAccount, "skin")) if (playerMoney and playerSkin) then setPlayerMoney(source, playerMoney) setElementModel(source, playerSkin) end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) function spawn(player) if not isElement(player) then return end if get("spawnreset") == "onSpawn" then spawnpoint = getRandomSpawnPoint() end exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) setElementModel(player, tonumber(getElementData(player,"tempSkin"))) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) local weapons = getElementData(player,"tempWeapons") if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end function getRandomSpawnPoint () local spawnpoints = getElementsByType("spawnpoint") return spawnpoints[math.random(1,#spawnpoints)] end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerQuit",root, function () if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then spawnpoint = getRandomSpawnPoint() end end ) addEventHandler("onPlayerWasted", root, function() weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end setElementData(source,"tempSkin",getElementModel(source)) setElementData(source,"temWeapons",toJSON(weaponsTable)) setTimer(spawn, 1800, 1, source) end )
  20. Happy birthday Blokker, I wish you a great day
  21. What respawn system are you using?
×
×
  • Create New...