Jump to content

myyusuf

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by myyusuf

  1. wiki helps me. i fixed by myself. thanks
  2. hello scripters, i have this autoteam script. Tags = { {"LicaRe|", "LicaRe", "#00ff00", nil}, {"FuckN|", "The Fucking Noobs", "#a9d608"}, {"ES|", "Evil Spirits", "#00ff00"}, {"[weR]", "[weR] Team", "#38023C"}, {"[KCL]", "[KCL] Team", "#00ffff"}, {"[NBD]", "Never Back Down", "#0099ff"}, {"[FOTL]", "[FOTL] Team", "#aa00ff"}, {"[sMT]", "Serious Master Team", "#ff8000"}, {"[PLK]", "Polski Klan", "#ff0000"}, {"BD||", "Best Drivers", "#1e99ff"}, {"|BoB|", "Boss of Bastards", "#00cccc"}, {"Voice|", "Voice of Dick", "#c71585"}, {"=sDr=", "=sDr= Team", "#00ff00"}, {"|GM|", "Golds Mens", "#006699"}, {"|SS|", "Shadow Strikers", "#9900CC"} } function onResourceStartAutoteams() for name, data in ipairs(Tags) do --outputChatBox(" TEST: " .. name .. " " .. data[1] .. " " .. data[2] ) -- This is only for Test for id, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player), data[1], 1, true) then --outputChatBox( "Founded: " .. getPlayerName(players) .. " as " .. data[2]) -- This is only for Test if not isElement(data[2]) or getElementType(data[2]) ~= "team" then creatingTeam = createTeam( data[2], getColorFromString ( data[3] ) ) if creatingTeam then outputDebugString( "Autoteams: Added team '" .. data[2] .. "'." ) data[4] = creatingTeam end end setTimer(function() for name, data in ipairs(Tags) do for id, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player), data[1], 1, true) then movedteam = setPlayerTeam ( player, data[4] ) if not movedteam then MoveToTeam = getTeamFromName( data[2] ) outputDebugString( "Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'." ) setPlayerTeam ( player, MoveToTeam ) return end outputDebugString( "Autoteams: Set '" .. getPlayerName(player) .. "' to team as '" .. data[2] .. "'." ) end end end end, 1000, 1) end end end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStartAutoteams ) function onPlayerChangeNickAutoteams() setTimer(checkPlayerTeam, 100, 1, source) end addEventHandler("onPlayerChangeNick", getRootElement(), onPlayerChangeNickAutoteams) function onPlayerJoinAutoteams() setTimer(checkPlayerTeam, 100, 1, source) end addEventHandler( "onPlayerJoin", getRootElement(), onPlayerJoinAutoteams ) function addPlayerToTeam(player,name) local team = teams[name].team if not isElement(team) or getElementType(team) ~= "team" then team = createTeam(teams[name].name,unpack(teams[name].color)) teams[name].team = team end setPlayerTeam(player,team) blip = createBlipAttachedTo ( player ) local r, g, b = getTeamColor(team) setBlipColor ( blip, r, g, b, 255 ) debug("Added player '"..getPlayerName(player).."' to team '"..name.."'") end function onPlayerQuitAutoteams() -- Remove teams if players are not team returnPlayerTeam = getPlayerTeam( source ) if returnPlayerTeam then setPlayerTeam( source, nil ) if countPlayersInTeam(returnPlayerTeam) == 0 then destroyElement(returnPlayerTeam) end end end addEventHandler( "onPlayerQuit", getRootElement(), onPlayerQuitAutoteams ) function checkPlayerTeam(player) local publicplayer = player for name, data in ipairs(Tags) do if string.find(getPlayerName(player), data[1], 1, true) then if not isElement(data[4]) or getElementType(data[4]) ~= "team" then creatingTeam = createTeam( data[2], getColorFromString ( data[3] ) ) if creatingTeam then outputDebugString( "Autoteams: Added team '" .. data[2] .. "'." ) data[4] = creatingTeam end end setTimer(function() for name, data in ipairs(Tags) do if string.find(getPlayerName(publicplayer), data[1], 1, true) then movedteam = setPlayerTeam ( publicplayer, data[4] ) if not movedteam then MoveToTeam = getTeamFromName( data[2] ) outputDebugString( "Autoteams: Set '" .. getPlayerName(publicplayer) .. "' to team as '" .. data[2] .. "'." ) setPlayerTeam ( publicplayer, MoveToTeam ) return end outputDebugString( "Autoteams: Set '" .. getPlayerName(publicplayer) .. "' to team as '" .. data[2] .. "'." ) end end end, 2000, 1) else -- Remove teams if players are not team returnPlayerTeam = getPlayerTeam( player ) if returnPlayerTeam then setPlayerTeam( player, nil ) if countPlayersInTeam(returnPlayerTeam) == 0 then destroyElement(returnPlayerTeam) end end end end end i try to make setVehicleColor with team name. it isnt working. can you help me? color = getTeamColor ( playerTeam ) local r, g, b = getTeamColor(team) setVehicleColor ( color, r, g, b, 255 )
  3. myyusuf

    about txd

    thank you kenix
  4. myyusuf

    about txd

    local txd, state bindKey( 'F2', 'down', function( ) state = not state if state then destroyElement( txd ) outputChatBox("#ffcc00[MSG]: #c0c0c0Road texture disabled!", source,255,255,255,true) else txd = engineLoadTXD( 'vgncarshade1.txd', 3458 ) engineImportTXD( txd, 3458 ) txd = engineLoadTXD( 'vgncarshade.txd', 8838 ) engineImportTXD( txd, 8838 ) outputChatBox("#ffcc00[MSG]: #c0c0c0Road texture enabled!", source,255,255,255,true) end end ) it isnt running. what is problem?
  5. Ok the problem isn't to add scores, but to know who killed someone, because I don' t know if it is possible to do. Anyway now I' m going to search some function for that, but I can' t say i will find anything. I' ll let you know. if you can visit the GMC DD server, you will see the similiar script that i want. so it is possible. i hope you can do.
  6. yes. and who push another player to sea he will get +1 kill point. and died player will get +1 death point. and on dead players screen will write "you killed by: xxx"
  7. a player pushes b player to sea, and b player died. after a player kill stats will +1 and b player death stats will +1. and on b players screen will write "Killed by: a player". Kills, deaths and wins stats will shown on scoreboard. there must have user.xml for saved user datas. here is the ex type of users.xml. "xxx" nick="nick" kills="155" deaths="15" wins="140" /> there must have to see stats cmd, reset stats and set stats command /stats /resetst /setst and sorry i cant explain this with my english. i hope you understand
  8. it is possible. last day i was see at GMC DD server. maybe you can see the script how works. im ready to pay who can make this script!
  9. you dont understand me man. i will explain myself with a example. ex: a player pushes b player to sea, and b player died. after a player kill stats will +1 and b player death stats will +1. and on b players screen will write "Killed: a player". Kills and deaths will shown on scoreboard. im sorry for my fucking english. i hope you understand me this time. if you can make that i can pay you some on paypal.
  10. i found some client script about that. local vehModel = nil local screen_x, screen_y = guiGetScreenSize() local font = "bankgothic" local scale = screen_x / 1000 local message = "" local messWidth = 1 local messHeight = 1 setElementData(getLocalPlayer(), "Kills", 0, true) setElementData(getLocalPlayer(), "Deaths", 0, true) addEventHandler("onClientRender", getRootElement(), function() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if(vehicle == false)then return end if(getElementModel(vehicle) ~= vehModel)then vehModel = getElementModel(vehicle) local minX, minY, minZ, maxX, maxY, maxZ = getElementBoundingBox(vehicle) local pMinX, pMinY, pMinZ, pMaxX, pMaxY, pMaxZ = math.sqrt(minX^2), math.sqrt(minY^2), math.sqrt(minZ^2), math.sqrt(maxX^2), math.sqrt(maxY^2), math.sqrt(maxZ^2) minY = minY*1.2 maxY = maxY*1.2 --triggerServerEvent("onPlayerBoundingBoxChecked", getLocalPlayer(), math.sqrt(minY^2+maxY^2), -math.sqrt((pMinX-maxX)^2), -math.sqrt((pMinY-maxY)^2)) triggerServerEvent("onPlayerBoundingBoxChecked", getLocalPlayer(), math.sqrt(minY^2+maxY^2), 0, 0) end end) addEvent("showDeathMess", true) addEventHandler("showDeathMess", getRootElement(), function(theKiller) if(source ~= getLocalPlayer())then return end addEventHandler("onClientRender", getRootElement(), kill) message = "Killed by: "..theKiller messWidth = dxGetTextWidth(message, scale, font) messHeight = dxGetFontHeight(scale, font) setTimer(function() removeEventHandler("onClientRender", getRootElement(), kill) end, 5000, 1) end) function kill() dxDrawText(message, screen_x/2 - messWidth/2, screen_y/2 - messHeight/2, screen_x, screen_y, tocolor(255, 0, 0, 150), scale, font) end maybe i can use that function. function() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if(vehicle == false)then return end if(getElementModel(vehicle) ~= vehModel)then vehModel = getElementModel(vehicle)
  11. Hello scripters, i just found this awesome scrores script. i have an idea but idk it can be possible. local root = getRootElement() local scoresRoot = getResourceRootElement(getThisResource()) local scoreboard = getResourceFromName("scoreboard") local scoreColumns = {"kills", "deaths", "self", "ratio", "status"} local isColumnActive = {} local KDR_DECIMAL_PLACES = 2 --http://lua-users.org/wiki/SimpleRound local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function setScoreData (element, column, data) if isColumnActive[column] then setElementData(element, column, data) end end local function resetScores (element) setScoreData(element, "kills", 0) setScoreData(element, "deaths", 0) setScoreData(element, "self", 0) setScoreData(element, "ratio", "-") local status = "" if isPedDead(element) then status = "Dead" end setScoreData(element, "status", status) end local function updateRatio (element) local deaths = getElementData(element, "deaths") if deaths == 0 then setScoreData(element, "ratio", "-") else local kdr = round(getElementData(element, "kills") / deaths, KDR_DECIMAL_PLACES) setScoreData(element, "ratio", tostring(kdr)) end end function updateActiveColumns () for i, column in ipairs(scoreColumns) do if get(column) then isColumnActive[column] = true call(scoreboard, "addScoreboardColumn", column) elseif isColumnActive[column] then isColumnActive[column] = false call(scoreboard, "removeScoreboardColumn", column) end end end addEventHandler("onResourceStart", scoresRoot, function () updateActiveColumns() for i, player in ipairs(getElementsByType("player")) do resetScores(player) end end ) addEventHandler("onResourceStop", scoresRoot, function () for i, column in ipairs(scoreColumns) do if isColumnActive[column] then call(scoreboard, "removeScoreboardColumn", column) end end end ) addEventHandler("onPlayerJoin", root, function () resetScores(source) end ) addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon) if killer then if killer ~= source then -- killer killed victim setScoreData(killer, "kills", getElementData(killer, "kills") + 1) setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(killer) updateRatio(source) end else -- victim killed himself setScoreData(source, "self", getElementData(source, "self") + 1) end else -- victim died setScoreData(source, "deaths", getElementData(source, "deaths") + 1) if isColumnActive["ratio"] then updateRatio(source) end end setScoreData(source, "status", "Dead") end ) addEventHandler("onPlayerSpawn", root, function () setScoreData(source, "status", "") end ) addCommandHandler("score", function (player) if player then for i, column in ipairs(scoreColumns) do if column == "status" then break end if isColumnActive[column] then call(scoreboard, "addScoreboardColumn", column) outputConsole(column .. ": " .. getElementData(player, column), player) end end end end ) - "erorr404,jbeta" version="1.0.0" description="Basic scores" /> resource="scoreboard" /> this is working for play mode. killer fuction is for play mode. is that posible to make that for Destruction Derby (race mode). i search a little bit wiki, but i cant find any fuction about that. so is that possible? if its can you give me some fuction about that? thanks for now
  12. thank you solidsnake, you are the one.
  13. Yes i am using it on race. i know its on racevoting_server.lua. but idk how i do it.
  14. thanks for explain. so would you help me about that?
  15. Hello, i want add random section to votemanager like the picture. can you help me about that please?
  16. myyusuf

    Map Ratings

    addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function (mapInfo) local map = exports.mapmanager:getRunningGamemodeMap() local mapname = getResourceName(map) rate = exports.mapratings:getMapRating(mapname) if rate then ortalamaoy = rate.average toplamkisi = rate.count setTimer(outputChatBox,50,1,"#c0c0c0It has average rating "..tostring(ortalamaoy).."#c0c0c0/#00ff0010 #c0c0c0(by "..tostring(toplamkisi).." players)",getRootElement(),255,255,255,true) end end ) change race_mapratings name to mapratings. its server-side.
  17. i have a same problem. when i do register this say Unknown Error. i upload again admin resource but problem not solved. what i have to gonna do?
×
×
  • Create New...