Jump to content

AlvareZ_

Members
  • Posts

    611
  • Joined

  • Last visited

Everything posted by AlvareZ_

  1. The problem its then i shot the Bot, Dont run to attack me, Only run forward, I dont know what function used for attack me Client --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] local cFunc = {} local cSetting = {} cFunc["witch_atack"] = function(_, wep, bodypart) if not getElementData(source, "Damaged") then local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatack", root ) setSoundMaxDistance(witchcry, 0) setElementData(source, "Damaged", true) end end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atack"]) cFunc["witch_atackxd"] = function(_, wep, bodypart) local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatackxd", root ) end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atackxd"]) addEvent ( "chillido", true ) addEventHandler ( "chillido", root, function ( ) playSound ( "tawa.mp3" ) end ) function startMusic() setRadioChannel(0) song = playSound3D("cry.mp3", -175.610, 57.66, 3.2, true) setSoundMaxDistance(song, 180) end function cancelPedDamage ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "Witch") == true) then local zhp = getElementData(source,"currenthealth") if zhp > 0 then local dmg = 25 local takedamage = zhp - dmg setElementData(source,"currenthealth",takedamage) elseif zhp == 0 then triggerServerEvent("killdmgzero",root,source,attacker,weapon,bodypart) end end end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) function toggleSong() setSoundVolume(song,0) end addEventHandler("onClientPedDamage",getRootElement(),toggleSong) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEvent ( "witchsound", true ) addEventHandler ( "witchsound", root, function ( ) song = playSound3D("cry.mp3", 2952, -1925, 4.2, true) setSoundMaxDistance(song, 180) end ) local maxDist = 30 function witchNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( theWitch ) local zhx,zhy,zhz = getPedBonePosition(theWitch,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (theWitch, "Witch") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) --local zombieHealth = getElementHealth(theWitch) local maxHP = exports.extra_health:getElementExtraHealth(theWitch) local currentHealth = getElementData(theWitch, "currenthealth") if sxx and getElementHealth(theWitch) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("Witch",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onClientRender", root, witchNameTag) Server --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] RealWitch = nil function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end Witch = nil function getPlayerNearestToPosition(x, y, z) local nearestPlayer = nil local nearestDistance = nil for i, players in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(players) local distance = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if nearestPlayer == nil then nearestPlayer = players nearestDistance = distance elseif distance < nearestDistance then nearestDistance = distance nearestPlayer = players end end if nearestPlayer == nil then return false else return nearestPlayer end end function Boss () blip = {} local localPed = createPed( 33, 188.28320, 1403.76196, 10.58594 ) local health = exports.extra_health:setElementExtraHealth ( localPed, 1500 ) setElementModel ( localPed, 33 ) setPedAnimation(localPed, "CRACK", "crckidle3", -1, true, true, false) setElementData(localPed, "type", "RealWitch") setPedStat(localPed, 24, 1000) RealWitch = localPed blip[1] = (createBlipAttachedTo ( localPed, 0 )) triggerClientEvent ( "witchsound", root ) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(RealWitch)) setElementData(localPed, "Witch", true) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEvent("witchatack", true) addEventHandler ( "witchatack", root, function ( ) local Health = exports.extra_health:getElementExtraHealth(localPed) if Health < 1499 or Health == 1499 then setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) triggerClientEvent ( "chillido", root ) end end ) addEvent("witchatackxd", true) addEventHandler ( "witchatackxd", root, function ( ) setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) end ) addEventHandler("onPedWasted", getRootElement(), function(ammo, killer) if isElement(RealWitch) then if source == RealWitch then local x, y, z = getElementPosition(RealWitch) destroyElement(RealWitch) destroyElement(blip[1]) setTimer(Boss, 30000, 1) triggerClientEvent ( "chillido", root ) end end end ) setTimer( function() localPed = RealWitch if isElement(RealWitch) then local x, y, z = getElementPosition(RealWitch) local player = getPlayerNearestToPosition(x, y, z) if player then local px, py, pz = getElementPosition(player) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 130 then if isElementInWater(RealWitch) then setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) end local rotZ = findRotation(x, y, px, py) setPedRotation(RealWitch, rotZ) if getDistanceBetweenPoints3D(px, py, pz, x, y, z) < 2 then local health = getElementHealth(player) if health < 5 or health == 5 then setElementHealth(player, 0) local leX, leY, leZ = getElementPosition(RealWitch) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) else setElementHealth(player, health - 6) end end else local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) end end end end , 50, 0) addEvent("killdmgzero",true) function killWhenHpZero(source,attacker,weapon,bodypart) killPed(source,attacker,weapon,bodypart) end addEventHandler("killdmgzero",root,killWhenHpZero)
  2. Si alguien tiene alguna idea, Favor decirme.
  3. chat_range = 100 -- Distancia function engineSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleEngineState (veh) == true) then setVehicleEngineState (veh, false) outputChatBox ("Vehiculo Apagado.", source, 255, 0, 0) elseif (getVehicleEngineState (veh) == false) then setVehicleEngineState (veh, true) local px,py,pz = getElementPosition(source) if isPlayerInRangeOfPoint(source,px,py,pz,chat_range) then outputChatBox ("*".. getPlayerName(source) .." ah encendido el Vehiculo.", source, 255, 30, 50) end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent("engenieSwitch",true) addEventHandler("engenieSwitch",getRootElement(),engineSwitch) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5 <= range end
  4. chat_range = 100 -- Distancia function engineSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleEngineState (veh) == true) then setVehicleEngineState (veh, false) outputChatBox ("Vehiculo Apagado.", source, 255, 0, 0) elseif (getVehicleEngineState (veh) == false) then setVehicleEngineState (veh, true) local px,py,pz = getElementPosition(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ("*".. getPlayerName(source) .." ah encendido el Vehiculo.", source, 255, 30, 50) end end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent("engenieSwitch",true) addEventHandler("engenieSwitch",getRootElement(),engineSwitch) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end
  5. El problema con esto es que, Le disparo a el Bot, Pero no corre por mi, Corre solo para delante, No se que funcion usar para que me ataque ... Client --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] local cFunc = {} local cSetting = {} cFunc["witch_atack"] = function(_, wep, bodypart) if not getElementData(source, "Damaged") then local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatack", root ) setSoundMaxDistance(witchcry, 0) setElementData(source, "Damaged", true) end end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atack"]) cFunc["witch_atackxd"] = function(_, wep, bodypart) local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatackxd", root ) end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atackxd"]) addEvent ( "chillido", true ) addEventHandler ( "chillido", root, function ( ) playSound ( "tawa.mp3" ) end ) function startMusic() setRadioChannel(0) song = playSound3D("cry.mp3", -175.610, 57.66, 3.2, true) setSoundMaxDistance(song, 180) end function cancelPedDamage ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "Witch") == true) then local zhp = getElementData(source,"currenthealth") if zhp > 0 then local dmg = 25 local takedamage = zhp - dmg setElementData(source,"currenthealth",takedamage) elseif zhp == 0 then triggerServerEvent("killdmgzero",root,source,attacker,weapon,bodypart) end end end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) function toggleSong() setSoundVolume(song,0) end addEventHandler("onClientPedDamage",getRootElement(),toggleSong) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEvent ( "witchsound", true ) addEventHandler ( "witchsound", root, function ( ) song = playSound3D("cry.mp3", 2952, -1925, 4.2, true) setSoundMaxDistance(song, 180) end ) local maxDist = 30 function witchNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( theWitch ) local zhx,zhy,zhz = getPedBonePosition(theWitch,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (theWitch, "Witch") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) --local zombieHealth = getElementHealth(theWitch) local maxHP = exports.extra_health:getElementExtraHealth(theWitch) local currentHealth = getElementData(theWitch, "currenthealth") if sxx and getElementHealth(theWitch) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("Witch",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onClientRender", root, witchNameTag) Server --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] RealWitch = nil function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end Witch = nil function getPlayerNearestToPosition(x, y, z) local nearestPlayer = nil local nearestDistance = nil for i, players in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(players) local distance = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if nearestPlayer == nil then nearestPlayer = players nearestDistance = distance elseif distance < nearestDistance then nearestDistance = distance nearestPlayer = players end end if nearestPlayer == nil then return false else return nearestPlayer end end function Boss () blip = {} local localPed = createPed( 33, 188.28320, 1403.76196, 10.58594 ) local health = exports.extra_health:setElementExtraHealth ( localPed, 1500 ) setElementModel ( localPed, 33 ) setPedAnimation(localPed, "CRACK", "crckidle3", -1, true, true, false) setElementData(localPed, "type", "RealWitch") setPedStat(localPed, 24, 1000) RealWitch = localPed blip[1] = (createBlipAttachedTo ( localPed, 0 )) triggerClientEvent ( "witchsound", root ) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(RealWitch)) setElementData(localPed, "Witch", true) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEvent("witchatack", true) addEventHandler ( "witchatack", root, function ( ) local Health = exports.extra_health:getElementExtraHealth(localPed) if Health < 1499 or Health == 1499 then setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) triggerClientEvent ( "chillido", root ) end end ) addEvent("witchatackxd", true) addEventHandler ( "witchatackxd", root, function ( ) setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) end ) addEventHandler("onPedWasted", getRootElement(), function(ammo, killer) if isElement(RealWitch) then if source == RealWitch then local x, y, z = getElementPosition(RealWitch) destroyElement(RealWitch) destroyElement(blip[1]) setTimer(Boss, 30000, 1) triggerClientEvent ( "chillido", root ) end end end ) setTimer( function() localPed = RealWitch if isElement(RealWitch) then local x, y, z = getElementPosition(RealWitch) local player = getPlayerNearestToPosition(x, y, z) if player then local px, py, pz = getElementPosition(player) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 130 then if isElementInWater(RealWitch) then setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) end local rotZ = findRotation(x, y, px, py) setPedRotation(RealWitch, rotZ) if getDistanceBetweenPoints3D(px, py, pz, x, y, z) < 2 then local health = getElementHealth(player) if health < 5 or health == 5 then setElementHealth(player, 0) local leX, leY, leZ = getElementPosition(RealWitch) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) else setElementHealth(player, health - 6) end end else local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) end end end end , 50, 0) addEvent("killdmgzero",true) function killWhenHpZero(source,attacker,weapon,bodypart) killPed(source,attacker,weapon,bodypart) end addEventHandler("killdmgzero",root,killWhenHpZero)
  6. Intenta chat_range = 100 -- Distancia function engineSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleEngineState (veh) == true) then setVehicleEngineState (veh, false) outputChatBox ("Vehiculo Apagado.", source, 255, 0, 0) elseif (getVehicleEngineState (veh) == false) then setVehicleEngineState (veh, true) local px,py,pz = getElementPosition(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox ("*".. getPlayerName(source) .." ah encendido el Vehiculo.", Source, 255, 30, 50) end end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent("engenieSwitch",true) addEventHandler("engenieSwitch",getRootElement(),engineSwitch) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end
  7. AlvareZ_

    dxDrawText

    Listo, Gracias a los dos , Tenia "..updateText.." y era solo texto, como dices tu, Creo que por eso me daba error antes también, Gracias
  8. AlvareZ_

    dxDrawText

    Seria asi?, Pero es lo mismo me dice ..updateText.. y no cambia function texto1() local sW, sH = guiGetScreenSize() dxDrawText('..updateText..', (1084/1366)*sW, (79/768)*sH, 1274, 114, tocolor(63, 240, 22, 222), 1.10, "pricedown", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, texto1) updateText = function() texto = msgs[math.random(#msgs)] end setTimer(updateText, 2000, 0)
  9. function engineSwitch () if (isPedInVehicle (source)) then local veh = getPedOccupiedVehicle (source) if (getVehicleEngineState (veh) == true) then setVehicleEngineState (veh, false) outputChatBox ("Vehiculo Apagado.", source, 255, 0, 0) elseif (getVehicleEngineState (veh) == false) then setVehicleEngineState (veh, true) outputChatBox ("El Jugador ".. getPlayerName(source) .." ah encendido el Vehiculo!.", root, 255, 0, 0) end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent("engenieSwitch",true) addEventHandler("engenieSwitch",getRootElement(),engineSwitch)
  10. Creo que en server. Intenta
  11. Creo que podrías usar algo como esto NO ESTOY SEGURO: local cantidad = getElementData(source, "score") givePlayerMoney(source, tonumber(cantidad)) -- o Sino local cantidad = getElementData(source, "Last Drift") givePlayerMoney(source, tonumber(cantidad))
  12. AlvareZ_

    dxDrawText

    Me darías un Pequeño ejemplo ?
  13. AlvareZ_

    dxDrawText

    Si no me fije :c, Mi idea es que cambie el texto, Pero no supe que usar.
  14. AlvareZ_

    dxDrawText

    function change() setTimer( function() addEventHandler("onClientRender", root, texto1) end, 100, 0) setTimer(function() removeEventHandler("onClientRender", root, texto1) end, 2000, 0) end addEventHandler("onClientResourceStart", root, change)
  15. AlvareZ_

    dxDrawText

    Buenas, Mi problema es que no me quiere dar el mensaje random e intentado varias cosas pero nada... Aquí la parte de el dxDrawText function texto1() local sW, sH = guiGetScreenSize() text = msgs[math.random(#msgs)] dxDrawText("'..text..'", (1084/1366)*sW, (79/768)*sH, 1274, 114, tocolor(63, 240, 22, 222), 1.10, "pricedown", "left", "top", false, false, true, false, false) end
  16. Client-Side: --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } local rootElem = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) local player = getLocalPlayer() local vehicle local size = 1.2 local modo = 0.01 local score = 0 local screenScore = 0 local tick local idleTime local multTime local driftTime local Yellow = tocolor(255,232,25) local Red = tocolor(234,0,3) local TempCol = Yellow local mult = 1 local tablamult = {350,1400,4200,11200} local anterior = 0 local mejor = 0 local total = 0 local global_mejor = 0 local global_nombre = "N/A" local screenWidth, screenHeight = guiGetScreenSize() local x1,y1,x2,y2 = screenWidth*0.2,screenHeight*0.1,screenWidth*0.8,screenHeight*0.8 addEventHandler("onClientResourceStart", thisRoot, function() addEventHandler("onClientRender", rootElem, showText) outputChatBox("Waiting for server drift data...") triggerServerEvent("driftClienteListo", rootElem, player) end ) addEventHandler("onClientResourceStop", thisRoot, function() removeEventHandler("onClientRender", rootElem, showText) end ) function isValidVehicle() local temp = getPedOccupiedVehicle(player) if not temp or getVehicleOccupant(temp,0) ~= player or getVehicleType(temp) ~= "Automobile" then return false end local vehID = getElementModel(temp) for k,v in ipairs(BannedIDs) do if vehID == v then return false end end return temp end function showText() dxDrawText(string.format("Best Drift: %s - %d",global_nombre,global_mejor),44,screenHeight-43,screenWidth,screenHeight,Yellow,1,"pricedown") vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) total = total+anterior setElementData(player, "Total Drift", total) if score > mejor then mejor = score setElementData(player, "Best Drift", mejor) checkPuntaje(mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end if angulo ~= 0 then if score == 0 then triggerEvent("onVehicleDriftStart", rootElem) driftTime = tick end if tempBool then score = score + math.floor(angulo*velocidad)*mult else score = math.floor(angulo*velocidad)*mult end if TempCol == Red then TempCol = Yellow end screenScore = score idleTime = tick end local temp2 = string.format("Factor: X%d\n%s",mult,mult~=5 and string.format("Gain X%d with %d",mult+1,tablamult[mult]) or "MAX") dxDrawText(temp2, 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) if velocidad <= 0.3 and mult ~= 1 then dxDrawText("\n\nToo Slow!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) end if tick - (idleTime or 0) < 3000 then local temp = "DRIFT" if score >= 100000 then temp = "DRIFT\n\nDrift King!" elseif score >= 50000 then temp = "DRIFT\n\nInsane Drift!" elseif score >= 20000 then temp = "DRIFT\n\nOutrageous!" elseif score >= 15000 then temp = "DRIFT\n\nColossal!" elseif score >= 7000 then temp = "DRIFT\n\nSuberb!" elseif score >= 3000 then temp = "DRIFT\n\nGreat Drift!" elseif score >= 1000 then temp = "DRIFT\n\nGood Drift!" end dxDrawText(temp, x1,y1,x2,y2, TempCol, 2.2, "sans","center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol, size, "pricedown","center","top", false,true,false) end end function angle() local vx,vy,vz = getElementVelocity(vehicle) local modV = math.sqrt(vx*vx + vy*vy) if not isVehicleOnGround(vehicle) then return 0,modV end local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local deltaT = tick - (multTime or 0) if mult~= 1 and modV <= 0.3 and deltaT > 750 then mult = mult-1 multTime = tick elseif deltaT > 1500 then local temp = 1 if score >= 11200 then temp = 5 elseif score >= 4200 then temp = 4 elseif score >= 1400 then temp = 3 elseif score >= 350 then temp = 2 end if temp>mult then mult = temp multTime = tick end end if modV <= 0.2 then return 0,modV end --speed over 40 km/h local cosX = (sn*vx + cs*vy)/modV if cosX > 0.966 or cosX < 0 then return 0,modV end --angle between 15 and 90 degrees return math.deg(math.acos(cosX))*0.5, modV end addEvent("driftCarCrashed", true) addEventHandler("driftCarCrashed", rootElem, function() if score ~= 0 then score = 0 mult = 1 TempCol = Red triggerEvent("onVehicleDriftEnd", rootElem, 0) end end ) addEvent("driftActualizarRecord", true) addEventHandler("driftActualizarRecord", rootElem, function(score, name) global_mejor = score global_nombre = name end ) function resetScore() anterior,mejor,total = 0,0,0 setElementData(player, "Last Drift", anterior) setElementData(player, "Total Drift", total) setElementData(player, "Best Drift", mejor) end addEvent("driftResetAllScores", true) addEventHandler("driftResetAllScores", rootElem, resetScore) addCommandHandler("resetdrift", resetScore) function checkPuntaje(BestDrift) triggerServerEvent("driftNuevoRecord", rootElem, BestDrift, string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "")) end
  17. AlvareZ_

    help

    OffTopic: Te recomiendo leer Esto! https://forum.multitheftauto.com/viewtopic.php?f=122&t=59515
  18. AlvareZ_

    Ayuda

    local msgs = { 'noob', 'murio', 'diee!' } function playerDied ( totalAmmo, killer, killerWeapon, bodypart ) local text = msgs [ math.random ( 1, #msgs ) ] outputChatBox ( getPlayerName ( source ) .. text .. getBodyPartName ( bodypart ) .. !, root, 255, 255, 255, true ) end addEventHandler ( "onPlayerWasted", getRootElement(), playerDied )
  19. AlvareZ_

    ayuda

    Tienes cargado el Resource? Muestra tu Script.
  20. AlvareZ_

    ayuda

    https://wiki.multitheftauto.com/wiki/Resource:Customblips
  21. AlvareZ_

    ayuda

    Si te da un numero, getPlayerCount, Devuelve un Numero, La cantidad de players en el server
  22. AlvareZ_

    ayuda

    No te entiendo, Explícame un poco.
×
×
  • Create New...