Jump to content

ADCX

Members
  • Posts

    79
  • Joined

  • Last visited

Everything posted by ADCX

  1. ADCX

    Table Problem...

    Keep in mind, that to this script to work all 3 teams must exist, and player must be in one of them. If I were you I'd change that.
  2. Yes, but he wants to edit MTA resource before he starts MTA, not while running. Resources don't get re-downloaded every time you connect to server. MTA has a system to check the validity of the files if they are actually the ones on the server.
  3. ADCX

    Progressbar

    How about guiCreateProgressBar ? https://wiki.multitheftauto.com/wiki/Gu ... rogressBar
  4. ADCX

    Table Problem...

    local barrier = {} function consoleCreateObject(thePlayer,commandName) if (commandName == "barrier") then local SAPD = getTeamFromName("SAPD") if (SAPD) then local ArmedForces = getTeamFromName("Armed Forces") if (ArmedForces) then local SWAT = getTeamFromName("SWAT") if (SWAT) then if (getPlayerTeam(thePlayer) == SAPD) or (getPlayerTeam(thePlayer) == ArmedForces) or (getPlayerTeam(thePlayer) == SWAT) then local x,y,z = getElementPosition(thePlayer) local _,_,rz = getElementRotation(thePlayer) local Object = createObject(3091,x,y,z - 0.5,0,0,rz) setElementPosition(thePlayer,x,y,z + 1) local PBar = barrier[thePlayer] if not (PBar) then barrier[thePlayer] = {} PBar = {} end if not (PBar[1]) then PBar[1] = Object elseif not (PBar[2]) then PBar[2] = Object elseif not (PBar[3]) then PBar[3] = Object elseif not (PBar[4]) then PBar[4] = Object else destroyElement(PBar[1]) PBar[1] = PBar[2] PBar[2] = PBar[3] PBar[3] = PBar[4] PBar[4] = Object end barrier[thePlayer] = PBar end end end end end addCommandHandler("barrier", consoleCreateObject) function fncPlayerQuit() local PBar = barrier[source] barrier[source] = nil if (PBar[1]) then destroyElement(PBar[1]) end if (PBar[2]) then destroyElement(PBar[2]) end if (PBar[3]) then destroyElement(PBar[3]) end if (PBar[4]) then destroyElement(PBar[4]) end end addEventHandler("onPlayerQuit",getRootElement(),fncPlayerQuit) I forgot to put 'barrier' in double quotes. It should work now.
  5. I think that MTA checks the file size and MD5 hash (or some other encryption) to assure that you have the latest up to date version of file and also to check that you've not changed the file. So then to pass it, firstly you will have to make the file have same size as the original: -- Original: outputChatBox("Not Cheating") -- Change to: outputChatBox("-_Cheating_-") It has same amount of characters, so the size should be the same, but the bigger problem is to bypass encryption check. If the script is long, the bigger chance is that the encryption will be the same (since MD5 like the other encryptions don't archive all of the data into the small string they represent, they use the some part of it). http://en.wikipedia.org/wiki/MD5 Check it to find how this encryption works to see if it will work for you.
  6. CarNames = {[603] = "Shelby",[474] = "Mercedes E500", [411] = "Lamborghini Veneno"} function findVehicleName(theVehicle) if (type(CarNames[getElementModel(theVehicle)]) == "string") then return CarNames[getElementModel(theVehicle)] else return getVehicleNameFromModel(getElementModel(theVehicle)) end end function VehicleEnter(Player) outputChatBox("You entered the " .. findVehicleName(source) .. "!",Player) end addEventHandler("onVehicleEnter",getRootElement(),VehicleEnter) Just try this, if it doesn't work, you are doing something wrong.
  7. New version released: 1.0.4 Changes: - Fixed the list of players possible to be invited to gang - Fixed team hiding when there are no it's members online
  8. your welcome . It is: You're welcome*
  9. CarNames = {[603] = "Shelby",[474] = "Mercedes E500", [411] = "Lamborghini Veneno"} function findVehicleName(theVehicle) return CarNames[getElementModel(theVehicle)] end
  10. CustomVehicleNames = {[470] = "1993 Hummer H1", [411] = "1992 Acura NSX"}
  11. CustomVehicleNames = {[429] = "Banshee Alternate Name"} -- Fill with vehicle IDs and custom names setPlayerHudComponentVisible("vehicle_name",false) localPlayer = getLocalPlayer() function carshop_showInfo(carPrice, taxPrice) local isOverlayDisabled = getElementData(localPlayer, "hud:isOverlayDisabled") if isOverlayDisabled then outputChatBox("") outputChatBox("As you walk by the vehicle, you notice a card in the sidewindow. It reads the following:") --outputChatBox(" --------------------------------------") outputChatBox("| "..getVehicleNameFromModel( getElementModel( source ) ) ) outputChatBox("| Now available for $"..exports.global:formatMoney(carPrice).."!" ) outputChatBox("| Tax costs: $"..tostring(taxPrice) ) --outputChatBox(" --------------------------------------") outputChatBox("Press F or Enter to buy this vehicle") else local content = {} table.insert(content, {"Car Dealership - Paper Sheet", false, false, false, false, false, false, "title"} ) table.insert(content, {" " } ) table.insert(content, {" - MTA Model: "..getVehicleNameFromModel( getElementModel( source ) ) } ) table.insert(content, {" - Custom Model:"}) table.insert(content, {" - " ..getVehicleCustomName( getElementModel( source ) ) } ) table.insert(content, {" - Price: $"..exports.global:formatMoney(carPrice) } ) table.insert(content, {" - Tax: $"..exports.global:formatMoney(taxPrice) } ) table.insert(content, {"Press 'F' or 'Enter' to purchase!" } ) exports.hud:sendTopRightNotification( content, localPlayer, 240) end end addEvent("carshop:showInfo", true) addEventHandler("carshop:showInfo", getRootElement(), carshop_showInfo) function getVehicleCustomName(VehicleID) return CustomVehicleNames[VehicleID] end function VehicleEnter(thePlayer) if (thePlayer == localPlayer) then outputChatBox("You have entered " .. getVehicleCustomName(getElementModel(source))) -- Change to some DX or GUI that will show the custom car name end end addEventHandler("onClientVehicleEnter",getRootElement(),VehicleEnter)
  12. ADCX

    Table Problem...

    Server: local barrier = {} function consoleCreateObject(thePlayer,commandName) if (commandName == barrier) then local SAPD = getTeamFromName("SAPD") if (SAPD) then local ArmedForces = getTeamFromName("Armed Forces") if (ArmedForces) then local SWAT = getTeamFromName("SWAT") if (SWAT) then if (getPlayerTeam(thePlayer) == SAPD) or (getPlayerTeam(thePlayer) == ArmedForces) or (getPlayerTeam(thePlayer) == SWAT) then local x,y,z = getElementPosition(thePlayer) local _,_,rz = getElementRotation(thePlayer) local Object = createObject(3091,x,y,z - 0.5,0,0,rz) setElementPosition(thePlayer,x,y,z + 1) local PBar = barrier[thePlayer] if not (PBar) then barrier[thePlayer] = {} PBar = {} end if not (PBar[1]) then PBar[1] = Object elseif not (PBar[2]) then PBar[2] = Object elseif not (PBar[3]) then PBar[3] = Object elseif not (PBar[4]) then PBar[4] = Object else destroyElement(PBar[1]) PBar[1] = PBar[2] PBar[2] = PBar[3] PBar[3] = PBar[4] PBar[4] = Object end barrier[thePlayer] = PBar end end end end end addCommandHandler("barrier", consoleCreateObject) function fncPlayerQuit() local PBar = barrier[source] barrier[source] = nil if (PBar[1]) then destroyElement(PBar[1]) end if (PBar[2]) then destroyElement(PBar[2]) end if (PBar[3]) then destroyElement(PBar[3]) end if (PBar[4]) then destroyElement(PBar[4]) end end addEventHandler("onPlayerQuit",getRootElement(),fncPlayerQuit) Your English is poor, but I understood what you meant (barely). Add this to your server-side. Also I formatted your code to be more understandable and fixed some other stuff.
  13. Add me if you are still looking for one. My Skype username is: anthonyadcx
  14. I think this is what are you talking about: https://wiki.multitheftauto.com/wiki/Dx ... reenSource
  15. New version released: 1.0.3 Changes: - Fixed server export functions - Added option to disable gang's money panel
  16. Hi, I'm kinda in a need of money right now, so I have started to script requests for money (Paypal only). If you're interested, you can PM me here or add me on Skype ( anthonyadcx ).
  17. I have just sold the open-source version to CrosRoad95, if anyone else is interested, PM me.
  18. Aoeu, thanks for your support, and it is true that this script has some bugs in it, since it was not tested completely, but I'm working on an big update with new features and bug fixes which will be released really soon.
  19. local Timer = nil Timer = setTimer(function(myTimer) if (health > 0 and health < 50) then --execute code here else killTimer(myTimer) end end, 1000, 0,Timer) Try this, but I'm not sure if it'll work, because it doesn't say if setTimer uses live variable, or just what that variable represented for that time.
  20. Why not just do this, instead of all of these complications. function MyFunction() setTimer(function() -- Your code here end,1000,10) end
  21. That only changes the source of event that is triggered, so in first case it would be resource's root element, while in the other it would be regular root element (containing all other elements). I don't think this affects the efficiency at all, unless you are trying to parse some element as source, then it depends on what do you put as source.
  22. Have you tried setting it for all three weapon skills?
  23. This is actually impossible to do, because the passed variable will always be the one before the timer declaration. You should just put the function outside the timer.
×
×
  • Create New...