Jump to content

xPipeZ

Members
  • Posts

    12
  • Joined

  • Last visited

Details

  • Gang
    Grove Street

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

xPipeZ's Achievements

Square

Square (6/54)

0

Reputation

  1. Hi Dragster, what have you tried? I don't think anyone here is going to write code for you for free. However, if you have already installed some mods on your server I recommend that you inspect the code they implement and read the documentation of the functions in the MTA wiki. As AngelAlpha said all you need is engineLoadTXD and engineImportTXD.
  2. Hello, I'm answering this post because I asked myself the same question and I would like to know if so far someone else has achieved what is explained here. I was experimenting with some things and in a certain way I achieved something with a little code, but nevertheless I don't know if what I am doing can affect the performance of a server (for example with +100 players online). In the same way, this approach has a small error and that is that when a user enters the server and vehicles have already been created with this method, the custom skins will not be seen, otherwise it works well (I tried it on a local server with a friend). I would like to know the opinion of someone else. I'm not too expert in Lua so I apologize if I'm doing something wrong haha. Here's my code: -- server.lua resourceRoot = getResourceRootElement(getThisResource()) function createBike(playerSource, commandName, model) if model == 'dt-175' or model == 'dr-650' then local x, y, z = getElementPosition(playerSource) local vehicle = createVehicle(468, x + 0.5, y, z + 0.5) triggerClientEvent('setBikeModel', resourceRoot, vehicle, model) else outputChatBox('You should specify a valid model. (\'dt-175\' or \'dr-650\')', playerSoruce) end end addCommandHandler('createBike', createBike, false, false) -- client.lua resourceRoot = getResourceRootElement(getThisResource()) function setBikeModel(vehicle, model) local txd = engineLoadTXD('models/' .. model .. '.txd') local dff = engineLoadDFF('models/' .. model .. '.dff') local bike = engineRequestModel('vehicle', 468) engineImportTXD(txd, bike) engineReplaceModel(dff, bike) setElementModel(vehicle, bike) end addEvent('setBikeModel', true) addEventHandler('setBikeModel', resourceRoot, setBikeModel)
  3. Nope, this will only draw first two checkpoints, thans for answering anyway!
  4. Hello everyone, I am currently developing a small radar for racing but I ran into a small problem that I have not been able to solve When I'm drawing the blips on the radar for the race checkpoints, it literally draws all of them and not just the first two, which are the ones that are visible to the player Here is my part of the code where I am doing this, thanks in advance for i, checkpoint in ipairs(getElementsByType("checkpoint")) do local cpx = getElementData(checkpoint, "posX"); local cpy = getElementData(checkpoint, "posY"); local dist = getDistanceBetweenPoints2D(px, py, cpx, cpy); if dist > range then dist = range; end local angle = 180 - north + findRotation(px, py, cpx, cpy); local cbx, cby = getPointFromDistanceRotation(0, 0, size * (dist / range) / 2, angle); local bx = centerLeft + cbx - blipSize/2; local by = centerTop + cby - blipSize/2; local yoff = 0; local r, g, b, a = getColorFromString(getElementData(checkpoint, "color")); local img = "assets/images/checkpoint.png"; dxDrawImage(bx, by, blipSize, blipSize, img, 0, 0, 0, tocolor(r, g, b, a)); end
  5. To get the nitro level u can use getVehicleNitroCount or getVehicleNitroLevel
  6. Ultimamente me pasa que al abrir el MTA me cambia la resolución de todo el sistema y al salir se queda así, pensé que era por el windows 10 pero le comenté a un amigo y me dijo que también le paso ayer con el windows 7, reinstalé y actualicé los drivers y sigue igual, solo pasa al abrir MTA, al abrir GTA va todo bien, a alguien mas le pasa? saben alguna solución?
  7. Tomás tiene más experiencia que yo, no sé si esté bien lo que el dice o si es un ejemplo para que te hagas una idea, pero yo la verdad no la entiendo, si me la pueden explicar les agradecería mucho Creo que sería algo así function isPlayerAdmin (player) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then return true else return false end end Para llamarla sería: if isPlayerAdmin (jugador) then
  8. Funciona pero con cualquier vehículo, necesito que solo funcione si está en hunter :c EDIT: Solucionado.
  9. Me podrían ayudar a solucionar este error? Linea 15 function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = RankingBoard:create() self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) end local timePassed = self:getTimePassed() local rank = self:getPlayerRank(player) self.rankingBoard:add(player, timePassed,rank) -- Do remove if rank == 1 then local activePlayers = getActivePlayers() if #activePlayers == 1 then local vehicle = getPedOccupiedVehicle(activePlayers[1]) local model = getElementModel(vehicle) if model == 425 then playerAcc = getPlayerAccount (player) mapsWon = tonumber(getAccountData (playerAcc, "mapsWon")) money = tonumber(getAccountData (playerAcc, "cash")) points = tonumber(getAccountData (playerAcc, "points")) setAccountData (playerAcc, "mapsWon", mapsWon+1) numPlayers = #getElementsByType ("player") randomMoney = (math.random (500, 1500)*numPlayers) randomPoints = (math.random (5, 10)*numPlayers) setAccountData (playerAcc, "cash", money+randomMoney) setAccountData (playerAcc, "points", points+randomPoints) setAccountData (playerAcc, "mapsWon", mapsWon+1) triggerClientEvent("onServerWantShowCenterMessage",resourceRoot,"The winner is "..getPlayerNametagText(player),"Gets #006633$"..randomMoney.." and #006633"..randomPoints.." points.") end end end finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed, #activePlayers) triggerEvent( "onPlayerWinDD",activePlayers[1] ) local vehicle = getPedOccupiedVehicle(activePlayers[1]) if vehicle then local model = getElementModel(vehicle) if model == 425 and g_GameOptions.autob then RaceMode.endMap() end end end end
  10. Los toptimes se guardan en el archivo "registry.db"
×
×
  • Create New...