xPipeZ Posted December 5, 2015 Share Posted December 5, 2015 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 Link to comment
xPipeZ Posted December 6, 2015 Author Share Posted December 6, 2015 Funciona pero con cualquier vehículo, necesito que solo funcione si está en hunter :c EDIT: Solucionado. Link to comment
Recommended Posts