Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. Wont work i tried debugscript 3 it show nothing.
  2. Hello all, i maked this stat system, 1pt for each kill, but sadly it wont work here is the lua addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 9 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 2 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 8 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 7 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 6 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 5 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 4 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end ); addEvent( "onPlayerWasted", true ); addEventHandler( "onPlayerWasted", root, function (ammo, killer, weapon, bodypart ) if killer and killer ~= source then if bodypart == 3 and weapon == 22 then setPedStat( killer, 69, getPedStat( killer, 69 ) + 1 ); end end end );
  3. Thanks for youre help.....i will try
  4. Not only for Test team i want it for every team because i have 4 and i want when player login he's nametagcolor and blip be the same as Team color.
  5. Hello all, I want a little script, if player was in team Test he's nametagcolor and blip must be same as team color, i want to make a script like that. Well, i tried this using this but need some functions, r, g, b = getTeamColor(teamElement) setPlayerNametagColor(playerElement, r, g ,b) Can somebody help me with a code or someting elser thanks
  6. Gonna try....thanks all for youre help but i want add column to scoreboard for it elseif column.name == "Rank" then column.width = 20 dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI )
  7. Hello all,i made this but don't want to work, here is the code: exports.scoreboard:addScoreboardColumn('Rank') addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local kills = getAccountData(account,"kills") if (kills >= 0) and (kills <= 4) then setElementData(source,"Rank","ranks/1.png") elseif (kills >= 5) and (kills <= 99) then setElementData(source,"Rank","ranks/2.png") elseif (kills >= 100) and (kills <= 249) then setElementData(source,"Rank","ranks/3.png") elseif (kills >= 250) and (kills <= 499) then setElementData(source,"Rank","ranks/4.png") elseif (kills >= 500) and (kills <= 999) then setElementData(source,"Rank","ranks/5.png") elseif (kills >= 1000) and (kills <= 1499) then setElementData(source,"Rank","ranks/6.png") elseif (kills >= 1500) and (kills <= 1999) then setElementData(source,"Rank","ranks/7.png") elseif (kills >= 2000) and (kills <= 2999) then setElementData(source,"Rank","ranks/8.png") elseif (kills >= 3000) and (kills <= 3999) then setElementData(source,"Rank","ranks/9.png") end end ) addEventHandler("onPlayerSpawn",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local Rank = getAccountData(account,"Rank") if Rank then setElementData(source,"Rank", Rank) end end ) and add to score board line Rank = getElementData(source,"Rank") if Rank then setElementData(source,"Rank",":Script/Ranks/"..Rank..".png") end end Thanks....i hope somebody help
  8. -.Paradox.-

    Help

    Thanks working now 100% Thanks bro, and ramdan kareem.
  9. -.Paradox.-

    Help

    Can you post an example code? and thanks.
  10. -.Paradox.-

    Help

    Hello, can somebody tell me the location of /me command, i want change the color of it.
  11. Ok, he can use, if (hasObjectPermissionTo(thePlayer, "function.banPlayer")) then too
  12. Didn't work no errors, i guess forgot to check if FileExist
  13. I will try thanks for youre help. location for them is ":Reputation/Reputation/Rank"..rank..".png"
  14. 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() 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 ) 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) Server side 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", "Total Drift") executeSQLCreateTable("recordsDrift","pista TEXT, nombre TEXT, score INTEGER") addEvent("driftClienteListo", true) addEventHandler("driftClienteListo", root, function(player) triggerClientEvent(player, "driftActualizarRecord", root, drift_mejor, drift_nombre) 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", "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("recordsDrift","nombre, score",command) if #record == 0 then executeSQLInsert("recordsDrift",string.format("'%s', 'N/A', 0",mapname)) drift_mejor = 0 drift_nombre = "N/A" else drift_mejor = record[1]["score"] drift_nombre = record[1]["nombre"] end triggerClientEvent(root, "driftActualizarRecord", root, drift_mejor, drift_nombre) triggerClientEvent(root, "driftResetAllScores", root) if drift_mejor == 0 then outputChatBox("There's no record set on this map") else outputChatBox(string.format("The current record is %d points (%s)", drift_mejor, drift_nombre)) end 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) addEvent("driftNuevoRecord", true) addEventHandler("driftNuevoRecord", root, function(score, name) if score > drift_mejor then outputChatBox(string.format("New drift record! (%d points) (%s)",score,name)) drift_mejor = score drift_nombre = name triggerClientEvent(root, "driftActualizarRecord", root, drift_mejor, drift_nombre) end end) addEventHandler("onElementDataChange",getRootElement(), function ( ElementData ) if ( ElementData == "Last Drift" ) then givePlayerMoney(source,getElementData(source,ElementData)) end end ) this should work
  15. -.Paradox.-

    Help

    Post whole script.
  16. Hello all, i'm trying to transform rank numbers to image, here is the lua local levels = {[200] = 1, [500] = 2, [600] = 3, [1000] = 4, [2000] = 5, [3000] = 6, [4000] = 7, [5000] = 8, [9000] = 9} function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = getElementData(killer, "Reputation") local S = getElementData(killer, "Rank") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) setElementData(killer, "Reputation", tonumber(H)+math.random ( 20, 50 ) ) if levels[tonumber(H)] then setElementData(killer, "Rank", "Rank ".. tostring(levels[tonumber(H)]) .." ! ") triggerClientEvent ( killer, "playSound", killer ) end end local H = getElementData ( source, "Reputation" ) or 0 setElementData ( source, "Reputation", tonumber ( H ) - math.random ( 20, 50 ) ) end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Rank", getAccountData(account, "Rnk") or "0") setElementData(source, "Reputation", getAccountData(account, "Rep") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "Rnk", getElementData(thePlayer, "Rank")) setAccountData (theAccount, "Rep", getElementData(thePlayer, "Reputation")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end) Also i want add them to scoreboard elseif column.name == "Rank" then column.width = 20 dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) Ranks images are Rank/Lvl1.png ......... Rank/Lvl9.png I hope somebody help me in this, and thanks
  17. Working perfect Thanks alot
  18. Server side or client side?
×
×
  • Create New...