-
Posts
3,875 -
Joined
-
Days Won
67
Everything posted by DNL291
-
Use source. empresa1 = createTeam("Viação 1001",255,255,255) empresa2 = createTeam("Nordeste",255,255,0) empresa3 = createTeam("Viação Catarinense",211,211,211) empresa4 = createTeam("Expresso Brasileiro",0,100,0) empresa5 = createTeam("Viação Cometa",0,0,255) empresa6 = createTeam("VIP",0,0,255) function spawn2(source) local empresaaa = getElementData(source,"empresa") if empresaaa == 1 then setPlayerTeam (source, empresa1) elseif empresaaa == 2 then setPlayerTeam (source, empresa2) elseif empresaaa == 3 then setPlayerTeam (source, empresa3) elseif empresaaa == 4 then setPlayerTeam (source, empresa4) elseif empresaaa == 5 then setPlayerTeam (source, empresa5) elseif empresaaa == 6 then setPlayerTeam (source, empresa6) end end addEventHandler("onPlayerSpawn", getRootElement(), spawn2) addCommandHandler("testarrr",spawn2)-- test command
-
I didn't understand what you want. I think you should use triggerServerEvent to set the player team when needed.
-
Because you're calling the function with the setTimer function and did not passed the Player argument.
-
Use o evento onClientGUIClick e guiSetVisible para mostrar/ocultar a imagem.
-
function gerarI (player, cmdName, targetPlayer) local target = getPlayerFromNamePart(targetPlayer) local geta = getPlayerName (target) outputChatBox ( "Nome: "..geta, getRootElement(), 255, 0, 0, true ) end addCommandHandler ( "pc", gerarI ) function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
-
Use o seguinte evento e funções: onClientGUIClick guiGetVisible guiSetVisible showPlayerHudComponent Você também pode usar setPlayerHudComponentVisible (a partir da versão 1.3.2). Se precisar de mais ajuda só perguntar aqui.
-
Skin mod: https://community.multitheftauto.com/ind ... ls&id=7937 DONE
-
I'm not sure i understand what you meant but, use "both" in keyState argument of the bindKey function.
-
Try this: Client: addEvent( "moneyn", true ) addEventHandler("onClientResourceStart", resourceRoot, function() qianbao.window[1] = guiCreateWindow(0.33, 0.28, 0.25, 0.16, "钱包", true) guiSetVisible(qianbao.window[1], false) guiWindowSetSizable(qianbao.window[1], false) guiSetAlpha(qianbao.window[1], 1.00) qianbao.label[1] = guiCreateLabel(0.10, 0.18, 0.34, 0.24, "你的金钱:", true, qianbao.window[1]) guiSetFont(qianbao.label[1], "default-bold-small") guiLabelSetColor(qianbao.label[1], 247, 246, 121) guiLabelSetHorizontalAlign(qianbao.label[1], "center", true) guiLabelSetVerticalAlign(qianbao.label[1], "center") qianbao.label[2] = guiCreateLabel(0.34, 0.38, 0.48, 0.23,"请登录!", true, qianbao.window[1]) guiSetText ( qianbao.label[2], qian ) guiLabelSetColor(qianbao.label[2], 213, 72, 92) guiLabelSetVerticalAlign(qianbao.label[2], "center") qianbao.staticimage[1] = guiCreateStaticImage(0.04, 0.18, 0.92, 0.76, ":login_mysql/images/qianbao.png", true, qianbao.window[1]) guiSetAlpha(qianbao.staticimage[1], 0.23) guiSetProperty(qianbao.button[1], "NormalTextColour", "FFAAAAAA") end) addEventHandler( "moneyn", getRootElement(), function(qian) bindKey("F5", "down", function() toggleWindow() end) end ) function toggleWindow() guiSetVisible(qianbao.window[1], not guiGetVisible(qianbao.window[1])) showCursor(guiGetVisible(qianbao.window[1])) end Server: addEventHandler("onPlayerJoin", getRootElement(), function() setTimer(function() handler = mysql_connect( host, username, password, db ) if handler then local result = mysql_query(handler, "SELECT Money FROM players WHERE Username='crazyde21'")-- Execute the query for result,row in mysql_rows(result) do -- Iterate through all the result rows mysql_field_seek(result, 1) -- Reset the field cursor to the first field for k,qian in ipairs(row) do local field = mysql_fetch_field(result) -- Retreive the field data triggerClientEvent(source,"moneyn",getRootElement(),qian) end end end end,10000,0) end )
-
É tão difícil assim de encontrar onde está a função createVehicle? Não seja preguiçoso. Ctrl + f --> createVehicle --> Enter, e procure onde a função está destacada. Ou procure navegando pelo script mesmo.
-
Does that mean it not works?
-
Você quer que o jogador se teleporte para dentro do veículo quando ele criar um? Se for isso, abra o script fr_server.lua e coloque isso depois da função createVehicle (deve estar na linha 328): warpPedIntoVehicle(source, vehicle)
-
Try this: col50 = createColTube(778.02728271484, -1325.1665039063, 13.546875, 10, 10) local gate50 = createObject(980,777.1341796875,-1329.7197265625,14.546875, 0, 0 , 178.50030517578 ) function openGate50(hitElement) if (hitElement and isElement(hitElement) then if (getElementType(hitElement) == "vehicle") then local player = getVehicleController(hitElement) elseif (getElementType(hitElement) == "player") then local player = hitElement else return end if (player) then local group = exports.UIPgroups:getPlayerGroup(player) if not group then return end if (group == "SWATTeam" or exports.UIPteams:isPlayerInTeams(player, "Staff")) then moveObject(gate50,1000,777.1845703125,-1329.7197265625,14.546875+6, 0, 0, 0 ) end end end end addEventHandler("onColShapeHit", col50, openGate50) function closeGate50(hitElement) if (hitElement and isElement(hitElement) then if (getElementType(hitElement) == "vehicle") then local player = getVehicleController(hitElement) elseif (getElementType(hitElement) == "player") then local player = hitElement else return end if (player) then local group = exports.UIPgroups:getPlayerGroup(player) if not group then return end if (group == "SWATTeam" or exports.UIPteams:isPlayerInTeams(player, "Staff")) then moveObject(gate50, 980,777.1845703125,-1329.7197265625,14.546875, 0, 0, 0) end end end end addEventHandler("onColShapeLeave", col50, closeGate50)
-
Replace 'vehicle' with 'v'.
-
Abra o script fr_server.lua no recurso freeroam, e remova (ou deixe como comentário) isto: addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() if chatTime[source] and chatTime[source] + tonumber(get("*chat/mainChatDelay")) > getTickCount() then outputChatBox("Stop spamming main chat!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end if get("*chat/blockRepeatMessages") == "true" and lastChatMessage[source] and lastChatMessage[source] == msg then outputChatBox("Stop repeating yourself!", source, 255, 0, 0) return else lastChatMessage[source] = msg end local r, g, b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) end end )
-
Show your meta.xml file.
-
Quando vi o código, imaginei que fosse uma outra linguagem, mas pode ser que seja Lua mesmo só que voltado para celulares, como você disse.
-
addEventHandler "onClientGUIClick" stopSound addEventHandler( "onClientResourceStart", resourceRoot, function() local sound = playSound("sounds/lol.mp3") setSoundVolume(sound, 0.5) end )
-
Try this: local eTeams = { ["Police Officers"] = true, ["SWAT"] = true, ["FBI"] = true, ["SAAF"] = true } addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon, _, _, _, _, _, hitElement) if (hitElement) and (getElementType(hitElement) == "player") and (weapon == 23) then local Team = getPlayerTeam(source) local TeamName = Team and getTeamName(Team) or "" if (eTeams[TeamName]) then outputChatBox("You have tazed "..getPlayerName(hitElement), 255, 0, 0) triggerServerEvent("onShot", localPlayer, hitElement) end end end) addEventHandler("onClientPlayerDamage", localPlayer, function(attacker, weapon) if (weapon == 23) then local Team = getPlayerTeam(attacker) if (Team) and (eTeams[getTeamName(Team)]) then cancelEvent() end end end) Try using this function: function getPlayerCountWithinMarker(theMarker) if (theMarker) then local totalPlayers = 0 for _, player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player, theMarker) then totalPlayers = totalPlayers + 1 end end return totalPlayers end return false end
-
Isso não é o suficiente para alguém poder ajudá-lo. O que você quer fazer com esse código? O que você quer mover? Um objeto ou um retângulo (como foi dito no 1º post). Ou esse retângulo é um objeto? Explique melhor. Além disso, eu já indiquei as funções no meu post acima.
-
De nada.
-
local coco = createMarker( -5894.84375, 1705.669921875, 190.88436889648, "Cylinder", 3, 143, 7, 49, 255) function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local account = getPlayerAccount( hitElement ) local zombiekills = getAccountData(account,"Zombie kills") if (zombiekills <= 100000) then local skin = 155 setTimer( function() slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) local id = getElementModel ( slothbot1 ) if id == 155 then exports.extra_health:setElementExtraHealth(slothbot1, 1000) outputChatBox("The Boss 1 has spawned !!!", getRootElement(), 255, 0, 0) myBlip = createBlipAttachedTo ( slothbot1, 23 ) end end, 10000, 1 ) end end addEventHandler( "onMarkerHit", coco, MarkerHit )
-
Você quer mover um objeto ou um retângulo (colshape)? O título do tópico deixa confuso. Se for um retângulo, você pode movê-lo usando o evento onClientRender + setElementPosition, ou interpolateBetween com setElementPosition. Se for objeto use moveObject.