
myonlake
Members-
Posts
2,312 -
Joined
-
Days Won
41
Everything posted by myonlake
-
What's the problem with it? I have found it working pretty well?
-
@Stanley: As the others already said, show us the latest version of your .map and .lua file(s).
-
Use setVehicleHandling to edit speed. .. EDIT YOUR OLD MSGS!!!
-
Try this. function arrest(attacker, weapon, bodypart, loss) local playerTeam = getPlayerTeam(source) if (playerTeam == "Police") then if (getPlayerWantedLevel(source) > 0) then if (weapon == 3) then local ax, ay, az = getElementPosition(attacker) local cx, cy, cz = getElementPosition(source) local d = getDistanceBetweenPoints3D(ax, ay, az, cx, cy, cz) arrestMarker = createMarker(1542.39966, -1675.01782, 13.55443, "cylinder", 2.5, 255, 255, 0, source) toggleAllControls(source, false) addEventHandler("onMarkerHit", arrestMarker, mhit) if (d > 10) then setElementPosition(attacker, cx - 5, cy, cz) end end end end end addEventHandler("onPlayerDamage", root, arrest) function mhit(hitElement, matchingDimension) if getElementType(hitElement) == "player" then local playerTeam = getPlayerTeam(hitElement) if (playerTeam == "Police") then if (getPlayerWantedLevel(hitElement) > 0) then setElementInterior(hitElement, 6) setElementPosition(hitElement, 264.74969, 77.49036, 1001.03906) end end end end
-
You only have a GUI there, nothing else. Please, try to make functions yourself aswell.
-
You didn't even try to find it out... function turn(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) local rX, rY, rZ = getVehicleRotation(vehicle) if (not vehicle) then return end local speedx, speedy, speedz = getElementVelocity(vehicle) local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 local mph = actualspeed * 111.847 setElementRotation(vehicle, rX, rY, rZ + 180) outputChatBox("You turned your vehicle with " .. tostring(kph) .. " km/h | " .. tostring(mph) .. " mph", thePlayer) end function bindTheKey() for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn) outputChatBox("#00FF00You can now press #0000FF'left ctrl' #00FF00in vehicle to turn for 180 degrees!", player, 255, 255, 255, true) end end addEventHandler("onResourceStart", resourceRoot, bindTheKey) addEventHandler("onPlayerJoin", root, function() bindKey(source, "lctrl", "down", turn) end)
-
You have no table "players" in your database. And the sky is because you don't possibly have any spawn script.
-
About tripleposting/doubleposting: Ever heard of deleting old messages, and then posting a new one.
-
What folders do you have in your resources? Remove all same named folders.
-
Tripleposting is not allowed, nor is doubleposting. It is pretty unlikely that it will play the second sound as you only have two sounds. It will mostly just be the other one, hardly the second one. So, I suggest more sounds. That script that Castillo made, should be working in my opinion. What I understood was that the script was working but it only plays the other sound. If it's not working at all, check your meta.xml, debugscript, folders.
-
When you go to your 'Resources' folder, a lot of folders with names like '[folder]' pop up. They are made to seperate and make it easier to know where are your scripts. You are able to create [] folders aswell. You don't need to have [] kind of folder at all. So, simply just put it in the Resources folder, put it in a [] folder or make one yourself. Easy.
-
What a mess you've got there. local root = getRootElement() local col = createColTube(2919.8000488281, -790.9, 10.300000190735, 20, 20) local lift = createObject(968, 2919.8000488281, -790.9, 11.300000190735, 0, -90, 88) function open(hitPlayer, matchingDimension) if hasObjectPermissionTo(hitPlayer, "function.banPlayer") then moveObject(lift, 2500, 2919.8000488281, -790.9, 11.300000190735, 0, 90, 0) end end addEventHandler("onColShapeHit", col, open) function close(thePlayer) if hasObjectPermissionTo(thePlayer, "function.banPlayer") then moveObject(lift, 3500, 2919.8000488281, -790.8, 11.300000190735, 0, -90, 0) end end addEventHandler("onColShapeLeave", col, close)
-
Show me your mtaconfig.conf file's modules section. I want to see if you're using Linux files mixed aswell..
-
Try this. addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), function() if (source == GUIEditor_Button[1]) then local thePlayer = getLocalPlayer() local theVehicle = getPedOccupiedVehicle(thePlayer) if theVehicle and thePlayer then setElementPosition(theVehicle , 1523.9138183594, 1527.1204833984, 10.2602405548) elseif not theVehicle and thePlayer then setElementPosition(thePlayer , 1523.9138183594, 1527.1204833984, 10.2602405548) elseif not theVehicle and not thePlayer then return end end end)
-
Actually it's pretty easy. I made this with my phone and I just woke up, but test this, it should be like this. I'll fix the errors when I get on mah computah. local object1 = createObject(1337, 110, 200, 10) local object2 = createObject(1337, 100, 205, 10) function attaching() local x, y, z = getElementPosition(object1) attachElements(object2, object1, 100 - x, 205 - y, 10 - z) end addCommandHandler("attach", attaching)
-
Even though you said it's one way of doing it, you still didn't do what he wanted. He wanted especially a gridlist.
-
Thanks a lot! Everything seems to be working
-
@Snake: Because he had them like that from the beginning. But true, it can be fully server side aswell. @Dev: You hadn't closed a string in the table.. exports.scoreboard:scoreboardAddColumn("Points") exports.scoreboard:scoreboardAddColumn("Rank") ranks = {{[1] = "Beginner lvl 1"}, {[2] = "Beginner lvl 2"}, {[3] = "Good Player"}, {[4] = "Nice Player"}, {[5] = "Pro Player"}} function addPoints(killer, weapon, bodypart) local points = getElementData(killer, "Points") local rank = getElementData(killer, "Rank") local killername = getPlayerName(killer) local targetname = getPlayerName(source) local player = getLocalPlayer() if killer and killer ~= source then setElementData(killer, "Points", tonumber(points) + 1) setElementData(killer, "Rank", tonumber(rank) + 1) triggerServerEvent("onAddingPoints", getLocalPlayer(), killername, targetname) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), addPoints) If you want to change from client-side to server-side, use this: exports.scoreboard:scoreboardAddColumn("Points") exports.scoreboard:scoreboardAddColumn("Rank") ranks = {{[1] = "Beginner lvl 1"}, {[2] = "Beginner lvl 2"}, {[3] = "Good Player"}, {[4] = "Nice Player"}, {[5] = "Pro Player"}} function addPoints(ammo, attacker, weapon, bodypart) local points = getElementData(attacker, "Points") local rank = getElementData(attacker, "Rank") local killername = getPlayerName(attacker) local targetname = getPlayerName(source) if attacker and attacker ~= source then setElementData(attacker, "Points", tonumber(points) + 1) setElementData(attacker, "Rank", tonumber(rank) + 1) outputChatBox(killername .. " killed " .. targetname .. " and gained 1 point.", getRootElement(), 255, 255, 0, false) end end addEventHandler("onPlayerWasted", getRootElement(), addPoints)
-
I have no idea what's going on no more, but this is a script for it what he wants. -- Freeze GUI function freezeGUI() freeze_window = guiCreateWindow(836, 149, 206, 137, "Freeze GUI", false) guiWindowSetSizable(freeze_window, false) guiSetVisible(freeze_window, false) freeze_freeze_button = guiCreateButton(16, 32, 172, 41, "Freeze all players", false, freeze_window) freeze_unfreeze_button = guiCreateButton(16, 80, 172, 41, "Unfreeze all players", false, freeze_window) addEventHandler("onClientGUIClick", freeze_freeze_button, freezePlayers) addEventHandler("onClientGUIClick", freeze_unfreeze_button, unfreezePlayers) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), freezeGUI) -- Toggle the GUI function freezeToggleGUI() local status = guiGetVisible(freeze_window) if status == true then guiSetVisible(freeze_window, false) showCursor(false) else guiSetVisible(freeze_window, true) showCursor(true) end end addCommandHandler("gui", freezeToggleGUI) -- Freeze everyone function freezePlayers() local players = getElementsByType("player") local status = getElementData(freeze_unfreeze_button, "Frozen") if status == false then outputChatBox("All players frozen.", 120, 255, 120, false) for i,v in ipairs(players) do setElementFrozen(v, true) guiSetVisible(freeze_window, false) showCursor(false) setElementData(freeze_unfreeze_button, "Frozen", true) end else outputChatBox("All players are already frozen.", 255, 0, 0, false) end end -- Unfreeze everyone function unfreezePlayers() local players = getElementsByType("player") local status = getElementData(freeze_unfreeze_button, "Frozen") if status == true then outputChatBox("All players unfrozen.", 120, 255, 120) for i,v in ipairs(players) do setElementFrozen(v, false) guiSetVisible(freeze_window, false) showCursor(false) setElementData(freeze_unfreeze_button, "Frozen", false) end else outputChatBox("All players are already unfrozen.", 255, 0, 0) end end
-
Try this, but still suggesting Snake's link. -- ~ Client-side exports.scoreboard:scoreboardAddColumn("Points") exports.scoreboard:scoreboardAddColumn("Rank") -- Table ranks = {{[1] = "Beginner lvl 1"}, {[2] = "Beginner lvl 2"}} -- Adding points function addPoints(killer, weapon, bodypart) local points = getElementData(killer, "Points") local rank = getElementData(killer, "Rank") local killername = getPlayerName(killer) local targetname = getPlayerName(source) local player = getLocalPlayer() if killer and killer ~= source then setElementData(killer, "Points", tonumber(points) + 1) setElementData(killer, "Rank", tonumber(rank) + 1) triggerServerEvent("onAddingPoints", getLocalPlayer(), killername, targetname) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), addPoints) -- ~ Server-side -- Showing the message function showMessage(killer, source) outputChatBox(killername .. " killed " .. targetname .. " and gained 1 point.", getRootElement(), 255, 255, 0, false) end addEvent("onAddingPoints", true) addEventHandler("onAddingPoints", getRootElement(), showMessage)
-
What's the problem..? This script doesn't make sence. -- ~ Client-side exports.scoreboard:scoreboardAddColumn("Points") function addPoints(killer, weapon, bodypart) local points = getElementData(killer, "Points") local killername = getPlayerName(killer) local targetname = getPlayerName(source) local player = getLocalPlayer() if killer and killer ~= source then setElementData(killer, "Points", tonumber(points) + 1) triggerServerEvent("onAddingPoints", getLocalPlayer(), killername, targetname) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), addPoints) -- ~ Server-side function showMessage(killer, source) outputChatBox(killername .. " killed " .. targetname .. " and gained 1 point.", getRootElement(), 255, 255, 0, false) end addEvent("onAddingPoints", true) addEventHandler("onAddingPoints", getRootElement(), showMessage)
-
Hello, I am trying to use this MTA-Paradise gamemode for once, to see what kind of GM it is. Here are some questions, and do not tell me that they're stupid questions as there aren't no stupid questions especially because this is my first time working with MTA MySQL modules and such. 1. Do I need to download XAMPP or some MySQL program to run a MySQL server or does MTA Server do the stuff, so I just need to do the scripts and I don't need to focus on the MySQL at all? I mean, do I need a MySQL browser that I can add stuff like in phpMyAdmin etc? 2. What kinds of modules I should download to run simple tasks on MySQL? 3. How do I configure my MySQL connection settings? 4. What should I add in the mtaconfig file? 5. Does an external website hoster (like: 000webhost.com) work with MTA MySQL? Maybe more questions come up after you've answered, but please, help me out, I am pleased to know more about this as I have used MySQL in PHP scripts, but MTA is way different for me.