Macros -
AndrePls - 25.12.2012
Criei um outro tуpico e achei esse cуdigo lб:
Код:
#define Teleport(%0,%1,%2,%3,%4) SetPlayerPos(%0,%1,%2,%3);\
SetPlayerFacingAngle(%0,%4)
Achei um tutorial de macros mais nгo funcionou comigo, o cуdigo acima funcionou perfeitamente, mas queria saber, Pq o SetPlayerPos tem ponto e vнrgula e o SetPlayerFacingAngle nгo? Pq aquela barra(\) depois do SetPlayerPos()??
Re: Macros -
JonathanFeitosa - 25.12.2012
Aqui:
pawn Код:
#define Teleporte(%0,%1,%2,%3,%4); SetPlayerPos(%0,%1,%2,%3), SetPlayerFacingAngle(%0,%4);
o \ й para vocк continuar o cуdigo na outra linha !
pawn Код:
#define Teleporte(%0,%1,%2,%3,%4); \
SetPlayerPos(%0,%1,%2,%3), SetPlayerFacingAngle(%0,%4);
e й a mesma coisa que:
pawn Код:
stock Teleporte(playerid, X, Y, Z, Interior)
{
SetPlayerPos(playerid, X, Y, Z), SetPlayerFacingAngle(playerid, Interior);
}
mais com define й mais otimizado
Re: Macros -
AndrePls - 25.12.2012
Mais e os pontos e vнrgulas?
Re: Macros -
tonisantolia - 25.12.2012
Quote:
Originally Posted by AndrePls
Mais e os pontos e vнrgulas?
|
Olha um exemplo.
pawn Код:
SetPlayerPos(playerid,x,y,z);
SetPlayerFacingAngle(playerid,a);
// й o mesmo que:
SetPlayerPos(playerid,x,y,z),SetPlayerFacingAngle(playerid,a);
Re: Macros -
AndrePls - 25.12.2012
Quote:
Originally Posted by tonisantolia
Olha um exemplo.
pawn Код:
SetPlayerPos(playerid,x,y,z); SetPlayerFacingAngle(playerid,a);
// й o mesmo que: SetPlayerPos(playerid,x,y,z),SetPlayerFacingAngle(playerid,a);
|
Mais no macro sу o SetPlayerPos tem ponto e vнrgula, o SetPlayerFacingAngle nгo =/
Re: Macros -
tonisantolia - 25.12.2012
Quote:
Originally Posted by AndrePls
Mais no macro sу o SetPlayerPos tem ponto e vнrgula, o SetPlayerFacingAngle nгo =/
|
Como assim? eu e o jonathan demos exemplos bem claros
@Edit
SetPlayerFacingAngle tem ponto e virgula sim.
https://sampwiki.blast.hk/wiki/Function:...yerFacingAngle
Re: Macros -
AndrePls - 25.12.2012
Quote:
Originally Posted by tonisantolia
Como assim? eu e o jonathan demos exemplos bem claros 
|
Код:
#define SETAR POSICAO DO PLAYER();\
OUTRA FUNCAO()
A primeira funзгo tem
ponto e virgula no final, jб a segunda nгo =/
Re: Macros -
JonathanFeitosa - 25.12.2012
pawn Код:
Teleporte(playerid, corx, cory, corz, angulo);
Tentou usar isto ?
Re: Macros -
AndrePls - 25.12.2012
Agora funcionou certinho