Marcelo.S
Members-
Posts
17 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Marcelo.S's Achievements
Square (6/54)
1
Reputation
-
Obrigado aos dois que ajudaram. Realmente não era AccountData e sim ElementData. Aparentemente está tudo resolvido e o script está funcionando perfeitamente.Obrigado
-
Estou tentando fazer com que quando o jogador der /kd as KILL, MORTES E HEADSHOTS dele seja resetado. Porém não sei o motivo que não está dando certo. Ele manda o outputChatBox porém não reseta nada. function setPlayerStats(thePlayer) local account = getPlayerAccount(thePlayer) if account then setAccountData(account,"kills", 0) setAccountData(account,"headshots", 0) setAccountData(account,"deaths", 0) outputChatBox("[sTATS]".. getPlayerName(thePlayer) .." SEU K/D FOI RESETADO", getRootElement(), 50, 255, 0) end end addCommandHandler("kd", setPlayerStats)
-
Ae mano consegui obrigado a todos que me ajudaram.
-
Não funcionou não. Quando dou stop aparece no debug Linha 30: Bad argument @'setElementFrozen'[Expected bool at argument 2, got nil]
-
é realmente ficou bem melhor, mais gostaria de saber como faz pra quando desativar o mod ele desfrezar o player
-
SpawnM = createMarker(-2396.8295898438,-617.03546142578,131.75123596191, "cylinder",1.5, 255, 255, 255, 50) function msg(player) outputChatBox("Você foi congelado até iniciar o Round!!", player, 255, 255, 255,true) end addEventHandler("onMarkerHit", SpawnM, msg) function frozen(source) if isElementWithinMarker(source, SpawnM) then setElementFrozen(source, true) end end addEventHandler("onMarkerHit",root,frozen) Então até ai tá ok. Gostaria só de saber como faço pra quando o mod for desativado o player que esta freezado ser desfreezado.
-
local x, y = guiGetScreenSize () -- Obtém a resolução do jogador, no meu caso x = 1366 e y = 768 function HUD () dxDrawLine (x/2 - 240, y - 25, x/2 - 240, y - 5, tocolor(0, 0, 0, 255)) -- Linha da esquerda dxDrawLine (x/2 - 240, y - 25, x/2 + 240, y - 25, tocolor(0, 0, 0, 255)) -- Linha superior dxDrawLine (x/2 - 240, y - 5, x/2 + 240, y - 5, tocolor(0, 0, 0, 255)) -- Linha inferior dxDrawLine (x/2 + 240, y - 25, x/2 + 240, y - 5, tocolor(0, 0, 0, 255)) -- Linha da direita dxDrawRectangle (x/2 - 240, y - 25, 480, 20, tocolor(46, 46, 46, 155)) -- Retângulo centralizado horizontalmente na tela. dxDrawText (' [INFO]: '..MensagensInfo[cont], x/2 - 240, y - 25, x/2 + 240, y - 5, tocolor(255, 255, 255, 255), 1, "default", "center", "center", true) -- Texto centralizado no retângulo. end addEventHandler ("onClientRender", root, HUD) tMensagems = 1 cont = 1 MensagensInfo = { "Falta 10 Minutos para acabar o Roud.", "Falta 9 Minutos para acabar o Roud.", "Falta 8 Minutos para acabar o Roud.", "Falta 7 Minutos para acabar o Roud.", "Falta 6 Minutos para acabar o Roud.", "Falta 5 Minutos para acabar o Roud.", "Falta 4 Minutos para acabar o Roud.", "Falta 3 Minutos para acabar o Roud.", "Falta 2 Minutos para acabar o Roud.", "Falta 1 Minutos para acabar o Roud.", "Roud Finalizado. X1 de Costas Será iniciado!", } setTimer(function ( ) cont = cont +1 end, tMensagems * 60000 , 0) Estou usando o script como você pode ver acima, pra informar quantos minutos faltar pra acabar, funciona tudo bem mais por exemplo se tiver em 9 minutos e o player relogar volta pra 10 Minutos somente pra ele, pra os outros continua apartir dos 9 minutos. Já alterei o onClientRender para onResourceStart , mais não aparece nada na tela quando faço isso.
-
E quando muda resolução fica mais torto ainda poderia me ajudar e no texto também é que não entendo muito.
-
dxDrawRectangle era pra ficar centralizado na parte inferior da tela, pra quem ta na resolução 1366x768 fica, mais quem te em resolução diferente não fica
-
function HUD () dxDrawLine(448 - 1, 743 - 1, 448 - 1, 764, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(850, 743 - 1, 448 - 1, 743 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(448 - 1, 764, 850, 764, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(850, 764, 850, 743 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(448, 743, 402, 21, tocolor(46, 46, 46, 155), false) dxDrawText("", 623, 588, 623, 588, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, HUD) addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end ) Criei esse Dx pra mandar algumas informações na tela, fiz na resolução 1366x768. O pessoal com resolução diferente tá ficando torto teria como por pra ajustar em todas resoluções?
-
Vlw mano funcionou. Obrigado
-
Ao invés de ser math.random trocaria por qual função? já tentei outra e só repete. Queria colocar a função em ordem, exe: 10...9...8.... minutos tMensagems = 1 -- TEMPO MensagensInfo = { "Falta 10 Minutos para acabar o Roud.", "Falta 9 Minutos para acabar o Roud.", "Falta 8 Minutos para acabar o Roud.", "Falta 7 Minutos para acabar o Roud.", "Falta 6 Minutos para acabar o Roud.", "Falta 5 Minutos para acabar o Roud.", "Falta 4 Minutos para acabar o Roud.", "Falta 3 Minutos para acabar o Roud.", "Falta 2 Minutos para acabar o Roud.", "Falta 1 Minutos para acabar o Roud.", "Roud Finalizado. X1 de Costas Será iniciado!", } setTimer(function ( ) outputChatBox ('#FF0000[INFO]: #FFFFFF'..MensagensInfo[ math.random( 1,#MensagensInfo ) ] ,getRootElement(),255,255,255,true) end, tMensagems * 60000 , 0)
-
Queria um comando troll tipo o cara da /vip e o jogo fecha ou sai do servidor. Sei que existe já o exit,quit mas todos ja sabem que é pra sair do jogo. queria algo troll que ngm soubese
-
Quando um player mata o outro não aparece no console. killmessages_server.lua local config = { ["lines"] = 5, ["startY"] = 0.35, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } local default = { ["lines"] = 5, ["startY"] = 0.25, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } local vehicleIDs = { [50]=true,[49]=true,[31]=true,[38]=true,[52]=true } function KillMessages_onPlayerWasted ( totalammo, killer, killerweapon, bodypart ) ---These are special checks for certain kill types local usedVehicle if killerweapon == 19 and isElement(killer) then --rockets killerweapon = killer and getElementType ( killer ) == "player" and getPedWeapon(killer) if not killerweapon then killerweapon = 51 end elseif vehicleIDs[killerweapon] then --heliblades/rammed if ( isElement(killer) and getElementType ( killer ) == "vehicle" ) then usedVehicle = getElementModel ( killer ) killer = getVehicleOccupant ( killer, 0 ) end elseif ( killerweapon == 59 and isElement(killer) ) then if ( getElementType ( killer ) == "player" ) then local vehicle = getPedOccupiedVehicle(killer) if ( vehicle ) then usedVehicle = getElementModel ( vehicle ) end end end --finish this -- Got a killer? Print the normal "* X died" if not if ( killer and isElement(killer) and getElementType ( killer ) == "player" ) then local kr,kg,kb = getPlayerNametagColor ( killer ) if getPlayerTeam ( killer ) then kr,kg,kb = getTeamColor ( getPlayerTeam ( killer ) ) end -- Suicide? if (source == killer) then if not killerweapon then killerweapon = 255 end local triggered = triggerEvent ( "onPlayerKillMessage", source,false,killerweapon,bodypart ) --outputDebugString ( "Cancelled: "..tostring(triggered) ) if ( triggered ) then eventTriggered ( source,false,killerweapon,bodypart,true,usedVehicle) return end end local triggered = triggerEvent ( "onPlayerKillMessage", source,killer,killerweapon,bodypart ) --outputDebugString ( "Cancelled: "..tostring(triggered) ) if ( triggered ) then eventTriggered ( source,killer,killerweapon,bodypart,false,usedVehicle) end else local triggered = triggerEvent ( "onPlayerKillMessage", getRandomPlayer(),false,killerweapon,bodypart ) --outputDebugString ( "Cancelled: "..tostring(triggered) ) if ( triggered ) then eventTriggered ( source,false,killerweapon,bodypart,false,usedVehicle) end end end addEventHandler ( "onPlayerWasted", getRootElement(), KillMessages_onPlayerWasted ) addEvent ( "onPlayerKillMessage" ) function eventTriggered ( source,killer,weapon,bodypart,suicide,usedVehicle ) local wr,wg,wb = getPlayerNametagColor ( source ) if getPlayerTeam ( source ) then wr,wg,wb = getTeamColor ( getPlayerTeam ( source ) ) end local kr,kg,kb = false,false,false if ( killer ) then kr,kg,kb = getPlayerNametagColor ( killer ) if getPlayerTeam ( killer ) then kr,kg,kb = getTeamColor ( getPlayerTeam ( killer ) ) end end if ( usedVehicle ) then weapon = usedVehicle end outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon ) -- local extra = "" if ( usedVehicle ) then extra = " (Vehicle)" end if ( killer ) then if suicide then local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself. ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself."..extra ) end else local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source)..". ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source).."."..extra ) end end else outputConsoleKillMessage ( "* "..getPlayerName(source).." died."..extra ) end -- end function outputConsoleKillMessage ( text ) outputConsole ( text ) end function outputKillMessage ( killed, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) if ( resource ) then resource = getResourceName(resource) end if not isElement(killed) then outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end if not getElementType(killed) == "player" then outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end return triggerClientEvent(getRootElement(),"onClientPlayerKillMessage",killed,killer,weapon,wr,wg,wb,kr,kg,kb,width,resource ) end function outputMessage ( message, visibleTo, r, g, b, font ) if type(message) ~= "string" and type(message) ~= "table" then outputDebugString ( "outputMessage - Bad 'message' argument", 0, 112, 112, 112 ) return false end if not isElement(visibleTo) then outputDebugString ( "outputMessage - Bad argument", 0, 112, 112, 112 ) return false end --Turn any resources into resource names if type(message) == "table" then for i,part in ipairs(message) do if type(part) == "table" and part[1] == "image" then if part.resource then message[i].resourceName = getResourceName(part.resource) else part.resourceName = getResourceName(sourceResource) end end end end return triggerClientEvent ( visibleTo, "doOutputMessage", visibleTo, message, r, g, b, font ) end function setKillMessageStyle ( startX,startY,align,lines,fadeStart,fadeAnimTime ) if ( not startX ) then startX = default.startX end if ( not startY ) then startY = default.startY end if ( not align ) then startY = align.startY end if ( not lines ) then lines = default.lines end if ( not fadeStart ) then fadeStart = default.startFade end if ( not fadeAnimTime ) then fadeAnimTime = default.fadeTime end config.startX = startX config.startY = startY config.align = align config.lines = lines config.startFade = fadeStart config.fadeTime = fadeAnimTime for k,v in ipairs(getElementsByType"player") do triggerClientEvent(v,"doSetKillMessageStyle",v,config.startX,config.startY,config.alignX,config.lines,config.startFade,config.fadeTime) end return true end addEvent ("onClientKillmessagesLoaded",true) addEventHandler ( "onClientKillmessagesLoaded", getRootElement(), function() triggerClientEvent(source,"doSetKillMessageStyle",source,config.startX,config.startY,config.alignX,config.lines,config.startFade,config.fadeTime) end )
