Vamos lá!
Primeiro de tudo você tem de saber inglês!
Alguns Códigos
A maioria dos códigos é "GetPlayer" ou "SetPlayer" e o que quer, e (index).
O "(index) é usado para reconhecer o jogador. Exemplos:
GetPlayerLevel(index)
SetPlayerLevel(index, 2)
GetPlayerSprite(index)
SetPlayerSprite(index, 1)
GetPlayerName(index)
SetPlayerName(index, "Name")
GetPlayerPK(index)
SetPlayerPK(index, 1)
Entre outros...
Os números depois do index, reparem que nesses códigos são usados apenas no SetPlayer.
Ou seja, ele está indicando o que é pra mudar, ex:
SetPlayerLevel(index, 2) - Setar o level a 2.
O que é If?
If é Se, ele é usado assim: "Se ele tiver tal coisa então" por exemplo: "Caso ele tenha o level 5" que é: If GetPlayerLevel(index) = 5 Then
Lembre-se, que tem de fechar o "If" com um "End if" no final!
Then
O Then (Então) é usado sempre após o código do If. repare no código de cima ( o do level.).
Else, Elseif
Else é usado como condição. Exemplo: Se ele tiver tal coisa então por sprite x, caso não(else) sair da sub(exit sub):
If GetPlayerSprite(index) = 2 Then
Call SetPlayerSprite(index) = 3
Else
Exit Sub
End If
Elseif
Elseif é uma condição, que compõe mais uma condição(se). Ex: ...Caso não, fazer outra condição.
If GetPlayerSprite(index) = 5 Then
Call SetPlayerSprite(index) = 10
Elseif GetPlayerSprite(index) = 15 Then
Call SetPlayerSprite(index) = 20
End If
Ou seja, após o Elseif, fará um código de If, como GetPlayerSprite.. mas não precisará do If, pois já terá "elseIF".
Select Case
Select case é usado algumas vezes para resumir Ifs. Exemplos:
Select Case GetPlayerSprite(index)
Case 1
Call SetPlayerSprite(index, 2)
Case 2
Call SetPlayerSprite(index, 3)
Case 3
Call SetPlayerSprite(index, 4)
End Select
Como nós abrimos a case como GetPlayerSprite, o número da case á a sprite necessitada, e o de setplayersprite é a sprite que será mudada.
Lembre-se, que sempre deve fechar o Select case com "End Select".
Pois Se fosse com Ifs:
If GetPlayerSprite(index) = 1 then
Call Setplayersprite(index) = 2
Elseif GetPlayerSprite(index) = 2 Then
Call SetPlayerSprite(index) = 3
Elseif GetPlayerSprite(index) = 3 Then
Call SetPlayerSprite(index) = 4]
End If
Viu, o Select case serve também para resumir Ifs, mas também pode usar o código com If, pois também funcionará.
Dim x as long
o Dim, é usado para usar uma abreviação como algum código.
Exemplo:
Dim Ki as Long
Após botar o código do Dim, necessita explicar o que significa a abreviação "Ki". Ex:
Ki = GetPlayerSTR(index) + GetPlayerDEF(index) + GetPlayerMAGI(index) + GetPlayerSPEED(index)
Após expecificar, basta criar o código. Ex:
If GetPlayerLevel(index) >= 0 Then
If GetPlayerAccess(index) >= 0 Then
Call PlayerMsg(index, "Você tem " & Ki & " de Ki.", 7)
Exit Sub
End If
End If
Ficando então:
Dim Ki as Long
Ki = GetPlayerSTR(index) + GetPlayerDEF(index) + GetPlayerMAGI(index) + GetPlayerSPEED(index)
If GetPlayerLevel(index) >= 0 Then
If GetPlayerAccess(index) >= 0 Then
Call PlayerMsg(index, "Você tem " & Ki & " de Ki.", 7)
Exit Sub
End If
End If
Créditos: RenanR - Por criar a aula!!
Estou adicionando mais coisas aqui na aula enquanto vocês aprendem com o que já botei!