-
Posts
18 -
Joined
-
Last visited
Posts posted by Iaan
-
-
But, you can add this. The resource editor is open source.
-
34 minutes ago, #banana said:
Calma ai galera,se for pra fazer uma disputa de conhecimento sobre scripting eu faço,mas aqui não é lugar.
Não é disputa não, é por que sempre tem um jeito melhor de fazer melhorando o desempenho, entendeu? É sempre bom conhecer como funciona.
-
19 hours ago, lordhenry said:
Esse jeito acima não vai dar certo. A variável isDrunk será aplicada ao script em si e não aos jogadores. Dessa forma, se um jogador der o comando /bebado e a variável ficar true, dai essa variável será true para todo mundo.
Eu faria desse jeito assim:
function onJoin (source) setElementData (source,"drunk.Status", false) -- Todo jogador que entra no server recebe status de bêbado como false por padrão. end addEventHandler ("onPlayerJoin", getRootElement(), onJoin) function drunkPlayer (source) if getElementData (source,"drunk.Status") == false then -- Se o jogador estiver com status de bêbado como false, faz o seguinte: setPedWalkingStyle (source, 126) -- Coloca estilo de andar bêbado. toggleControl (source, "sprint", false) -- Desativa a função de correr, podendo somente andar na velocidade normal ou caminhar. setElementData (source, "drunk.Status", true) -- Coloca o status de bêbado desse jogador como true. else -- Se o jogador não possuir status de bêbado como false, faz o seguinte: setPedWalkingStyle (source, 0) -- Coloca estilo de andar normal. toggleControl (source, "sprint", true) -- Ativa a função de correr. setElementData (source, "drunk.Status", false) -- Coloca o status de bêbado desse jogador como false. end end addCommandHandler ("bebado", drunkPlayer) -- Executa essa função ao usar o comando /bebado.
Exato, meu exemplo foi o mais genérico possível. Queria apenas demonstrar o uso da função e não fazer um script para /bebado.
-
Se caso o problema for com você, verifique se você não bloqueou a porta 22005 no seu modem.
(Fica ai a resposta pra quem ainda tem o problema.)
-
Pelo o que parece, você foi pego usando hack,Cheat Engine ou algo do gênero.
Terá que esperar acabar seu banimento.
-
23 minutes ago, #banana said:
sim,intendi seu modo de pensar mas como já disse no post gostaria de fazer ele andar como uma animação,pois se eu colocar o setPedWalkingStyle vão poder correr e etc... então vai fugir do foco principal que é só fazer andar bêbado sem correr.
Havia entendido que só precisava do style...
Para fazer do jeito que você quer, assim que você ativa a animação você vai precisar bloquear o controle de correr com toggleControl(https://wiki.multitheftauto.com/wiki/ToggleControl) e quando sair da animação, você vai precisar habilitar novamente.
local isDrunk = false function drunkPlayer(player,cmd) if not (isDrunk) then setPedWalkingStyle(player,126) toggleControl(player,"sprint",false) isDrunk = true else setPedWalkingStyle(player,0) toggleControl(player,"sprint",true) isDrunk = false end end addCommandHandler("bebado",drunkPlayer)
(Não testei)
-
https://wiki.multitheftauto.com/wiki/SetPedWalkingStyle
ID: 126 (MOVE_DRUNKMAN)
Olhando a wiki, dá pra ver todos os ID e estilos pra andar.
-
function changeSkin(player,cmd,skinID) skinID = tonumber(skinID) if(skinID) then if(setElementModel(player,skinID)) then outputChatBox("SKIN SETADA.",player) else outputChatBox("Erro ao setar skin.",player) end end end addCommandHandler("change",changeSkin)
Recomendo a entender os conceitos básicos de programação pois isso é um script muito simples. (Caso não tenha uma verificação de quem pode alterar a skin e tudo mais.)
Mas existe resources que são mais completos, basta procurar na MTA Community.
-
16 hours ago, DNL291 said:
Acho que me entendeu mal. Eu vi que já resolveu usando: local playeraccount = getPlayerAccount ( source ). E nada contra sobre ter funcionado, se tá tudo OK, parabéns por conseguir arrumar o código, dessa forma que aprende Lua na verdade.
Eu disse sobre aquele erro "Expected element at argument 1, got nil", era por causa do: setTimer(function()... Isso cria outra função, e source passa a ser inválido. Mas passando o elemento para a função criada em setTimer vai resolver, como eu disse. Evita definir uma variável que ocupa mais memória, a na verdade é a solução mais lógica.
Exatamente, acho que muitos aprendem errado dessa forma pensando "se está funcionando está certo.".
É bom tentar sempre otimizar o código.
- 2
-
Awesome, when i watched your system, i remembered this video, your system was based it?
-
7 minutes ago, Dante383 said:
Good idea, but I would do asterisk substitute for any characters also. For example:
*.txd - all files with txt extension
file_*.txd - file_1, file_2, file_3, etc
Of course, this is another nice example.
-
-
- Popular Post
- Popular Post
Hello everyone
Today I was thinking of a pro idea in the "meta.xml" file.
<file src = "images/*" />
The "*" represents all archives. (Loop)
When I do this, everything in the resource, in the folder "images" will be imported automatically, avoiding to write each file.
- 12
-
6 hours ago, ccw said:
Does the MTA Linux server have full internet access?
What server IP is shown in the server log:
Querying MTA master server... success! (Auto detected IP:?????)
Before,IP is not shown, now i tried and successful.
1 - Open the linux-server and wait for IP
2 - Open client in VM
Thanks for support, bro. -
6 hours ago, ccw said:
Please start the Linux server again.
I tried this:
1 - Open Linux Server
2 - Try enter MTA client...
But when I open the Linux server and open the client on the VM, same thing happens.
-
1 hour ago, ccw said:
What happens when you press 'OK' ?
Opens a site with these instructions:
But i found a bug when i tried this.
1 - Desactive internet from your Linux (So that your virtual machine does not have internet)
2 - Open your server in linux with root
3 - Open your mta-client in vm
4 - Then the MTA will not check your serial and will open.
5 - Play it
(You can let your IP from virtual machine invalid for use only local)
Works only on local servers.
If you activate internet then MTA crashes
-
Hello everyone, I'm having problems with the `mta sa` client ...
When I installed the MTA and try to open it it gives me the following message:
---------------------------
MTA: San Andreas [CN01] (CTRL+C to copy)
---------------------------
There was a problem validating your serial
---------------------------
OK
---------------------------Moderator edit (knownledgebase note): If you're getting the error "CN01: There was a problem validating your serial" then you need to:
follow the instructions at https://updatesa.multitheftauto.com/sa/trouble/?tr=serial-validation
For example, if you're on Windows, these would be the extended steps for instruction 1) at the link above
- Run MTA on the host system atleast once, so without VMware on the same PC.
- Then use VM(ware) to use MTA again, after doing that.
Reason: MTA wants to generate your MTA serial on the 'real' PC, so it can restore your original MTA serial into your VM. This is a technical measure to stop people from ban evading & easy serial changing with VM's.
So long story short, you just need to use MTA without VM one time, and then you can keep using VM forever. Your PC cannot "first meet" MTA while running through a VM.
If you're on Linux, the Linux MTA server contains an alternative to complete the same process; use instruction 2 from the link.
I can open gta-sa normally...
Someone can help me?
Ps: I forgot, I'm using a virtual machine (VMWARE)
Import all files in meta
in Suggestions
Posted
I know it, but, why not implement this ? It's something simple and very productive.
I use a script similiar: