Jump to content

DonUtiX

Members
  • Posts

    20
  • Joined

  • Last visited

DonUtiX's Achievements

Civilian

Civilian (7/54)

0

Reputation

  1. Thanks for ur help it worked and calm down bro i didn't understand what u meant by client side at the begginig but thanks after all it worked
  2. Dude i know but where to copy this code? in drft.lua or drft_server.lua? i added it in drft,lua in the end as foloows --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,ElementData)) end end ) 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 ) addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,data)) end 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) 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 >= 600000 then temp = "DRIFT\n\nDrift King!" elseif score >= 400000 then temp = "DRIFT\n\nInsane Drifter!" elseif score >= 300000 then temp = "DRIFT\n\nCool!next rank 400k!" elseif score >= 200000 then temp = "DRIFT\n\nNotbad !" elseif score >= 100000 then temp = "DRIFT\n\nTRY HARDER!!" elseif score >= 30000 then temp = "DRIFT\n\nU mad bro?!" elseif score >= 3000 then temp = "DRIFT\n\nTurkish drifter :<!" 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 addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,data)) end end ) addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,ElementData)) 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() if total > global_mejor then triggerServerEvent("driftNuevoRecord", rootElem, total, getPlayerName(player)) end end addEventHandler("onClientPlayerFinish", rootElem, checkPuntaje) addEventHandler("onClientPlayerOutOfTime", rootElem, checkPuntaje) addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,data)) end end ) sry for bothering but i am not a pro scripter
  3. No i mean skins of people And the names are like ironman.txd iraonman.dff yoshi.txd yoshi.dff simple skins but doesnt work i tried renaming as skin id and skin name like skaterboy.txd skaterboy.dff cj.txd cj.dff doesnt work
  4. hmm says in concosle bad argument@giveplayermoney is there a specfic palce to put in drft.lua i putted that in the end
  5. Guys i tried loading skins but all of them just dont work i tried renaming the txd and dff to the skin id and didnt work i tried to rename to skin name still didnt work please help the vehicles and weapons are working perfectly but idk whats wrong with the skins
  6. I currently have a lot of drift counters but none gives money when drifting i really need a script like that if u know any please reply me thanks for reading
  7. Recently i knew how to install car mods using modloader (txd and dff files) but i dont know how to install dff files , when i tried to install it i get an error says cant copy .bak to resource-cache please help
  8. But modloader cant load/replace/copy dff files i have same problem with dff files
  9. any ideas what to do with .bak files? they are used in some helicopters and opened planes i tried to install but tells me failed to copy to resource cache Help please
  10. I have a question if i have this: hotknife, 3,3, 6,6, 7,7, 52,52, 76,76 434, hotknife, hotknife, car, HOTKNIFE, HOTKNIF, null, normal, 9, 0, 2ff0, -1, 1.42, 1.42, 0 HOTKNIFE 2400.0 6000.0 2.5 0.0 0.0 0.0 75 0.65 0.92 0.5 5 180.0 45.0 15.0 R P 5.0 0.55 1 35.0 1.1 0.1 0.0 0.27 -0.22 0.5 0.3 0.2 0.56 35000 00002010 01421100 0 1 0 which is exactly the handling line that i should copy?
  11. I have a little question if i have this: hotknife, 3,3, 6,6, 7,7, 52,52, 76,76 434, hotknife, hotknife, car, HOTKNIFE, HOTKNIF, null, normal, 9, 0, 2ff0, -1, 1.42, 1.42, 0 HOTKNIFE 2400.0 6000.0 2.5 0.0 0.0 0.0 75 0.65 0.92 0.5 5 180.0 45.0 15.0 R P 5.0 0.55 1 35.0 1.1 0.1 0.0 0.27 -0.22 0.5 0.3 0.2 0.56 35000 00002010 01421100 0 1 0 which is exactly the handling line?
  12. THANK YOU! Dude you're the best! I worked on this for a week and did'nt find a method, thanks alot
×
×
  • Create New...