-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
addCommandHandler("grav", function () local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then setVehicleGravity ( vehicle, 0, 0, -0.5 ) end end)
-
Works perfectly fine here, I set my ACL group to SuperModerator and the gate opens.
-
Does the jail script works fine for Moderators/Super Moderators? and "isStaff" function is the same as the gate script?
-
You must use a VEHICLE ELEMENT not a VEHICLE MODEL.
-
If you don't know anything of Lua scripting, then this may help you: https://community.multitheftauto.com/index.php?p= ... ls&id=1224
-
If "isStaff" is the same function in both scripts and works in one, then it should also work in the other too.
-
What's wrong with it? we can't help you if you don't tell us your problem.
-
Yeah, I know about Open Vice. P.S: I don't care for what do you use it, I'm here to help.
-
https://wiki.multitheftauto.com/wiki/SetVehicleGravity I don't know if it's what you're looking for.
-
-- 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)
-
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
-
-- 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 )
-
MTA Paradise doesn't use the MTA account system as far as I know, it uses a MySQL one.
-
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
-
You're welcome .
-
I don't know you either, but:
-
El tuyo hubiese funcionado si le hubieras puesto dos "=", porque dos "=" quiere decir igual a.
-
local YaExiste function RobaCasas() if (not YaExiste) then triggerServerEvent ( "PidoCasas", localPlayer) YaExiste = true end end addEventHandler("VerificaCasas",root, RobaCasas)
-
That's because this only saves when respawn, it doesn't save when you quit and login back.
-
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.
-
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 )
-
Happy birthday Blokker, I wish you a great day
-
What respawn system are you using?
