-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
It's not that simple.
-
He already has that in his code, he needs to tell us what's wrong with it. Use '/debugscript' 3 to check if there is any errors.
-
For the future, avoid requesting and try something yourself first. You can then post a topic asking for help along with your attempts.
-
The first argument should be the marker that the player hit, so you need to check if the marker hit by the player is the barriermarker. Your code simply "masks" the global barriermarker with a local one that refers to the marker hit by the player. So you need to change "barriermarker" in "opengate" function to "marker" (or any other name but not "barriermarker") and then comparing it to "barriermarker" local barrier = createObject(2920,1544.5996,-1623.9502,13.1,90,0,0) local barriermarker = createMarker(1544.88757,-1627.26501,12.7,"cylinder",8,_,_,_,255) function opengate(marker) if (not isElement(marker) or marker ~= barriermarker) then return end moveObject(barrier,3000,1544.5996,-1623.9502,13.2,-90) outputChatBox("true") destroyElement(barriermarker) setTimer(moveObject,7500,1,barrier,2600,1544.5996,-1623.9502,13.1,90) local barriermarker = setTimer(createMarker,11000,1,1544.88757,-1627.26501,12.7,"cylinder",8,_,_,_,0) end addEventHandler("onPlayerMarkerHit",resourceRoot,opengate) function barriernotbreakable() triggerClientEvent("setbarriernotbreakable",resourceRoot,barrier) end addEventHandler("onResourceStart",getRootElement(),barriernotbreakable)
-
Do not post multiple topics about the same issue. To edit the default engine sound you will need: setWorldSoundEnabled playSound/playSound3D stopSound https://wiki.multitheftauto.com/wiki/Se ... undEnabled
-
If this is still not resolved then you might want to look at this useful function: https://wiki.multitheftauto.com/wiki/FindRotation
-
(fixed) Updating ScoreBoard Text does not work (setElementDa
JR10 replied to BlueTheFurry's topic in Scripting
You might still be comparing a string to a number, you need to use tonumber to make sure that the compared object is a number. function updatelvl() local players = getElementsByType ( "player" ) outputChatBox("got elements by type") for theKey,thePlayer in ipairs(players) do outputChatBox("did it") totaldrift = tonumber(getElementData(thePlayer, "Total Drift" )) or 0 if totaldrift < 99000 then setElementData(thePlayer, "Drift Rank", "Newbie" ) elseif totaldrift > 100000 then setElementData(thePlayer, "Drift Rank", "Trained" ) elseif totaldrift > 500000 then setElementData(thePlayer, "Drift Rank", "Drifter" ) elseif totaldrift > 1000000 then setElementData(thePlayer, "Drift Rank", "Adv. Drifter" ) elseif totaldrift > 5000000 then setElementData(thePlayer, "Drift Rank", "Best Drifter" ) elseif totaldrift > 25000000 then setElementData(thePlayer, "Drift Rank", "Drift King" ) elseif totaldrift > 50000000 then setElementData(thePlayer, "Drift Rank", "Drift Expert" ) elseif totaldrift > 100000000 then setElementData(thePlayer, "Drift Rank", "Drift Master" ) elseif totaldrif) > 500000000 then setElementData(thePlayer, "Drift Rank", "Drift Elite" ) end end end addEvent("updatelvl", true ) addEventHandler("updatelvl", getRootElement(), updatelvl ) -
This is not a proper way to ask for help in this forum, you need to provide more information on what's wrong with the code. Read this for more info viewtopic.php?f=91&t=47897
-
This is not a forum for requests, try something yourself and then ask for help. You could also search through the community for what you need. https://community.multitheftauto.com/
-
We do not help with leaked resources.
-
I'm not entirely sure what you mean by "target", whether its cyber or verbal, hiding the players will probably not stop such things.
-
Server-side and client-side variables are not synced, even if they're global. The position variables never get sent to the client. Another problem you have is getRootElement in triggerClientEvent, this will play the sound for everyone in the server regardless of who triggered the event. Server: function lockcar ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( vehicle ) then local vehposx,vehposy,vehposz = getElementPosition(vehicle) if isVehicleLocked ( vehicle ) then setVehicleLocked ( vehicle, false ) triggerClientEvent(thePlayer,"onvehicleunlock",vehicle, vehposx, vehposy, vehposz) outputChatBox("Your "..getVehicleName(vehicle).." have been unlocked", thePlayer,0,255,0) else setVehicleLocked ( vehicle, true ) triggerClientEvent(thePlayer,"onvehiclelock",vehicle, vehposx, vehposy, vehposz) outputChatBox("Your "..getVehicleName(vehicle).." have been locked", thePlayer,0,255,0) end end end addCommandHandler("lock",lockcar) function unlock(vehicle) setVehicleLocked(vehicle, false) triggerClientEvent(source,"onvehicleunlock",vehicle) end addEventHandler("onPlayerVehicleExit",getRootElement(),unlock) Client: addEvent("onvehiclelock",true) function playSoundLock(vehposx, vehposy, vehposz) playSound3D("lock.wav",vehposx,vehposy,vehposz) outputChatBox("playsound") end addEventHandler("onvehiclelock",getRootElement(),playSoundLock) addEvent("onvehicleunlock",true) function playSoundUnlock(vehposx, vehposy, vehposz) playSound3D("unlock.wav",vehposx,vehposy,vehposz) outputChatBox("playsound") end addEventHandler("onvehicleunlock",getRootElement(),playSoundUnlock)
-
You can search on the community for similar resources, a few examples: https://community.multitheftauto.com/index.php?p= ... ls&id=6292 https://community.multitheftauto.com/index.php?p= ... ls&id=4448 https://community.multitheftauto.com/index.php?p= ... ls&id=8620
-
If I remember correctly, guieditor defaults the grid-list selection mode to 2, which means that each cell get selected individually. What you really need is: guiGridListSetSelectionMode(gridlist, 0) Which means single row selection. Visit the wiki page for more info.
-
How about you try to do it yourself? If you fail we can help you with your code, but this is not a forum for requests.
-
You can get the selected item's text and then search through the other 2 grid lists removing the matching items. You could also use guiGridListGetItemData guiGridListSetItemData
-
You can use it to store (save) certain data or information and then get (by querying) it again. Use Google to read more about it, you could then read my tutorial: viewtopic.php?f=148&t=38203#p393074
-
I can't think of a use for hiding or masking the players list, what can a banned player do if he sees the players in-game?
-
I can't imagine a scenario where you'll want several databases. You'll probably never go beyond 50 tables, that's not "a lot".
-
Are you sure you have the latest file? I've tried it and it's not multi-line.
-
Mine has the same. There was a mistake on my half, I accidentally mixed the files in the last commit. Reverted it and should be working correctly now.
-
Blame N++ for that as I tried several ways to accomplish that but to no avail. How is that different from mine?