SA-MP Forums Archive
[Ajuda] Rapidao - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Rapidao (/showthread.php?tid=415466)



Rapidao - mau.tito - 13.02.2013

Galera to batendo a cabeзa nesta parada, eu to com a grana 212 na mao saiu do server e olho no arquivo fica com grana 0 no arquivo .

Problema simples mas que ta me dando dor de cabaзa.

CODE
pawn Код:
//onde seta ele quuando registra
          PlayerInfo [ playerid ] [ pLevel ] = 1;
            PlayerInfo [ playerid ] [ pDinheiro ] += 10000;
            PlayerInfo [ playerid ] [ pAdmin ] = 0;
            GivePlayerMoney(playerid, 10000);

// Salvamento / Carregamento

CallBack::SalvarPlayer ( playerid )
{
     new file [ 50 ] , mauricio [ MAX_PLAYER_NAME ] ;
     GetPlayerName ( playerid , mauricio , sizeof ( mauricio ) ) ;
     format ( file , sizeof ( file ) , DESUSER, mauricio ) ;
     if(!DOF2_FileExists(file)) DOF2_CreateFile(file);
     DOF2_SetInt(file, "Level", PlayerInfo [ playerid ] [ pLevel ] );
     DOF2_SetInt(file, "Dinheiro", PlayerInfo [ playerid ] [ pDinheiro ] );
     DOF2_SetInt ( file , "AdminLevel" , PlayerInfo [ playerid ] [ pAdmin ] );
     DOF2_SetInt ( file , "NumeroTelefone" , PlayerInfo [ playerid ] [ TelefoneNum ] );
     GetPlayerSkin(PlayerInfo[playerid][pSkin]);
     
     GetPlayerPos (playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
     DOF2_SetFloat(file, "PosX", PlayerInfo[playerid][PosX]);
     DOF2_SetFloat(file, "PosY", PlayerInfo[playerid][PosY]);
     DOF2_SetFloat(file, "PosZ", PlayerInfo[playerid][PosZ]);
     DOF2_SaveFile ( ) ;
     return 1;
}

CallBack::CarregarPlayer ( playerid )
{
     new file [ 50 ] ;
     format ( file , sizeof ( file ) , DESUSER, PlayerInfo [ playerid ] [ pName ] ) ;
     PlayerInfo [ playerid ] [ pLevel ] = DOF2_GetInt ( file , "Level" ) ;
     PlayerInfo [ playerid ] [ pDinheiro ] = DOF2_GetInt ( file , "Dinheiro" ) ;
     PlayerInfo [ playerid ] [ pAdmin ] = DOF2_GetInt ( file , "AdminLevel" ) ;
     PlayerInfo [ playerid ] [ TelefoneNum ] = DOF2_GetInt ( file , "NumeroTelefone" );
     SetPlayerScore ( playerid , PlayerInfo [ playerid  ] [ pLevel ] ) ;
     GivePlayerMoney ( playerid , PlayerInfo [ playerid ] [ pDinheiro ] ) ;
     SetPlayerSkin(playerid,  PlayerInfo[playerid][pSkin]);
     return 1;
}



Re: Rapidao - MatheusAlcapone - 13.02.2013

O problema nгo ta ai ele deve estar na parte que seta o dinheiro

@EDIT
Vocк ta atualizando os status do player?

faz isso:
pawn Код:
CallBack::SalvarPlayer ( playerid )
{
     PlayerInfo[playerid][pDinheiro] = 1000;
     new file [ 50 ] , mauricio [ MAX_PLAYER_NAME ] ;
     GetPlayerName ( playerid , mauricio , sizeof ( mauricio ) ) ;
     format ( file , sizeof ( file ) , DESUSER, mauricio ) ;
     if(!DOF2_FileExists(file)) DOF2_CreateFile(file);
     DOF2_SetInt(file, "Level", PlayerInfo [ playerid ] [ pLevel ] );
     DOF2_SetInt(file, "Dinheiro", PlayerInfo [ playerid ] [ pDinheiro ] );
     DOF2_SetInt ( file , "AdminLevel" , PlayerInfo [ playerid ] [ pAdmin ] );
     DOF2_SetInt ( file , "NumeroTelefone" , PlayerInfo [ playerid ] [ TelefoneNum ] );
     GetPlayerSkin(PlayerInfo[playerid][pSkin]);
     
     GetPlayerPos (playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
     DOF2_SetFloat(file, "PosX", PlayerInfo[playerid][PosX]);
     DOF2_SetFloat(file, "PosY", PlayerInfo[playerid][PosY]);
     DOF2_SetFloat(file, "PosZ", PlayerInfo[playerid][PosZ]);
     DOF2_SaveFile ( ) ;
     return 1;
}
Se funcionar o problema nгo ta ai mesmo.


Re: Rapidao - mau.tito - 13.02.2013

Kkkk leva a mal nгo mas nem intendi o que vocк fez , seila meu code esta certo mas ele nгo seta.
To vendo este code mas nгo acho o erro pra tar fazendo isto!


Re: Rapidao - Jumper. - 13.02.2013

ja tentou?
pawn Код:
DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid)); // salvar

GivePlayerMoney(playerid, DOF2_GetInt(String,"Dinheiro")); // setar



Re: Rapidao - mau.tito - 13.02.2013

Quote:
Originally Posted by LucasTotola
Посмотреть сообщение
ja tentou?
pawn Код:
DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid)); // salvar

GivePlayerMoney(playerid, DOF2_GetInt(String,"Dinheiro")); // setar
Ja tentei mas tbm nгo vai .


Re: Rapidao - Jumper. - 13.02.2013

aqui eu uso assim e funciona tito, usa algum anti money hack?? tenta tirar rapidao e testa


Re: Rapidao - Sky™ - 13.02.2013

tentou fazer um debug da quantia salva e quantia setada ao logar?


Re: Rapidao - mau.tito - 13.02.2013

Vlw galera. arrumei sosinho mesmo .
foi uma dor de cabeзa.
Descupem por fazer vocкs lerem este topic.



Re: Rapidao - Jumper. - 13.02.2013

mas pode falar qual era o erro? hehe


Re: Rapidao - VenoN - 13.02.2013

Quote:
Originally Posted by Sky_.
Посмотреть сообщение
tentou fazer um debug da quantia salva
consseguiu arrumar sozinho..