 
        myonlake
Members- 
                Posts2,312
- 
                Joined
- 
                Days Won41
Everything posted by myonlake
- 
	First of all, are you sure the script is fixed already? Errors are saying different functions, which are basically already fixed in your script. However, you had doublecheck on the team section. You don't need to check the team and the name in seperate. When you check the name, it checks if the player is in the team anyways. local MarkerPolice = createMarker( 1588.4000244141, -1637, 11.39999961853, 'corona', 12.0, 0, 0, 255, 0) local Policegate1 = createObject(980, 1590.1999511719, -1638.4000244141, 15.199999809265, 0, 0, 0) function MarkerHit1(hitElement, matchingDimension) if getElementType(hitElement) == "player" then if (getPlayerTeam(hitElement) == getTeamFromName("Police")) then moveObject(Policegate1, 2000, 1598.1999511719, -1638.4000244141, 15.199999809265) end end end function MarkerLeave1(leaveElement, matchingDimension) if getElementType(hitElement) == "player" then if (getPlayerTeam(leaveElement) == getTeamFromName("Police")) then moveObject(Policegate1, 2000, 1590.1999511719, -1638.4000244141, 15.199999809265) end end end addEventHandler("onMarkerHit", MarkerPolice, MarkerHit1) addEventHandler("onMarkerLeave", MarkerPolice, MarkerLeave1)
- 
	You are not able to cancel quitting, it wouldn't have any idea anyways.
- 
	As what Snake said. local Marcklbara = createMarker(x, y, z, 'arrow', 2, 0, 255, 0, 150) local Marcklde5el = createMarker(x, y, z, 'arrow', 2, 0, 255, 0, 150) function Entrer(hitPlayer, matchingDimension) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Criminal") then setElementPosition(hitPlayer, x, y, z) setElementInterior(hitPlayer, interior) -- Interior number goes on 'interior' else outputChatBox("You cannot enter. You need to be a criminal.", hitPlayer) end end addEventHandler("onMarkerHit", Marcklbara, Entrer) function Sortie(hitPlayer, matchingDimension) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Criminal") then setElementPosition(hitPlayer, x, y, z) setElementInterior(hitPlayer, 0) end end addEventHandler("onMarkerHit", Marcklde5el, Sortie)
- 
	Exactly, I thought about the same thing that what the hell are they talking about :3
- 
	This is just about the server resources you have there. If you have a lot of functions related to the onPlayerJoin/onPlayerConnect/onClientResourceStart, it may end a little laggy on join. For example, my server lags a little when a player logs in due to the database checks the scripts do.
- 
	Thanks for the suggestion, I thought about it aswell but decided to work on a little easier first. I am changing it to colshapes now
- 
	I have removed the annoying else returns now. I am not sure have you really understood the problem; it possibly ends the function as it detects a player or a vehicle that is not in the marker, meaning that all players and vehicles should be in the marker to let the script work. EDIT: I have fixed the problem by making a check if the element is in the marker. Check the updated code.
- 
	And how am I able to make that return? Not sure, but you cannot return for .. do?
- 
	And that's not going to make a difference, it's tested.
- 
	Hello everyone, I am attempting to make a code that moves all vehicles and players away from the marker when I have executed the command. If you know what "Fus Ro Dah" means, you should know what I am trying to catch here. Server function fusRoDah(player, cmd) if hasObjectPermissionTo(player, "function.banPlayer") then local px, py, pz = getElementPosition(player) outputChatBox("Fus Ro Dah!", root, 255, 0, 0, false) triggerClientEvent("onFusCommand", root, px, py, pz) marker = createMarker(px, py, pz, "cylinder", 150, 255, 0, 0, 255) setTimer(function() destroyElement(marker) end, 1000, 1) for ipl,pla in ipairs(getElementsByType("player")) do if not isElementWithinMarker(pla, marker) then end local x, y, z = getElementPosition(pla) setElementPosition(pla, x + 50, y + 50, z + 1) end for ive,veh in ipairs(getElementsByType("vehicle")) do if not isElementWithinMarker(veh, marker) then end local x, y, z = getElementPosition(veh) setElementPosition(veh, x + 50, y + 50, z + 1) end end end addCommandHandler("fus", fusRoDah) Client local root = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) function playFusRoDah(px, py, pz) local sound = playSound3D("fusrodah.wav", px, py, pz, false) end addEvent("onFusCommand", true) addEventHandler("onFusCommand", root, playFusRoDah) So, it plays the voice and everything correctly. But it doesn't move the players or vehicles away from the marker. It doesn't output any errors or anything. I assume it's just that it checks the for ... do stuff and if one of them is invalid, it won't execute my function I am trying to do here.
- 
	And the check can be made for example by element datas.
- 
	"cheese.mp3" type="client"/> It still doesn't work attempt to call global "playSound" (a nil value) You are making the code in the server-side! Sound effects are only available on client-side. <file src="cheese.mp3" /> <script src="client.lua" type="client"/>
- 
	Maybe you have, but you have it yourself, as far as I can see, you haven't published it.
- 
	This is the problem in "freeroam" resource. It creates a custom one to everybody. Though it is easy to be edited. What gamemode are you using? And are you using freeroam resource?
- 
	https://community.multitheftauto.com/index.php?p= ... ils&id=990
- 
	Not sure if it's even possible to change the music speed yet?
- 
	MTA is open-source, and if someone has a problem with a script, we help them, we don't argue about who owns the script. So, what is the problem in this script? You haven't explained us anything what you want to do with it.
- 
	Yes it is. The first one starts the "MarkerHit1" function when you have hit the marker and the other one starts the "MarkerLeave1" function when you leave the marker. And no problem, we'll always be here to help you.
- 
	Why not try yourself aswell, as you know, we're not here to make script for you, we're helping. That what I did helps you a lot, and I am sure you can figure it out yourself (at least try to, I will fix your script if it's a mess). createMarker onMarkerHit
- 
	What do you mean by that? You want them to work by radius? When you go near them they open up? Whoops, heh'. Fixed that aswell.
- 
	Well, the problem is GTA. You could make two markers in each other, the other one a little bigger and the other one smaller and the smaller one would be invinsible. So when you enter the marker, it should work just in the perimeter as how you want it.
- 
	Basically what I did was that I created a function that creates the "SWAT" team. I also modified some typos and such. Not tested though. Commands Open the gate: /swato1 Close the gate: /swatc1 local swatgate1 = createObject(980, 1287, -1612.59997559, 15.30000019, 0, 0, 90) function cteam() createTeam("SWAT", 0, 0, 255) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), cteam) function open(player, cmd) local team = getPlayerTeam(player) local name = getTeamName(team) if name == "SWAT" then moveObject(swatgate1, 3000, 1287, -1612.59997559, 9.60000038) end end addCommandHandler("swato1", open) function close(player, cmd) local team = getPlayerTeam(player) local name = getTeamName(team) if name == "SWAT" then moveObject(swatgate1, 3000, 1287, -1612.59997559, 15.30000019) end end addCommandHandler("swatc1", close)
- 
	To replace TXD/DFF/COL: engineLoadTXD engineLoadDFF engineLoadCOL
