-
Posts
24 -
Joined
-
Last visited
Everything posted by KingSCR
-
Meu amigooo.. que mudança... agora cabe a mim a aprender cada argumento que você usou! Obrigado de coração ? Como funciona o hitElement e o matchingDimension na função? function entrar1(hitElement, matchingDimension) if isElement(hitElement) and matchingDimension then if getElementType(hitElement) == "player" and not isPedInVehicle(hitElement) then
- 9 replies
-
- onmarkerhit
- ispedinvehicle
-
(and 2 more)
Tagged with:
-
function entrar1 (thePlayer) if isElement(thePlayer) and getElementType(thePlayer) == "player" then local acc = getPlayerAccount(thePlayer) if acc and not isGuestAccount(acc) then local accName = getAccountName(acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then setElementInterior(thePlayer, 10, 246.39647, 110.09633, 1003.22571) setElementDimension(thePlayer, 2) else --outputChatBox( "Você não tem permissão!", thePlayer, 200, 0, 0, false ) dxMsg(thePlayer, "Você não tem permissão para entrar aqui!", "error") end end end end addEventHandler ("onMarkerHit", entrar, entrar1)
- 9 replies
-
- onmarkerhit
- ispedinvehicle
-
(and 2 more)
Tagged with:
-
me retornou um erro 'then' expected ear linha 111: if isElement(thePlayer) and getElementType(thePlayer) == "player" then
- 9 replies
-
- onmarkerhit
- ispedinvehicle
-
(and 2 more)
Tagged with:
-
@MainSCR" Porque usou o parâmetro thePlayer em todos argumentos das funções e não usou no argumento do isPedInVehicle?" Resposta: Estou aprendendo cara kk -' Vou tentar com getElementType(thePlayer) == "player"..
- 9 replies
-
- onmarkerhit
- ispedinvehicle
-
(and 2 more)
Tagged with:
-
Olá amigos da comunidade, estou aprendendo um pouco de programação e estou com uma duvida no meu teleporte. Estou tentando usar o "isPedInVehicle" como faço isso? Meu código está assim: local entrar = createMarker(2033.91504, -1402.85449, 16, "cylinder", 2, 255, 0, 0, 50) function entrar1 (thePlayer) local acc = getPlayerAccount(thePlayer) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then setElementInterior(thePlayer, 10, 246.39647, 110.09633, 1003.22571) setElementDimension(thePlayer, 2) else --outputChatBox( "Você não tem permissão!", thePlayer, 200, 0, 0, false ) dxMsg(thePlayer, "Você não tem permissão para entrar aqui!", "error") end end end addEventHandler ("onMarkerHit", entrar, entrar1) Estou tentando bloquear a teleporte com o veiculo usando um if com o "isPedInVehicle" function entrar1 (thePlayer) if not isPedInVehicle ( thePlayer ) then local acc = getPlayerAccount(thePlayer) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then setElementInterior(thePlayer, 10, 246.39647, 110.09633, 1003.22571) setElementDimension(thePlayer, 2) else --outputChatBox( "Você não tem permissão!", thePlayer, 200, 0, 0, false ) dxMsg(thePlayer, "Você não tem permissão para entrar aqui!", "error") end end end end addEventHandler ("onMarkerHit", entrar, entrar1) Assim penso eu que iria funcionar, mais nãaoo. O que estou fazendo de errado? ?
- 9 replies
-
- onmarkerhit
- ispedinvehicle
-
(and 2 more)
Tagged with:
-
Hi, I'm in need of help. I'm trying to show the player's life on the screen, however getElementhealth returns me a number like this "96.657466574" Can I convert it to integer? type: Life: 96 Sorry for my english, I'm using the translator. local Vida = getElementHealth ( localPlayer ) or 0 dxDrawText("Vida: "..Vida, x*932, y*62, x*1072, y*87, tocolor(255, 255, 255, 255), x*1.00, "default", "center", "center", false, false, false, false, false)
-
Eu fiz a seguinte modificação e funcionou! function Dar_VIP_AirNewSCR ( source, cmd, player, VIP, Dinheiro ) if player and VIP and tonumber(Dinheiro) and (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Console"))) then local Jogador = getPlayerFromPartialName ( player ) if Jogador then if not isGuestAccount ( getPlayerAccount ( Jogador ) ) then local Conta = getAccountName ( getPlayerAccount ( Jogador ) ) if VIP == "Alpha" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Alpha" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Alpha", source, 255, 255, 255, true ) end elseif VIP == "Epsylon" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Epsylon" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Epsylon", source, 255, 255, 255, true ) end Está tudo certo? Vou concertar tudo logo mais. Obrigado pela dica, estamos juntos.
-
Seguir todo seu curso! aprendi usar Arrays e o loop for. Obrigado
-
Thank you, stayed like this. Correct? function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) if not( isGuestAccount (getPlayerAccount(source)) ) then fadeCamera (source, false) setTimer (spawnPlayer, 1000, 1, source, 2036.1735839844, -1413.0563964844, 16.9921875, 0, getPedSkin (source), 0, 0, getPlayerTeam(source)) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 2000, 1, source, true) takeAllWeapons (player) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
-
Thanks, I'll try to add it to my save system. function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) if not( isGuestAccount (getPlayerAccount(source)) ) then local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) fadeCamera (source, false) setTimer (spawnPlayer, 1000, 1, source, 2036.1735839844, -1413.0563964844, 16.9921875, 0, getPedSkin (source), 0, 0, getPlayerTeam(source)) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 2000, 1, source, true) setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) takeAllWeapons (player) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) How does it work?
-
Hello my friends, I need to edit my Gamemode, as I do for when a player dies he loses all guns? Can someone help me? Sorry, I'm using the translator. : D
-
Hello my friends, I need to edit my Gamemode so when a player dies he loses all guns. Can someone help me? Sorry, I'm using the translator. : D
-
Olá meus amigos, estou precisando editar meu Gamemode para quando um player morrer ele perca todas as armas. Alguém pode me ajudar?
-
Ótimo vou estudar. mais eu estou tentando modificar sem usar o timestamp no momento, tentei tirar o data "consoleAirNewSCR e colocando permissão por Acl. Ficou certo? function Dar_VIP_AirNewSCR ( source, cmd, player, VIP, Dinheiro ) if isElement(cliente) then if player and VIP and (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Console"))) then local Jogador = getPlayerFromPartialName ( player ) if Jogador then if not isGuestAccount ( getPlayerAccount ( Jogador ) ) then local Conta = getAccountName ( getPlayerAccount ( Jogador ) ) if VIP == "Alpha" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Alpha" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Alpha", source, 255, 255, 255, true ) end elseif VIP == "Epsylon" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Epsylon" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Epsylon", source, 255, 255, 255, true ) end elseif VIP == "Sigma" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Sigma" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Sigma", source, 255, 255, 255, true ) end elseif VIP == "Omega" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Omega" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Omega", source, 255, 255, 255, true ) end end if VIP == "Alpha" or VIP == "Epsylon" or VIP == "Sigma" or VIP == "Omega" then --return outputChatBox ( "* Erro: Esse VIP não existe!", source, 255, 255, 255, true ) --end Estou tentando o comando /ativar login omega 50 e não acontece nada, agora vou fazer um debug com outputChatBox pra ver o que está ocorrendo com o script. Me ajude por favor;
-
Boa noite meus querido, alguns dias atrás, me cadastrei no fórum a procura de conhecimento.. estava com muita dificuldade para modificar um script simples e vim procurar ajuda no forum. Assim, várias pessoas me ajudaram, até o moderador do fórum português . Muito obrigado pela ajuda para solucionar este script.. vou mostrar o script antes e depois da modificação que me ajudaram a solucionar. Primeiro código antes da modificação! function DAR_XP_AIRNEWSCR ( source, cmd, pname, Quantidade ) if pname and tonumber(Quantidade) then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then if getElementData ( source, "Console_AirNewSCR" ) == "Sim" then setElementData ( cliente, "Level", Quantidade ) exports.Scripts_Dxmessages:outputDx(source, "Você Setou o Level do(a) Jogador(a) "..getPlayerName(cliente).."#ffffff para "..Quantidade.." com Sucesso!", "success") exports.Scripts_Dxmessages:outputDx(cliente, "O(A) Admin "..getPlayerName(source).."#ffffff Setou seu Level para "..Quantidade.." com Sucesso!", "success") end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler ( "level", DAR_XP_AIRNEWSCR ) Código modificado ficou assim usando o comando /level "nomeDoPlayer" "level" function DAR_XP_AIRNEWSCR ( source, cmd, pname, Quantidade ) if pname and tonumber(Quantidade) and (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Console"))) then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then setElementData ( cliente, "Level", tonumber(Quantidade) ) exports.Scripts_Dxmessages:outputDx(source, "Você Setou o Level do(a) Jogador(a) "..getPlayerName(cliente).."#ffffff para "..Quantidade.." com Sucesso!", "success") exports.Scripts_Dxmessages:outputDx(cliente, "O(A) Admin "..getPlayerName(source).."#ffffff Setou seu Level para "..Quantidade.." com Sucesso!", "success") else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler ( "level", DAR_XP_AIRNEWSCR ) Agora estou com com um novo Script usando o mesmo data "Console_AirNewSCR" e quero saber se tem como eu modificar ele para dar vip usando o comando /ativar "nomeDoPlayer" "tipodovip""dinheiro" e quantos dias irá durar o vip. estou contando com a ajuda desse fórum que tem ótimos scripts que tem um conhecimento um mais avançado que eu . Meu muito obrigado dês de já! ? Comando_VIP = "ativar" Grupo = "Console" -- Grupo no Painel P ( Manage ACL ) function getPlayerFromPartialName ( 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 function Dar_VIP_AirNewSCR ( source, cmd, player, VIP, Dinheiro ) if getElementData ( source, "Console_AirNewSCR" ) == "Sim" then if player and VIP then local Jogador = getPlayerFromPartialName ( player ) if Jogador then if not isGuestAccount ( getPlayerAccount ( Jogador ) ) then local Conta = getAccountName ( getPlayerAccount ( Jogador ) ) if VIP == "Alpha" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Alpha" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Alpha", source, 255, 255, 255, true ) end elseif VIP == "Epsylon" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Epsylon" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Epsylon", source, 255, 255, 255, true ) end elseif VIP == "Sigma" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Sigma" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Sigma", source, 255, 255, 255, true ) end elseif VIP == "Omega" then if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Omega" ) ) then return outputChatBox ( "* Erro: Esse Jogador já é VIP Omega", source, 255, 255, 255, true ) end end if VIP == "Alpha" or VIP == "Epsylon" or VIP == "Sigma" or VIP == "Omega" then --return outputChatBox ( "* Erro: Esse VIP não existe!", source, 255, 255, 255, true ) --end aclGroupAddObject ( aclGetGroup( VIP ), "user."..Conta ) Musica_Selecionada = math.random ( 1, 3 ) triggerClientEvent ( root, "AirNewSCR_Ativar_VIP", root, Musica_Selecionada, VIP ) if Musica_Selecionada == 1 then --outputChatBox ( "Arquivos/Rae_Sremmurd_Black_Beatles_ft_Gucci_Mane.mp3", source ) Musica_Tocando = "Rae Sremmurd - Black Beatles ft. Gucci Mane" Bonus = 0 elseif Musica_Selecionada == 2 then --outputChatBox ( "Arquivos/Post_Malone_Congratulations_ft_Quavo.mp3", source ) Musica_Tocando = "Post Malone - Congratulations ft. Quavo" Bonus = 50 elseif Musica_Selecionada == 3 then --outputChatBox ( "XXXTENTACION_Look_At_Me.mp3", source ) Musica_Tocando = "XXXTENTACION - Look At Me!" Bonus = 100 end setElementData ( root, "Ultimo_Ativador", getPlayerName(Jogador) ) setElementData ( root, "VIP_do_Ultimo_Ativador", VIP ) outputChatBox ( " ", root ) outputChatBox ( " ", root ) outputChatBox ( "=======================================================", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) "..getPlayerName(Jogador).." #ffffffAtivou um Plano VIP "..VIP, root, 255, 255, 255, true ) if Bonus == 0 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, Não foi dessa vez!", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 0 ) end elseif Bonus == 50 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, +50% de 1kk (1kk500k)", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP (+500k Bonus)", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 500000 ) end elseif Bonus == 100 then outputChatBox ( "* Seu Bonus de Ativação foi de "..Bonus.."%, +100% de 1kk (2kk)", root, 255, 255, 255, true ) outputChatBox ( "* O(A) Jogador(a) Recebeu 1kk pela Ativação do VIP (+1kk Bonus)", root, 255, 255, 255, true ) if Dinheiro ~= false then givePlayerMoney ( Jogador, 1000000 ) givePlayerMoney ( Jogador, 1000000 ) end end outputChatBox ( "* Musica Tocando: "..Musica_Tocando, root, 255, 255, 255, true ) outputChatBox ( "=======================================================", root, 255, 255, 255, true ) outputChatBox ( " ", root ) outputChatBox ( " ", root ) outputDebugString ( "[ Ativação ] - O(A) Admin "..getPlayerName(source).." Ativou um VIP para o(a) Jogador(a) "..getPlayerName(Jogador).."!" ) outputDebugString ( "[ Ativação ] - Bonus do VIP Gerado: "..Bonus.."%" ) setTimer ( function() restartResource ( getThisResource ( ) ) -- Reinicia o Mod Automaticamente! outputDebugString ( "[ AirNewSCR ] - Resource 'Scripts_AtivarVIP' Reiniciado Automaticamente! " ) end, 15000, 1 ) end end else outputChatBox ( "* Erro: Jogador não encontrado!", source, 255, 255, 255, true ) end end end end addCommandHandler ( Comando_VIP, Dar_VIP_AirNewSCR ) function Verificar_Emprego_Atual ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( Grupo ) ) then setElementData ( player, "Console_AirNewSCR", "Sim" ) else setElementData ( player, "Console_AirNewSCR", "Não" ) end end end end setTimer ( Verificar_Emprego_Atual, 1500, 0 ) -- By AirNewSCR
-
Ok, vou enviar em seu Privado!
-
Sim, está linha está no comando.. Na função que estamos mexendo. Copiei o codigo pelo pastbin e ainda está ocorrendo o mesmo erro! (Print do notepad++) http://prntscr.com/mcwt95 (Print do Console) http://prntscr.com/mcwuf5
-
Obrigado pelo suporte! ? Você viu o outro erro que está ocorrendo? [16:23:17] SCRIPT ERROR: [meusmods]\[airnew]\Scripts_LevelSystem\AirNew_s.lua:47 : unexpected symbol near 'ï' [16:23:17] ERROR: Loading script failed: [meusmods]\[airnew]\Scripts_LevelSystem \AirNew_s.lua:47: unexpected symbol near 'ï' (print do console) http://prntscr.com/mcwq6o
-
Desculpe-me por ser leigo.. mais dependo muito da sua ajuda
-
Vou testar agora! Obrigado. Retorno para falar se funcionou ou nao Agora deu o seguinte erro [16:23:17] SCRIPT ERROR: [meusmods]\[airnew]\Scripts_LevelSystem\AirNew_s.lua:47 : unexpected symbol near 'ï' [16:23:17] ERROR: Loading script failed: [meusmods]\[airnew]\Scripts_LevelSystem \AirNew_s.lua:47: unexpected symbol near 'ï'
-
Olá, não sei oque pode está acontecendo agora, mais depois que modificamos o Script de level, quando eu dou level para alguem o script da agencia de emprego não está funcionando, está dando o seguinte erro no console. [14:30:22] ERROR: [airnew]\Scripts_AgenciaEmpregos\AirNew_s.lua:174: attempt to compare number with string vou compartilhar o script da agencia de emprego com vocês. function PizzaBoyAirNew () local Level = getElementData ( source, "Level" ) or 0 if Level > 4 then TudoInvisivel () setElementVisibleTo ( PizzaBoy, source, true ) setElementData ( source, "AirNew>Encaminhamento", "PizzaBoy" ) MensagemAirNewSCR ( "Emprego: Para Iniciar os Serviços siga o Checkpoint Vermelho em seu Minimapa", "success" ) triggerClientEvent ( source, "AirNew>FecharAgencia", root ) setElementData ( source, "Emprego", false ) else MensagemAirNewSCR ( "Emprego: Você não possui Nivel suficiente para essa Profissão!", "error" ) end end addEvent( "Encaminhar>PizzaBoy", true ) addEventHandler( "Encaminhar>PizzaBoy", getRootElement(), PizzaBoyAirNew )
-
Muito obrigado!