-
Posts
266 -
Joined
-
Last visited
Everything posted by Ryancit2
-
Yea but i gave the PHP source as well.
-
Now you can send emails from within your server by any email ID, to anyone. This resource has user-friendly GUI. Features: - Send from any random emails, provided in serverside table at top. - Completely open source version with PHP source files as well. - You can also use HTML codes within message body, google "HTML codes" and you'll see how to bold, italic, add URLs, etc to messages. - For bandwidth reasons, most of the websites can send limited emails per minute, in my case its 21 emails so php file uses sleep() function to make a delay in emails, i prefer you to do the same if you are going to add PHP source on your own website. Pictures: Download: community.multitheftauto.com PHP Source: I've added the PHP file in that resource archive. Thank you.
-
setElementVisibleTo ( element theElement, element visibleTo, bool visible ) Replace theElement with object, replace visibleTo with root of players, remove bool visible with false.
-
Probably because the table 'cases' doesn't have 'source' as one of its indexes.
-
What does /debugscript 3 days? I'm sure GUI issues are minor ones and sometimes hard to notice, you are (possibly) giving wrong parent names (which i couldn't find) or the data is not inserted in valid elements or there's been a confusion in both windows. Go ingame, login as admin then check t/debugscript 3 and tell us errors.
-
All good, aap sunao?
-
That code contains something incomplete, just remove Line#4 from elevator.lua file, Line#4 is this: local model = Remove that and then try.
-
Image is not working + we can't help you with that lack of information, please explain a bit more.
-
Try changing fireWeapon(m4) from Line#11 to fireWeapon(weapon). If that doesnt works, change 'local weapon = ...' from Line#5 to 'weapon = ...' and remove 'local' to make it global and use-able by other events directly.
-
It seems, problem is only with one player. Plus the download progress is client-related issue, he should seek help. MTA's server files are 100% up-to-date and working so i don't think its server's issue. Also, this board is for scripting related issues only -- rest is up to moderators.
-
About weather sync, i guess thats a great idea. About PHP, thats just a 5 lines code, i'll publish it tomorrow, good night
-
Hey guys, i just made a small Metro-UI-Based app which tells the accurate weather of your city. Pictures: Features: - Get weather of any city around the world (Type accurate name). - Tells Temperature, Humidity, Wind speed and sky text. - Automatically draws sky picture from given ones. A v2.0 of this script is yet to come with 7-days forecast if i get enough feedback from you guys NOTE: This script wont run without callRemote access, read "callRemote.txt" from archive. If anything goes wrong with my webpage from where it calls weather, contact me ASAP, you can comment in here as well, i'll fix it ASAP! Download: community.multitheftauto.com PHP File: I've added the PHP file in that resource archive. NOTE: That PHP code isn't at outstanding format, i just made it stable enough and clear enough to be read-able. And its better keep copyrights under my name even though its just a small code. Thank you.
-
I misread, i thought he meant to upgrade vehicle as a whole, like changing its outlook, didn't saw he meant 'spoiler' as a single upgrade. I was talking about redesigning whole vehicle and adding a pre-made spoiler within 'vehicles' textures.
-
Try this at client side: triggerServerEvent( "takeRepairMoney", resourceRoot, vehicleHealth - 100 ) -- [[vehicleHealth - 100]] should be a number btw, since its the cost amount. And you are adding a command in serverside, not an event, try this one: function takeRepairMone (amount) takePlayerMoney(client,amount) end addEvent("takeRepairMoney", true) addEventHandler("takeRepairMoney", root, takeRepairMoney)
-
You'll barely find vehicles at those exact pos, if you want, i can provide a small tweak to remove vehicles from specific locations (real small ones though). I made one: function destroyVehicles() local x, y, z = getElementPosition(localPlayer) local tempCol = createColRectangle(x, y, 100, 100) local vehs = getElementsWithinColShape(tempCol, "vehicle") local count = 0 for k, v in pairs(vehs) do destroyElement(v) count = count+1 end outputChatBox("Destroyed "..count.." vehicles near you.") count = 0 destroyElement(tempCol) end addCommandHandler("dvehs", destroyVehicles)
-
Main difference is: SQLite = offline. MySQL = online. Now if we go in details, you'll see what difference is: Data value types of SQLite: Data value types of MySQL: That clearly says MySQL can store data values with more efficient types, those which goes perfectly with your data value. Though, you wont understand all of those types, check that on google by " in Sqlite/MySQL". Another thing is that MySQL is used by most professionals, and mostly to connect websites with your object-oriented programming. While we see, SQLite is more handy for starters, can save every data as same as MySQL does, its just that MySQL can store it under more categories. Also, SQLite is used in (most) android apps, i'm not sure about iOS.
-
Change first function with this: vehicles={} function makevehs () local vehicle = executeSQLQuery("SELECT * FROM `newprivatevehicles`") for i, v in ipairs(vehicle) do local colors = split(v.Color, ",") vehicles[i] = createVehicle ( v.Model, v.X, v.Y, v.Z, v.RX, v.RY, v.RZ ) setVehicleColor(vehicles[i], colors[1], colors[2], colors[3], colors[4], colors[5], colors[6]) setElementData(vehicles[i], "whoLocked", v.GROUPLOCK) setElementData(vehicles[i], "lockedTo", v.LOCK) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),makevehs)
-
I made whole new working one, and fixed some flaws from your current code: function toggleGUI() guiSetVisible(RadioSystem, not guiGetVisible(RadioSystem)) showCursor(not isCursorShowing()) end local screenW, screenH = guiGetScreenSize() RadioSystem = guiCreateWindow((screenW - 525) / 2, (screenH - 385) / 2, 525, 385, "Radio System", false) guiWindowSetSizable(RadioSystem, false) RadioPlay = guiCreateButton(274, 145, 142, 69, "Play", false, RadioSystem) RadioStop = guiCreateButton(274, 267, 142, 69, "Stop", false, RadioSystem) RadioStationList = guiCreateGridList(81, 135, 174, 211, false, RadioSystem) guiGridListAddColumn(RadioStationList, "Radio Stations", 1) RadioSystemtext = guiCreateLabel(78, 38, 399, 58, "Radio System", false, RadioSystem) Closeradiowindow = guiCreateButton(225, 346, 75, 29, "Close", false, RadioSystem) guiSetFont(RadioSystemtext, "sa-header") guiSetFont(RadioPlay, "sa-header") guiSetFont(RadioStop, "sa-header") guiSetFont(Closeradiowindow, "clear-normal") guiSetVisible(RadioSystem,false) bindKey("m", "down", toggleGUI) local radioChannels = { ["Power 181"] = "http://www.181.fm/stream/asx/181-power.asx", ["Vibration 108"] = "http://www.vibration108.ch/listen.pls" } for k, v in pairs(radioChannels) do local row = guiGridListAddRow(RadioStationList) guiGridListSetItemText(RadioStationList, row, 1, k, false, false) end local isPlaying = false local currentRadio function playRadio() local r, c = guiGridListGetSelectedItem(RadioStationList) if (r == -1) then outputChatBox("Please select a station name to play from Radio Stations gridlist.", 200, 0, 0) return end local name = guiGridListGetItemText(RadioStationList, r, c) for k, v in pairs(radioChannels) do if k == name then currentRadio = playSound(v) isPlaying = true playingURL = v outputChatBox("Successfully started Radio: "..name, 0, 200, 0) return end end end addEventHandler("onClientGUIClick", RadioPlay, playRadio, false) function stopRadio() if (not isPlaying) then outputChatBox("No radio station is currently playing.", 200, 0, 0) return end stopSound(currentRadio) isPlaying = false outputChatBox("Successfully stopped radio!", 0, 200, 0) end addEventHandler("onClientGUIClick", RadioStop, stopRadio, false) function closeGUI() toggleGUI() end addEventHandler("onClientGUIClick", Closeradiowindow, closeGUI, false) Now you may add infinite Radio URLs in the table above, with this format: ["Radio Name"] = "http://radio.url/play.asx",
-
I don't get it, that spawn panel doesn't have anything to do with any group system? Can you please give me resource link of which group system is connected with this spawn panel? or maybe tell me what you want as a whole, with that group panel you provided? Maybe i can make spawn system of your choice for you...
-
Then issue could be with GUI ofcourse, can you tell me what exactly you are trying to do?
-
If urlVibration108 is working then that means .asx is wrong format, use .pls for radios. Otherwise tell me, i'll recheck whole code.
-
If you meant a simple event warps system, here is it i just made: local warpsON = false local eX, eY, eZ = 0, 0, 0 local eDim = 336 function startEvent(plr, cmd, ...) setElementDimension(plr, eDim) eX, eY, eZ = getElementPosition(plr) local msg = table.concat({...}, " ") outputChatBox("Event warps are now open, type /ewarp to get to the location.", root, 0, 200, 0) if (msg) and (#msg >= 2) then outputChatBox("Event Message: "..msg, root, 0, 150, 0) end warpsON = true end addCommandHandler("startevent", startEvent) function warpPlayers(plr) if (not warpsON) then outputChatBox("There is no event in progress right now!", plr, 200, 0, 0) return end spawnPlayer(plr, eX, eY, eZ) setElementDimension(plr, eDim) outputChatBox("Successfully joined Event!", plr, 0, 200, 0) end addCommandHandler("ewarp", warpPlayers) function stopEvent(plr) if (not warpsON) then outputChatBox("There is no event in progress right now!", plr, 200, 0, 0) return end warpsON = false eX, eY, eZ = 0, 0, 0 local eventPlrs = getElementsInDimension("player", 336) for k, v in pairs (eventPlrs) do setElementDimension(v, 336) outputChatBox("Event have been cancelled by "..plr, v, 200, 0, 0) end outputChatBox("Successfully stopped Event!", plr, 0, 200, 0) end addCommandHandler("stopevent", stopEvent) function getElementsInDimension(theType,dimension) local elementsInDimension = { } for key, value in ipairs(getElementsByType(theType)) do if getElementDimension(value)==dimension then table.insert(elementsInDimension,value) end end return elementsInDimension end ^Sever side code + i grabbed getElementsWithinDimension from wiki's useful functions. If that didn't worked or you didn't asked something like that, you may tell me in details, i'll try to remake a basic one again.
-
It should work, do /debugscript 3 ingame and then tell me output when you start script.
-
Add the code i gave, then add this anywhere in code: for i,v in ipairs (nameToID) do local row = guiGridListAddRow(carGridList) guiGridListSetItemText (carGridList, row, 1, i, false, true) guiGridListSetItemText (carGridList, row, 2, v, false, true) end Then change onClientGUIClick() function from your script with this: function onClientGUIClick (button, state, absoluteX, absoluteYe) if (source == buyButton) then guiSetVisible (carshopWindow, false) showCursor (false) if (guiGridListGetSelectedItem (carGridList)) then local carName = guiGridListGetItemText (carGridList, guiGridListGetSelectedItem (carGridList), 1) local carID = getIDFromCustomName(carName) local carCost = getPriceFromID(carID) triggerServerEvent ("carShopCarBuy", getLocalPlayer(), carID, carCost, carName) end elseif (source == closeButton) then guiSetVisible (carshopWindow, false) showCursor (false) end end addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick)
-
I didn't understand your issue, do you mean you wanna call price by vehicle ID/Name from table? You can try this: local nameToID = { ["VW Golf"] = 410, ["Subaru Impreza"] = 551, ["Yamaha Aerox"] = 448, -- ["Custom Name"] = ID From MTA SA, } local vehiclePrices = { [410] = 25000, [551] = 40000, [448] = 15000, -- [iD From MTA SA] = Price, } function getIDFromCustomName(name) if (not name) then return end for k, v in ipairs(nameToID) do if (k ~= name) then return end local id = nameToID[k] return id end end function getPriceFromID(id) if (not id) then return end for k, v in ipairs(vehiclePrices) do if (k ~= id) then return end local price = vehiclePrices[k] return price end end
