-
Posts
1,028 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ..:D&G:..
-
Hey, is there any way to check if the login creditals of a MyBB forum login that the player enters in a gui in game, are correct? Thanks.
-
Hey, I just came accross this event that kinda comes in really helpful which is onElementDestroy but I have a question. Is there anyway to make it so the function executes something only if the element was destroy somehow by a player? I mean, I am doing a small function for my logs, and when a vehicle is destory, it should be recorded in the logs, but I only want to record it in, only if the vehicle was destroy by the script and not by a player that executed a command. Dunno if this is possible, I thought maybe it is like onPlayerQuit, from which you can get the reason the player quit... Anyway.. Thanks.
-
EDIT SOLVED
-
Doesn't that require a killTimer?
-
Hello guys, is there any way to have a timer and change/load an object every 2 seconds from ipairs? Because sometimes the server freezes when there are over 100+ vehicles or peds etc... Example: for i, v in ipairs(getElementsByType("vehicle")) do setElementData(v, "data", 1) end For example, that code will send the data of all the vehicles from the server, but there are 500 vehicles (just as an example ) but the data will change for all of them at once, is there anyway I can set the data for like 1 vehicle every 2 seconds or 5 vehicles every 2 seconds? Thanks.
-
Hello guys, I am using this neons resource but I am having a problem with it. It is too bright, you can see vehicles from a distance having a light with the color of the neon, on them. I couldn't find any .fx file to edit this so it doesn't have a shader and I don't know how to edit this... Resource: https://community.multitheftauto.com/index.php?p= ... ls&id=8890 Thanks.
-
Attempt to index 'neon' (a userdata value)
-
Hello guys, I am trying to get the value of a column from a mysql database, but instead of getting a number it gets a userdata and when I try "type(row.neon)" it gets a resource data... function attachNeonsToVehicles() for i, v in ipairs(getElementsByType("vehicle")) do local dbid = getElementData(v, "dbid") local row = exports.mysql:query_fetch_assoc("SELECT * FROM vehicles WHERE id = " .. exports.mysql:escape_string(dbid) ) if row then if (row.neon > 0) then setElementData(v, "neon", row.neon) attachNeon(v, row.neon) else setElementData(v, "neon", 0) end end end end addEventHandler ( "onResourceStart", getRootElement(), attachNeonsToVehicles ) Any ideas?
-
Hello guys, I am trying to add map elements like objects, markers, vehicles etc into JSON as someone told me I can easily do local theElements = fromJSON("["..mapElements.."]") The thing is that I don't know how to use JSON, as I never used it before. From what I understand, I need my script to be something like this: local theElements = fromJSON("["..mapElements.."]") if theElements then local objectElements = theElements['object'] local markerElements = theElements['marker'] But I don't know how JSON works, how I insert the data and how it is stored in JSON... Thanks.
-
I seem on some servers that they have a legend next to the map which shows what each icon on the map represents. Is that an available resource on community? Thanks.
-
It seems like by using this line: local randRockID = minedRocks[math.random(1, #minedRocks)] It gets the table instead of a number from the table... Doesn't matter, fixed!
-
It seems I learn something new everyday Thanks
-
So.. how do I get a random number from a table? local minedRocks = { {828}, {868}, {896}, {987}, {898}, {899}, {900}, {901}, {905}, {906}, {1303}, {1304}, {1305}, }
-
Lol, didn't think about that, thanks
-
Hello guys, I am trying to get a random number from math.random, but some numbers are decimals and the number outputed is 0 instead of 0.3 or 0.1 etc... Any ideas?
-
Hello guys, I am trying to sync the player's animation from client side to server side, but the event is not triggered... --Client function startMiningSpot(hitPlayer) if (hitPlayer == getLocalPlayer()) and (source == miningSpot) then triggerServerEvent("syncMiningAnim", resourceRoot, hitPlayer, source) outputChatBox("Message shows!") end end addEventHandler( "onClientMarkerHit", getRootElement(), startMiningSpot) --Server function syncMining(hitElement, marker) exports.global:applyAnimation(hitElement, "chainsaw", "CSAW_1", -1, true, false, false) setElementPosition(hitElement, getElementPosition(miningSpot)) setPedRotation(hitElement, getElementData(miningSpot, "msRotation")) outputChatBox("Don't show", hitElement) end addEvent("syncMiningAnim", true) addEventHandler("syncMiningAnim", getRootElement(), syncMining) I know it's kinda late for scripting but maybe I missed something? Because the message from server side doesn't show and the function doesn't give any errors... Maybe I'm too tired? Thanks.
-
I just don't get how do you make the gauges work... I mean... they are part of the texture of the car, how do they move?! Mind blowing
-
Hello guys, I am just curious how many of you like trucking and play games like ETS or ATS a lot. Just leave a reply if you do, thanks
-
It just doesn't work, here is the GUI, maybe it will help: function showCVFormWindow(factionName, cvPedName) local width, height = 402, 855 local scrWidth, scrHeight = guiGetScreenSize() local x = scrWidth/2 - (width/2) local y = scrHeight/2 - (height/2) if not (isElement(formWindow)) then formWindow = guiCreateWindow(x, y, width, height, "Formular CV - "..factionName, false) guiWindowSetSizable(formWindow, false) lName = guiCreateLabel(63, 82, 39, 18, "Name:", false, formWindow) mName = guiCreateMemo(129, 106, 150, 31, getPlayerName(getLocalPlayer()), false, formWindow) guiMemoSetReadOnly(mName, true) lAge = guiCreateLabel(64, 123, 48, 15, "Age:", false, formWindow) mAge = guiCreateMemo(129, 113, 43, 35, "", false, formWindow) lPhone = guiCreateLabel(63, 158, 64, 18, "Telephone:", false, formWindow) mPhone = guiCreateMemo(129, 155, 150, 31, "", false, formWindow) lAddress = guiCreateLabel(65, 206, 54, 15, "Address:", false, formWindow) mAddress = guiCreateMemo(129, 196, 150, 51, "", false, formWindow) lQuestion = guiCreateLabel(120, 405, 159, 17, "Why do you want to join us?", false, formWindow) mQuestion = guiCreateMemo(43, 432, 313, 91, "", false, formWindow) lEducation = guiCreateLabel(63, 262, 41, 21, "Education:", false, formWindow) mEducation = guiCreateMemo(127, 256, 150, 32, "", false, formWindow) lBio = guiCreateLabel(168, 293, 67, 16, "Short Bio", false, formWindow) mBio = guiCreateMemo(43, 314, 313, 77, "", false, formWindow) gShow1 = guiCreateGridList(119, 529, 154, 37, false, formWindow) lOOC = guiCreateLabel(45, 10, 65, 17, "OOC", false, gShow1) lHoursPlayed = guiCreateLabel(41, 576, 63, 17, "Hours Played:", false, formWindow) mHoursPlayed = guiCreateMemo(106, 572, 54, 31, getElementData(getLocalPlayer(), "hoursplayed") or 0, false, formWindow) guiMemoSetReadOnly(mHoursPlayed, true) lOOCAge = guiCreateLabel(238, 582, 40, 14, "Age:", false, formWindow) mOOCAge = guiCreateMemo(283, 575, 44, 31, "", false, formWindow) lFaction = guiCreateLabel(137, 613, 116, 15, "Last Factions", false, formWindow) mFaction = guiCreateMemo(99, 638, 194, 33, "", false, formWindow) lRPLvl = guiCreateLabel(107, 681, 186, 17, "Roleplay skills?(1 la 10)", false, formWindow) mRPLvl = guiCreateMemo(174, 708, 54, 36, "", false, formWindow) gShow2 = guiCreateGridList(125, 22, 154, 37, false, formWindow) lIC = guiCreateLabel(52, 11, 49, 16, "IC", false, gShow2) bClose = guiCreateButton(327, 764, 63, 30, "Close", false, formWindow) addEventHandler("onClientGUIClick", bClose, closeCVFormWindow) guiSetProperty(bClose, "NormalTextColour", "FFFE0000") bSend = guiCreateButton(135, 754, 128, 55, "Send Form", false, formWindow) addEventHandler("onClientGUIClick", bSend, sendCVData) guiSetFont(bSend, "default-bold-small") guiSetProperty(bSend, "NormalTextColour", "FF00FE18") showCursor(true) guiSetInputEnabled(true) end end
-
Hello guys, I tried to install a 64 bit MTA Linux server on a dedi, but I get this error when executing "./mta-server64" in putty: Segmentation fault (core dumped), Any ideas? Thank you.
-
It still goes to the triggerServerEvent when 1 or more fields are empty, which should be triggered when all the fields have some text it them...
-
Well this is the gui element: mAge = guiCreateMemo(129, 113, 43, 35, "", false, formWindow) And it has "" as a text ,which is just empty, so it should work with "== "" " so it should work. EDIT - Now I added "if not" and "or not" and now it keeps saying "enter all the information" even if I did.
-
Hello guys, I tried to make a form as a GUI, but when I use "getGuiText(guiElement)=="" " to see if the player has entered something for all the fields, it just send the form as if the player did enter everything, which he didn't... function sendCVData(button, state) if (source==bSend) and (button=="left") and (state=="up") then if (guiGetText(mName) == "") or (guiGetText(mAge) == "") or (guiGetText(mPhone) == "") or (guiGetText(mAddress) == "") or (guiGetText(mQuestion) == "") or (guiGetText(mEducation) == "") or (guiGetText(mBio) == "") or (guiGetText(mHoursPlayed) == "") or (guiGetText(mOOCAge) == "") or (guiGetText(mFaction) == "") or (guiGetText(mRPLvl) == "") then outputChatBox("Please enter all the details needed.", 255, 0, 0) elseif not tonumber(guiGetText(mPhone)) then outputChatBox("The phone number doesn't seem to be valid.", 255, 0, 0) elseif not tonumber(guiGetText(mOOCAge)) or not tonumber(guiGetText(mAge)) then outputChatBox("Your age doesn't seem to be valid", 255, 0, 0) else outputChatBox(guiGetText(mAge)) local name = guiGetText(mName) triggerServerEvent("saveCVData", resourceRoot, getLocalPlayer(), name, guiGetText(mAge), guiGetText(mPhone), guiGetText(mAddress), guiGetText(mQuestion), guiGetText(mEducation), guiGetText(mBio), guiGetText(mHoursPlayed), guiGetText(mOOCAge), guiGetText(mFaction), guiGetText(mRPLvl), cvPedName, factionName) -- destroyElement(formWindow) -- formWindow = nil -- showCursor(false) -- guiSetInputEnabled(false) end end end Any ideas? Thanks.
-
Stai in Londra eh? Pun tiganii lui Ciuca pe tine sa moara familia ta! Cand te prind te tai! Huoo, roman venit in Anglia la cersit si furat! Faci de ras romania in alte tari! RUSINE!
-
Hello guys, I am trying to do a sleeping system when the player gets offline. But, the ped that spawns in the player's position, needs to be without collision, so.. how do I do that? Thank you.