Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    40

Everything posted by myonlake

  1. Hashing is a way, yes. You can also do an additional file match check by reading the bytes and matching them together. Hashing is the usual way, and MTA uses CRC32 for the automatically downloaded files. Keep this in mind (quote from CRC Wikipedia article):
  2. You should use the function MADEX linked you. Also, is this your code or is it leaked or stolen? Seems as if you can't script and ask for help with code that you don't necessarily have anything to do with.
  3. You can use setTimer to delay the stop. You can use variables to define whether the timer is running and if the sound is playing, this way you won't get issues with multiple sounds and multiple timers and such. You can use the code below. local secondsToWait = 10 local soundElement, soundTimer function clickPanelButton(button, state) if (button == "left") and (state == "up") then local element = getElementData(localPlayer, "clickedButton") if (element) then local info = getElementData(element, "info") if (info) then if (info == "login") then local username = guiGetText(Login_Edit[1]) local password = guiGetText(Login_Edit[2]) if (tostring(username) ~= "") and (tostring(password) ~= "") then triggerServerEvent("onClientSendLoginDataToServer", localPlayer, username, password) else reason = "Missing password or username." outputChatBox("[Login]:#FF9900 " .. reason, 255, 255, 255, true) end elseif (info == "intro") then if (not soundElement) then -- If there is no sound playing yet soundElement = playSound("Sounds/Intro.mp3") -- Define and play the sound else if (not soundTimer) then -- If there is no timer yet soundTimer = setTimer(function() -- Create a new timer if (isElement(soundElement)) then -- Check if the sound exists destroyElement(soundElement) -- Destroy the sound soundElement, soundTimer = nil -- Reset the variables end end, secondsToWait*1000, 1) -- Wait for the amount of seconds defined in 'secondsToWait' end end elseif (info == "guest") then showLoginWindow(false) elseif (info == "register") then local username = guiGetText(Login_Edit[3]) local pass1 = guiGetText(Login_Edit[4]) local pass2 = guiGetText(Login_Edit[5]) if (tostring(username) ~= "") then if (tostring(pass1) ~= "") then if (pass1 == pass2) then triggerServerEvent("onClientSendRegisterDataToServer", localPlayer, username, pass1) else reason = "Passwords don't match." outputChatBox("[Register]:#FF9900 " .. reason, 255, 255, 255, true) end else reason = "No password was entered." outputChatBox("[Register]:#FF9900 " .. reason, 255, 255, 255, true) end else reason = "No username was entered." outputChatBox("[Register]:#FF9900 " .. reason, 255, 255, 255, true) end end end end end end addEventHandler("onClientClick", root, clickPanelButton) By the way, you had some unnecessary do statements there, you don't need those, I doubt it would even work since you need some form of loop to even use do statement in the first place.
  4. 1.25 GB is pretty okay, I think you can run a server with 100 players or more with that. I myself have 4 GB in total on my home computer and 1/4 (or less) of it is used for MTA and I can run a decent server with that, so I guess you won't have to worry about that.
  5. 128 MB of RAM is very little for any system, you should at least have 1024 MB of RAM to be able to run properly. I don't know about slot amounts, but most likely less than 40-50, maybe even a lot lower than that. 128 MB is just so little amount of RAM.
  6. And what is the pay exactly, what scripts for what? Please, when making these threads explain your needs. "I need scripter" doesn't explain us anything.
  7. His functions are wrong, those are unrelated to the case. Use getSoundMetaTags.
  8. myonlake

    onPlayerChat

    Like Bonsai said, remove all spaces before you perform a string length check. That way you will know the real length of the message.
  9. myonlake

    Bugs :x

    Those are a few clicks away from fixing, why not look at your own code and fix them yourself instead of giving us the code and error logs, we don't give a single duck about your problems if you don't put any effort to it yourself. You didn't even explain the problem, even though you put the error logs. This is not a place for you to just drop in such errors, if you've scripted anything in your life you'd know exactly what those errors mean. This is a disgrace. We spend time helping people with issues that they've faced, but they're rarely as simple problems like these. Look at the errors, find the lines and think what's wrong. The errors are in plain English, we're not bug fixers, you're the bug fixer as it's your code.
  10. myonlake

    Solved

    Because you are always re-defining the endTick variable. You have to make sure endTick is nil before you set it. local sWidth, sHeight = guiGetScreenSize( ) local show = false local tick = getTickCount( ) local endTick = nil addEventHandler( "onClientRender", root, function( ) if ( getTickCount( ) - tick >= 300000 ) then show = true if ( not endTick ) then endTick = getTickCount( ) + 30000 end if ( getTickCount( ) >= endTick ) then show = false endTick = nil tick = getTickCount( ) end end if ( show ) then dxDrawImage( ( sWidth / 2 ) - 250, sHeight - sHeight - 15, 160, 140, "images/HubbubGames.png", 0, 0, 0, tocolor( 255, 255, 255, 255 ), false ) dxDrawImage( ( sWidth / 2 ) + 90, sHeight - sHeight - 15, 160, 140, "images/HubbubGames.png", 0, 0, 0, tocolor( 255, 255, 255, 255 ), false ) dxDrawLine( ( sWidth / 2 + 120), sHeight - sHeight + 65, (sWidth / 2 - 120 ), sHeight - sHeight + 65, tocolor( 255, 255, 255, 255 ), 1, false ) dxDrawText( "Welcome To", ( sWidth / 2 ), 0, ( sWidth / 2 ), 31, tocolor( 255, 255, 255, 255 ), 1.00, "bankgothic", "center", "top", false, false, false ) dxDrawText( "Hubbub Games", ( sWidth / 2 ), 31, ( sWidth / 2 ), 62, tocolor( 255, 255, 255, 255 ), 1.00, "bankgothic", "center", "top", false, false, false ) dxDrawText( "New Forum Adress:", ( sWidth / 2 ), 72, ( sWidth / 2 ), 89, tocolor( 255, 255, 255, 255 ), 1.00, "default-bold", "center", "top", false, false, false ) dxDrawText( "www.HubbubGames.com", ( sWidth / 2 ), 89, ( sWidth / 2 ), 106, tocolor( 255, 255, 255, 255 ), 1.00, "default-bold", "center", "top", false, false, false ) end end ) Also, keep in mind that you are always resetting the tick. You should make a variable defining if the thing has been shown already to the client, and if it has, then don't show it again (unless you want to repeatedly keep showing the welcome menu to the client). Or then simply just put the addEventHandler in somewhere and call for removeEventHandler after a while, this way you won't keep rendering blanks.
  11. myonlake

    Bug

    You are welcome.
  12. myonlake

    Bug

    Ugh, you didn't close all brackets, had less arguments than you were supposed to have and it was a full mess. Please try to read your code and see what's happening... Server-side local pArea = createRadarArea( 1295.8083496094, 2101.6123046875, 60, 60, 255, 255, 255 ) local pCuboid = createColCuboid( 1343.0024414063, 2159.3093261719, 10, 197.5, 92, 90 ) addEventHandler( "onResourceStart", resourceRoot, function( ) outputDebugString( "Villa do Colete.", 3 ) end ) addEventHandler("onColShapeHit", pCuboid, function( hitElement, matchingDimension ) if ( getElementType( hitElement ) ~= "player" ) or ( not matchingDimension ) then return end local playerTeam = getPlayerTeam( hitElement ) if ( not playerTeam ) then triggerClientEvent( hitElement, "group", hitElement ) else local teamName = getTeamName( playerTeam ) local iR, iG, iB = getTeamColor( playerTeam ) local rR, gG, bB = getRadarAreaColor( pArea ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent( hitElement, "friendly", hitElement ) else setRadarAreaFlashing( pArea, true ) outputChatBox( "#F08080[GANG-ZONAS] #F8F8FFA gang " .. teamName .. " esta atacando a gang / no Gang Zona Baseball!", root, 255, 255, 255, true ) triggerClientEvent( hitElement, "time", hitElement ) triggerClientEvent( hitElement, "countdown", hitElement ) pArea1Timer = setTimer( function( player ) if ( not isElement( pArea ) ) or ( not isElement( player ) ) then return end setRadarAreaColor( pArea, iR, iG, iB, 255 ) givePlayerMoney( hitElement, 4000 ) outputChatBox( "#F08080[GANG-ZONAS] #F8F8FFA gang " .. teamName .. " dominou o #ff0000 Baseball #F8F8FFA da gang!", root, 255, 255, 255, true ) setRadarAreaFlashing( pArea, false ) end, 5000, 1, hitElement ) end end end )
  13. You can use the onClientRender function in combination of setPedAimTarget, getElementsByType, getElementPosition and getDistanceBetweenPoints3D. It won't be too accurate for all players, but it's enough I suppose. You can later make a col shape around the pedestrian and when someone hits it, just shoot the person till they're dead.
  14. Eh, you had two functions, one of them you didn't even end properly, and the function was totally unnecessary anyways. Also, getRootElement does not have to be initialized as a variable, because "root" is a pre-defined variable already. Try the following. Server-side local countryNames = { [ "AF" ] = "Afghanistan", [ "AS" ] = "American Samoa", [ "AU" ] = "Australia", [ "AO" ] = "Anqola", [ "AI" ] = "Anquilla", [ "AQ" ] = "Antarctica", [ "AG" ] = "Antigua and Barbuda", [ "AR" ] = "Argentina", [ "AM" ] = "Armenia", [ "AW" ] = "Aruba", [ "AT" ] = "Austria", [ "AZ" ] = "Azerbaijan", [ "BS" ] = "Bahamas", [ "BH" ] = "Bahrain", [ "BD" ] = "Bangladesh", [ "BB" ] = "Barbados", [ "BY" ] = "Belarus", [ "BE" ] = "Belgium", [ "BZ" ] = "Belize", [ "BJ" ] = "Benin", [ "BM" ] = "Bermuda", [ "BT" ] = "Bhutan", [ "BO" ] = "Bolivia", [ "BA" ] = "Bosnia", [ "BH" ] = "Herzegovina", [ "BW" ] = "Botswana", [ "BR" ] = "Brazil", [ "IO" ] = "British Indian Ocean Territory", [ "VG" ] = "British Virgin Islands", [ "BN" ] = "Brunei", [ "BG" ] = "Bulgaria", [ "BF" ] = "Burkina Faso", [ "MM" ] = "Burma (Myanmar)", [ "BI" ] = "Burundi", [ "KH" ] = "Cambodia", [ "CM" ] = "Cameroon", [ "CA" ] = "Canada", [ "CV" ] = "Cape Verde", [ "KY" ] = "Cayman Islands", [ "CF" ] = "Central African Republic", [ "TD" ] = "Chad", [ "CL" ] = "Chile", [ "CN" ] = "China", [ "CX" ] = "Christmas Island", [ "CC" ] = "Cocos (Keeling) Islands", [ "CO" ] = "Colombia", [ "KM" ] = "Comoros", [ "CK" ] = "Cook Islands", [ "CR" ] = "Costa Rica", [ "HR" ] = "Croatia", [ "CU" ] = "Cuba", [ "CY" ] = "Cyprus", [ "CZ" ] = "Czech Republic", [ "CD" ] = "Democratic Republic of the Congo", [ "DK" ] = "Denmark", [ "DJ" ] = "Djibouti", [ "DM" ] = "Dominica", [ "DO" ] = "Dominican Republic", [ "EC" ] = "Ecuador", [ "SV" ] = "El Salvador", [ "GQ" ] = "Equatorial Guinea", [ "ER" ] = "Eritrea", [ "EE" ] = "Estonia", [ "ET" ] = "Ethiopia", [ "FK" ] = "Falkland Islands", [ "FO" ] = "Faroe Islands", [ "FJ" ] = "Fiji", [ "FI" ] = "Finland", [ "FR" ] = "France", [ "PF" ] = "French Polynesia", [ "GA" ] = "Gabon", [ "GM" ] = "Gambia", [ "GE" ] = "Georgia", [ "DE" ] = "Germany", [ "GH" ] = "Ghana", [ "GI" ] = "Gibraltar", [ "GR" ] = "Greece", [ "GL" ] = "Greenland", [ "GD" ] = "Grenada", [ "GU" ] = "Guam", [ "GT" ] = "Guatemala", [ "GN" ] = "Guinea", [ "GW" ] = "Guinea-Bissau", [ "GY" ] = "Guyana", [ "HT" ] = "Haiti", [ "VA" ] = "Holy See (Vatican City)", [ "HN" ] = "Honduras", [ "HK" ] = "Hong Kong", [ "HU" ] = "Hungary", [ "IS" ] = "Iceland", [ "IN" ] = "India", [ "ID" ] = "Indonesia", [ "IR" ] = "Iran", [ "IQ" ] = "Iraq", [ "IE" ] = "Ireland", [ "IM" ] = "Isle of Man", [ "IL" ] = "Israel", [ "IT" ] = "Italy", [ "CI" ] = "Ivory Coast", [ "JM" ] = "Jamaica", [ "JP" ] = "Japan", [ "JE" ] = "Jersey", [ "JO" ] = "Jordan", [ "KZ" ] = "Kazakhstan", [ "KE" ] = "Kenya", [ "KI" ] = "Kiribati", [ "KO" ] = "Kosovo", [ "KW" ] = "Kuwait", [ "KG" ] = "Kyrgyzstan", [ "LA" ] = "Laos", [ "LV" ] = "Latvia", [ "LB" ] = "Lebanon", [ "LS" ] = "Lesotho", [ "LR" ] = "Liberia", [ "LY" ] = "Libya", [ "LI" ] = "Liechtenstein", [ "LT" ] = "Lithuania", [ "LU" ] = "Luxembourg", [ "MO" ] = "Macau", [ "MK" ] = "Macedonia", [ "MG" ] = "Madagascar", [ "MW" ] = "Malawi", [ "MY" ] = "Malaysia", [ "MV" ] = "Maldives", [ "ML" ] = "Mali", [ "MT" ] = "Malta", [ "MH" ] = "Marshall Islands", [ "MR" ] = "Mauritania", [ "MU" ] = "Mauritius", [ "YT" ] = "Mayotte", [ "MX" ] = "Mexico", [ "FM" ] = "Micronesia", [ "MD" ] = "Moldova", [ "MC" ] = "Monaco", [ "MN" ] = "Mongolia", [ "ME" ] = "Montenegro", [ "MS" ] = "Montserrat", [ "MA" ] = "Morocco", [ "MZ" ] = "Mozambique", [ "NA" ] = "Namibia", [ "NR" ] = "Nauru", [ "NP" ] = "Nepal", [ "NL" ] = "Netherlands", [ "AN" ] = "Netherlands Antilles", [ "NC" ] = "New Caledonia", [ "NZ" ] = "New Zealand", [ "NI" ] = "Nicaragua", [ "NE" ] = "Niger", [ "NG" ] = "Nigeria", [ "NU" ] = "Niue", [ "NI" ] = "Norfolk Island", [ "KP" ] = "North Korea", [ "MP" ] = "Northern Mariana Islands", [ "NO" ] = "Norway", [ "OM" ] = "Oman", [ "PK" ] = "Pakistan", [ "PW" ] = "Palau", [ "PA" ] = "Panama", [ "PG" ] = "Papua New Guinea", [ "PY" ] = "Paraguay", [ "PE" ] = "Peru", [ "PH" ] = "Philippines", [ "PN" ] = "Pitcairn Islands", [ "PL" ] = "Poland", [ "PT" ] = "Portugal", [ "PR" ] = "Puerto Rico", [ "QA" ] = "Qatar", [ "CG" ] = "Republic of the Congo", [ "RO" ] = "Romania", [ "RU" ] = "Russia", [ "RW" ] = "Rwanda", [ "BL" ] = "Saint Barthelemy", [ "SH" ] = "Saint Helena", [ "KN" ] = "Saint Kitts and Nevis", [ "LC" ] = "Saint Lucia", [ "MF" ] = "Saint Martin", [ "PM" ] = "Saint Pierre and Miquelon", [ "VC" ] = "Saint Vincent and the Grenadines", [ "WS" ] = "Samoa", [ "SM" ] = "San Marino", [ "ST" ] = "Sao Tome and Principe", [ "SA" ] = "Saudi Arabia", [ "SN" ] = "Senegal", [ "RS" ] = "Serbia", [ "SC" ] = "Seychelles", [ "SL" ] = "Sierra Leone", [ "SG" ] = "Singapore", [ "SK" ] = "Slovakia", [ "SI" ] = "Slovenia", [ "SB" ] = "Solomon Islands", [ "SO" ] = "Somalia", [ "ZA" ] = "South Africa", [ "KR" ] = "South Korea", [ "ES" ] = "Spain", [ "LK" ] = "Sri Lanka", [ "SD" ] = "Sudan", [ "SR" ] = "Suriname", [ "SJ" ] = "Svalbard", [ "SZ" ] = "Swaziland", [ "SE" ] = "Sweden", [ "CH" ] = "Switzerland", [ "SY" ] = "Syria", [ "TW" ] = "Taiwan", [ "TJ" ] = "Tajikistan", [ "TZ" ] = "Tanzania", [ "TH" ] = "Thailand", [ "TL" ] = "Timor-Leste", [ "TG" ] = "Togo", [ "TK" ] = "Tokelau", [ "TO" ] = "Tonga", [ "TT" ] = "Trinidad and Tobago", [ "TN" ] = "Tunisia", [ "TR" ] = "Turkey", [ "TM" ] = "Turkmenistan", [ "TC" ] = "Turks and Caicos Islands", [ "TV" ] = "Tuvalu", [ "UG" ] = "Uganda", [ "UA" ] = "Ukraine", [ "AE" ] = "United Arab Emirates", [ "GB" ] = "United Kingdom", [ "US" ] = "United States", [ "UY" ] = "Uruguay", [ "VI" ] = "US Virgin Islands", [ "UZ" ] = "Uzbekistan", [ "VU" ] = "Vanuatu", [ "VE" ] = "Venezuela", [ "VN" ] = "Vietnam", [ "WF" ] = "Wallis and Futuna", [ "WB" ] = "West Bank", [ "EH" ] = "Western Sahara", [ "YE" ] = "Yemen", [ "ZM" ] = "Zambia", [ "ZW" ] = "Zimbabwe" } addEventHandler( "onPlayerQuit", root, function( ) outputChatBox( "* " .. getPlayerName( source ) .. " from " .. tostring( countryNames[ exports.admin:getPlayerCountry( source ) ] ) .. " has left the game (" .. quitReason .. ")", root, 97, 255, 19, false ) end )
  15. You can use the following functions to do this. getAccounts getAccountName getPlayerName getPlayerSerial addAccount setAccountData getAccountData logIn And then use the onPlayerJoin event to trigger the function of yours.
  16. You had a few typos and a couple wrong arguments, try this one. Server-side addEventHandler( "onResourceStart", resourceRoot, function( ) local ped = createPed( 191, 2493.623, -1668.179, 13.343, 90 ) setTimer( function( ped ) if ( not isElement( ped ) ) then return end giveWeapon( ped, 22, 9999, true ) triggerClientEvent( root, "onPedControl", ped ) end, 100, 1, ped ) end ) Client-side addEvent( "onPedControl", true ) addEventHandler( "onPedControl", root, function( ) setPedControlState( source, "fire", true ) end )
  17. You can use the isVehicleOnGround function.
  18. I suggest you use the logIn functionality that comes internally with MTA. People can have dynamic IP addresses, which will be difficult if you have a different IP one time, and another next time, then you can't log in because you have the wrong IP address.
  19. Correction to your serial comment; serials are bound to the hardware, not the software.
  20. dbQuery also returns information, while dbExec just returns a boolean whether the execution was successful or not. dbQuery returns possible selected rows, number of affected rows and last insert id (alternatively error code and error message), which are useful sometimes when executing insert statements and you want to know the auto-incremented ID.
  21. myonlake

    Question

    Because there's no element called "customVehicle". You have to put "Maverick" there, and then make the same function for each vehicle individually. The best way to do this is that you create an array of vehicle information, and then loop through and spawn each vehicle with the loop so that the code looks cleaner.
×
×
  • Create New...