Jump to content

spoty

Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by spoty

  1. spoty

    dbConnect bug

    Debug say ; dbConnect failed ... could not connect do your vps allow mysql connection's? How to do that ? buy a vps that support's incoming and outcoming mysql connections not all vps have that
  2. spoty

    dbConnect bug

    Debug say ; dbConnect failed ... could not connect do your vps allow mysql connection's?
  3. spoty

    Solved

    ok its fixed now but i dind touched this line at all and it gives me this error ERROR : attempt to perform arithmetic on global 'total'(a nil value) local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) total = total+anterior <------ gives the error 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
  4. spoty

    Solved

    i have used your script before its not that i dont like it but it have couple glitches in it
  5. spoty

    Solved

    error: expected function at argument 3, got nill addEventHandler("getDriftScore",resourceRoot,getDriftScore)
  6. spoty

    Solved

    local root = getRootElement() local thisResourceRoot = getResourceRootElement(getThisResource()) local drift_records = {} local drift_mejor = 0 local drift_nombre = "N/A" addEventHandler ( "onResourceStart", thisResourceRoot, function() call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Best Drift") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Last Drift") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Total Drift") executeSQLCreateTable("recordsDrift","pista TEXT, nombre TEXT, score INTEGER") addEvent("driftClienteListo", true) addEventHandler("driftClienteListo", root, function(player) if drift_mejor == 0 then outputChatBox("There's no record set on this map", player) else outputChatBox(string.format("The current record is %d points (%s)", drift_mejor, drift_nombre), player) end end) end ) addEventHandler ( "onResourceStop", thisResourceRoot, function() call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Best Drift") call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Last Drift") call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Total Drift") end ) addEventHandler ( "onGamemodeMapStart", root, function(mapResource) local mapname = getResourceInfo(mapResource, "name") or getResourceName(mapResource) local command = string.format("pista='%s'",mapname) local record = executeSQLSelect("drift","nombre, score",command) end) addEventHandler ( "onGamemodeMapStop", root, function(mapResource) local mapname = getResourceInfo(mapResource, "name") or getResourceName(mapResource) if not mapname then return end local command = string.format("pista='%s'",mapname) executeSQLUpdate("recordsDrift",string.format("nombre = '%s', score = %d", drift_nombre, drift_mejor), command) end) addEventHandler("onVehicleDamage", root, function() thePlayer = getVehicleOccupant(source, 0) if thePlayer then triggerClientEvent(thePlayer, "driftCarCrashed", root, source) end end) addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,ElementData)) end end ) i think the fault is in client side
  7. spoty

    Solved

    the db is 100% working no bugs or anything in it saves fine loads fine and updates fine the drift resource keeps start counting on 0 when you do your first drift when you have reconnected or leaved server and joining back later ^ so that means it automatic RESETS the DRIFT SCORES total drift best drift to 0 <<<
  8. spoty

    Solved

    and i mean it save scores for in scoreboard
  9. spoty

    Solved

    going to take a look but i gues i already have saw it but i am not sure EDIT: yea i already saw it but your modded version of it only save 1 kind of score i need to make mine work to save Best drift Last Drift and Total Drift i have a db for it but the problem is that the drift points resource starts counting from 0 < evrytime you come in server again it shows the saved points when you join but when you start to drift it replace the saved scores to your nw drift score it resets evry time after you rejoin the script makes it start counting from 0 idk why
  10. spoty

    Solved

    hi i am using 50p's drift script works verry good only it dont save the drift points but i have maded a sqlite database to save points works 100% but now i noticed a problem in 50p's drft script when i leave the server it will save the points when i join the server it will load the points but when i start drifting after joining and loading points it will start counting from 0 50p's drft script makes the score restart and start on 0 idk why or how i have tryed couple stuff but it wont work 50ps script 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) 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 ) i was thinking that those 3 lines where the problem local anterior = 0 ---------- Last Drift local mejor = 0 --------- Best Drift local total = 0 --------- Total Drift i have tryed to add getElementData on the 3 lines so it will take the saved points + the new points local anterior = 0 + getElementData ( player, "Last Drift", anterior ) local mejor = 0 + getElementData ( player, "Best Drift", mejor ) local total = 0 + getElementData ( player, "Total Drift", total ) i have tryed some stuff unsucces fully so i hope someone can help me
  11. toggleSourceWindow always work
  12. ive got this error code attempt to perform arithmetic on a userdate value the error is from this line local total = 0 + getRootElement ( source, "Total Drift", true ) its for drft resource i have maded a db to save the drift points but as you can see local total = 0 let the points start counting from 0 and when i join its perfect but start to drift it just starts to recount from 0 so thats why i use the getRootElement
  13. you have bindKey("F7", "down", OpenWin) but it should be bindKey('f7', 'down', toggleVentanaWindow)
  14. hey i need some help with this error i have tryed some stuff to fix it error line SCRIPT ERROR: drft\drft_db.lua:76: 'end' expected (to close 'if' at line 67) near '' ERROR: Loading script failed: drft\drft_db.lua:76: 'end' expected (to close 'if' at line 67) near '' here is line 66 to 79 line 2 is line 67 local check = dbPoll(dbQuery(connection, "SELECT * FROM account WHERE drift = ?",tostring(account)), -1 ); if type(check) ~= "table" and #check ~= 0 or not check then local d = check[1]; local t = fromJSON ( d["data"] ); if ( type ( t ) == "table" ) then for k, v in pairs ( t ) do setElementData ( source, k, v ); end end addEventHandler ( "onPlayerLogin", root, loadDriftPoints ) i dind have scripted for a while so it will probaly be a dumb fault of me
  15. hmm looks nice but if you realese something then you normaly give free if you want to sell it for 5 then you should put in [sALE]Open Teams or something like that
  16. spoty

    F11 Map replacement

    then you can replace it easily from your /Multi Theft Auto 1.5/MTA/cgui/images/ folder is that working to replace f11 map into server so evry player can see it? or only local because i think he is needing to know how to change it for hi's server?
  17. thnx i have used it before but when i extract them the most .col files are not true or bugged
  18. hi all i need some help with mapping a costum map i found a nice gta sa costum map but it have 25 .dff and another with lod infront of name 25 .dff 2 .txd files one normal and one lod and 2 col files also one normal and one lod files can someone mayby help me to put it into server i know i need to make a script for it but how can i extract the .col file to 25 . col files
  19. you need to make the give money thing into drft_server.lua and drft.lua something like this drft.lua tick = getTickCount() local angulo,velocidad = angle() total = getElementData( player, "Drift Score" ) mejor = getElementData( player, "Best Drift" ) local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) total = total+anterior cash = anterior/100 triggerServerEvent("updatecash", player, player, cash ) checkPuntaje(anterior) setElementData(player, "Drift Score", total) if score > mejor then mejor = score setElementData(player, "Best Drift", mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end drft_server.lua function gcash(player,money) givePlayerMoney( player, tonumber(money) ) end addEvent("updatecash", true ) addEventHandler("updatecash", root, gcash )
  20. https://community.multitheftauto.com/in ... s&id=10086 thats what your searching
  21. ok thnx this is what i needed thnx alot
  22. i wanne make this line thats crrently showing dxDrawText x1, x2, x3, x4, x5, but i wanne make it showing image's inplace of dxDrawText i have 5 images so how can i make it exact like the line from topic ? one by one use dxDrawImage() i have this no error's but it isnt working local temp2 = string.format(mult,mult~=5 and string.format(mult+1,tablamult[mult])) dxDrawImage (temp2, 20,195,screenWidth,screenHeight, 'x1.png', false,true,false)
  23. i wanne make this line thats crrently showing dxDrawText x1, x2, x3, x4, x5, but i wanne make it showing image's inplace of dxDrawText i have 5 images so how can i make it exact like the line from topic ?
  24. help anyone please
  25. yeah because right now it says in game X1 gain 350 to get X2 and i wanne just change it all to a image that i already have maded so it shows the X1 image when i gained x1 and when i gain x2 it needs to show to x2 image
×
×
  • Create New...