Portal SAMP
[Ajuda] Salvar pos do player. - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Salvar pos do player. (/showthread.php?tid=1086)



Salvar pos do player. - MatheuzPatoo - 14/04/2021

Código PHP:
enum pInfo
{   
    pX
,
    pY,
    pZ,
}
new 
PlayerInformacoes[MAX_PLAYERS][pInfo];


CMD:salvarpos(playerid)
{
    new 
Float:XpFloat:YpFloat:Zp;
    
GetPlayerPos(playeridXpYpZp);
    
PlayerInformacoes[playerid][pX] = Xp;
    return 
1;


Esta dando tag mismatch na linha acima do return 1;



RE: Salvar pos do player. - MarcosBrazz - 14/04/2021

(14/04/2021 15:04)MatheuzPatoo Escreveu:
Código PHP:
enum pInfo
{   
    pX
,
    pY,
    pZ,
}
new 
PlayerInformacoes[MAX_PLAYERS][pInfo];


CMD:salvarpos(playerid)
{
    new 
Float:XpFloat:YpFloat:Zp;
    
GetPlayerPos(playeridXpYpZp);
    
PlayerInformacoes[playerid][pX] = Xp;
    return 
1;


Esta dando tag mismatch na linha acima do return 1;

precisa declarar se a variavel é Float no enum 
Código:
enum pInfo
{   
    Float:pX,
    Float:pY,
    Float:pZ,
}



RE: Salvar pos do player. - xbruno1000x - 14/04/2021

(14/04/2021 15:23)MarcosBrazz Escreveu:
(14/04/2021 15:04)MatheuzPatoo Escreveu:
Código PHP:
enum pInfo
{   
    pX
,
    pY,
    pZ,
}
new 
PlayerInformacoes[MAX_PLAYERS][pInfo];


CMD:salvarpos(playerid)
{
    new 
Float:XpFloat:YpFloat:Zp;
    
GetPlayerPos(playeridXpYpZp);
    
PlayerInformacoes[playerid][pX] = Xp;
    return 
1;


Esta dando tag mismatch na linha acima do return 1;

precisa declarar se a variavel é Float no enum 
Código:
enum pInfo
{  
    Float:pX,
    Float:pY,
    Float:pZ,
}

Lembrando também que para salvar um float é necessário usar DOF2_SetFloat.