Chainsaw

Members
  • Content Count

    23
  • Joined

  • Last visited

Community Reputation

6 Neutral

1 Follower

About Chainsaw

  • Rank
    Civilian

Details

  • Gang
    Grove Street
  • Location
    Los Santos
  • Occupation
    distribute crack
  • Interests
    Music, blah blah

Recent Profile Visitors

905 profile views
  1. Cuando se compraban items online qué pasaba si al mismo tiempo estabas conectado en el servidor mirando el inventario? tengo ciertas dudas sobre eso acá en mta porque no he visto nada referente a sockets.
  2. Hola pequeña

    1. _Cipriano

      _Cipriano

      Yo se hasta cuando cagas papa

  3. really you did DDoS attacks? In SA: MP can do that freely, I'm really happy which MTA Team ban people for this
  4. with "?" you mean for ternaries? you could "simulate" operators
  5. Sorry, I still do not get used to the aesthetics of language change DestroyElement to destroyElement and change getElementID for getVehicleName (this vehicles not have id default)
  6. addEventHandler("onVehicleExplode", getRootElement(), function () if(not vehicleIsStatic(source)) then -- Not is vehicle from map outputChatBox("The vehicle ID: " .. getElementID(source) .. " was destroyed"); DestroyElement(source) end end)
  7. well, i did a test code: addCommandHandler("v", function(player, command) local v = getPedOccupiedVehicle(player); if (v) then local n = (not vehicleIsStatic(v)) and ("player") or ("map"); outputChatBox("This vehicle is from " .. n) else outputChatBox("you are't in a vehicle") end end) function vehicleIsStatic(element) if(getElementType(element) == "vehicle") then local tag = getElementID(element); if(tag and (string.find(tag, "server_"))) then return 1; end end end And yes, server-side! do not forget which this works with tag
  8. addCommandHandler("test", function(player, command) local v = getPedOccupiedVehicle(player); if (v) then outputChatBox("This vehicle is from " .. (vehicleIsStatic(v)) and "map" or "player", player) end end) function vehicleIsStatic(element) if(getElementType(element) == "vehicle") then local tag = getElementID(element); if(tag and (string.find(tag, "server_"))) then return 1; end end end
  9. In your .map vehicles you have something like: <vehicle id="vehicle (Buffalo) (3)" paintjob="3" interior="0" alpha="160" model="405" plate="INT6 8C7" dimension="0" posX="1802.0996" posY="-1932.990" posZ="13.2" rotX="0" rotY="0" rotZ="0" color="45,58,53,159,157,148,0,0,0,0,0,0"></vehicle> Change to <vehicle id="server_vehicle (Buffalo) (3)" paintjob="3" interior="0" alpha="160" model="405" plate="INT6 8C7" dimension="0" posX="1802.0996" posY="-1932.990" posZ="13.2" rotX="0" rotY="0" rotZ="0" color="45,58,53,159,157,148,0,0,0,0,0,0"></vehicle> and in the script function vehicleIsStatic(element) if(getElementType(element) == "vehicle") local tag = ''; if(tag = getElementID(element)) if(string.find(tag, "server_")) return 1; end end end end if that function return 1 the vehicle from map This is a form that I can think of, I do not know if there is an official way
  10. I imagine you can do this by setting variables when creating a vehicle, another way I can think of is to assign a tag following the ID in a specific way to the map vehicles and then get the string from getElementID Example: id="Uranus 5" to id="server_Uranus 5" and check if the vehicle belongs to map with string.find
  11. I doubt that it is hate. This is the line of everything, I know that there are people who still want to give life to XP but that is very subjective .. If we talk about objectivity XP takes the same course as everything you need to get rid of your old structures, really is very hard for you go to Win 7?
  12. Actualice el recurso, la función dateToUnix tenía un bug en la conversión de tiempo ______________________ Por cierto, lo que está en la imagen de presentación del tema se puede lograr así: local time = getRealTime(); local day, month, year = time.monthday, time.month + 1, time.year + 1900; for i=1,getRemaningDaysInYear(day, month, year) do local d, m, y = getDateInAdd(day, month, year, i, 0, 0) outputServerLog(string.format("In +%i days will be: %s %i, %i (%s)", i, getMonthName(m), d, y, getWeekDay(d, m, y))) end Dicho script te dirá qué día de la semana serán todos los días del año que restan según el año en que estés
  13. Introducción Este recurso es una ayuda a los programadores que busquen tener un control más amplio del tiempo! Funciones: getWeekDay getMonthDays getMonthName getYearDays getRemaningDaysInYear getSpentsDaysInYear dateToUnix unixToDate getDateInAdd Ejemplos string getWeekDay(day, month, year) Permite obtener qué día de la semana es la fecha específicada (Su funcionamiento es puramente matemático, para conocer más sobre su funcionamiento https://en.wikipedia.org/wiki/Zeller's_congruence) outputchatBox(getWeekDay(13, 11, 2016)); -- output: Domingo int getMonthDays(month, year) Obtiene la cantidad de días de cierto mes tomando en cuenta los años biciestos (razón por la cual es obligatorio el argumento) local days = getMonthDays(2, 2016) -- Año biciesto -- days contains: 29, local days = getMonthDays(2, 2017) -- Año normal -- days contains: 28, string getMonthName(month) Obtiene el nombre del mes especificado local n = getMonthName(11) -- n contains: Noviembre int getYearDays(year) Obtiene la cantidad de días del año especificado incluyendo los días al ser año biciesto local n = getYearDays(2016) -- n contains: 366 local n = getYearDays(2015) -- n contains: 365 int getRemaningDaysInYear(day, month, year) Obtiene la cantidad de días que faltan en el año según los datos especificados local n = getRemaningDaysInYear(13, 11, 2016) -- n contains: 48 int getSpentsDaysInYear(day, month, year) Obtiene la cantidad de días que han pasado en el año según los datos especificados local n = getSpentsDaysInYear(13, 11, 2016) -- n contains: 318 int dateToUnix(day, month, year) Convierte el día, año y mes al tiempo unix para tener un mayor control de éste mediante el unixtime (https://es.wikipedia.org/wiki/Tiempo_Unix) local time = dateToUnix(13, 11, 2016) -- time contains: 1512864000 int, int, int unixToDate(unixtime) Convierte el unixtime a datos leibles local day, month, year = unixToDate(1512864000); --- days, mounth, year contains: 13, 11, 2016 int, int, int getDateInAdd(_day, _month, _year, days, months, years) Añade días a una fecha especificada y obtiene la fecha con los días, meses y años añadidos siguendo el formato del calendario (añades 20 días siendo 12 de diciembre de 2016 te dará) 1, enero 2017 sin alterar el orden local d, m, y = getDateInAdd(13, 11, 2016, 2, 0, 0); outputServerLog(getWeekDay(d, m, y)) -- output: Martes (15) ya que Domingo (13) meta.xml Todas las funciones pueden ser exportadas, para poner el resource en español configurar en el meta.xml <setting name="*Lang" value="[1]"/> -- Cambiar a <setting name="*Lang" value="[2]"/> Link de del recurso -> https://github.com/iZume/time-functions-LUA/archive/master.zip
  14. Chainsaw

    speaker

    Where do you want to spawn the object?
  15. Hello, i am new in this world.. But i believe i can help you: Well, so i'll try explain some things.. as you do know MTA is client-server, so your need to make this system use both sides, why? playSound3D is a function a client side and your need access to that from the server side.. Example, this is a command in server side: addCommandHandler("play", function(player, cmd, ...) if(getElementData(player, "players:admin") == true) then if(getElementData(player, "playing") == true) then triggerClientEvent(root, "client:stopSound", root); setElementData(player, "playing", false); outputChatBox("Sound stopped!", player); else local url = table.concat({...}, " "); local x, y, z = getElementPosition(player); triggerClientEvent(root, "client:playSound", root, x, y, z, url); setElementData(player, "playing", true); outputChatBox("You're listening: " .. url, player); end end end); and put this in client-side addEvent("client:playSound", true) addEventHandler("client:playSound", root, function (x, y, z, ...) local url = table.concat({...}, " "); clientSpeaker = playSound3D(url, x, y, z); end) addEvent("client:stopSound", true) addEventHandler("client:stopSound", root, function () stopSound(clientSpeaker) end) you only need change getElementData(player, "players:admin") for your admin variable or change for your function, etc.. if you have any question, do it.