[Ajuda] me ajudem please
#7

Ve Se Pega

PHP код:
#include <a_samp>
#include <SII>
#define DIALOG_REGISTRO 2000
#define DIALOG_LOGAR 2001
#define BRANCO "{FFFFFF}"
#define VERMELHO "{F81414}"
#define VERDE "{00FF22}"
#define AZUL CLARO "{00CED1}"
forward SpawnDoPlayer(playerid);
new 
gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
enum pInfo
{
    
pSenha,
    
pScore,
    
pDinheiro,
    
pAdmin
}
new 
PlayerInfo[MAX_PLAYERS][pInfo];
stock ObterINI(playerid)
{
    new 
conta[64];
    
format(conta,30,"Contas/%s.ini",gPlayerName[playerid]);
    return 
conta;
}
public 
OnPlayerSpawn(playerid)
{
    
SpawnPlayer(playerid);
    
SpawnDoPlayer(playerid);
    return 
true;
}
public 
SpawnDoPlayer(playerid)
{
    
SetPlayerPos(playerid,1803.5999,-1638.5000,13.5207,2.7415);
    
SetPlayerInterior(playerid,0);
    return 
true;
}
public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridgPlayerName[playerid], MAX_PLAYER_NAME);
    if (
fexist(ObterINI(playerid)))
    {
        
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_INPUT,""BRANCO"Login",""BRANCO"Digite sua senha abaixo para efetuar login.","logar","Quit");
    }
    else
    {
        
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT,""BRANCO"Registrando",""BRANCO" Digite sua senha abaixo para registrar uma nova conta.","Registrar","Quit");
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_REGISTRO:
        {
            if (!
response) return Kick(playerid);
            if (
response)
            {
                if(!
strlen(inputtext)) {
                    
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_INPUT""BRANCO"Registrando...",""VERMELHO"Vocк digitou uma senha invбlida.\n"BRANCO"Digite sua senha abaixo para registrar uma nova conta.","Registro","Quit");
                }
                if(
INI_Open(ObterINI(playerid))) {
                    
INI_WriteString("Senha",inputtext);
                    
INI_WriteInt("Score",1);
                    
INI_WriteInt("Dinheiro",5000);
                    
INI_WriteInt("Admin",0);
                    
INI_Save();
                    
INI_Close();
                    
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_INPUT,""BRANCO"Logar",""BRANCO"Digite sua senha abaixo para efetuar login.","Logar","Quit");
                }
            }
        }
        case 
DIALOG_LOGAR:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(!
strlen(inputtext)) {
                    
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_INPUT""BRANCO"Logar",""VERMELHO"Vocк digitou uma senha invбlida.\n"BRANCO"Digite sua senha abaixo para efetuar login.","Logar","Quit");
                }
                if(
INI_Open(ObterINI(playerid))) {
                    
INI_ReadString(PlayerInfo[playerid][pSenha],"Senha",20);
                    if(
strcmp(inputtext,PlayerInfo[playerid][pSenha],false)) {
                        
ShowPlayerDialog(playeridDIALOG_LOGARDIALOG_STYLE_INPUT""BRANCO"Logar",""VERMELHO"Vocк digitou uma senha incorreta.\n"BRANCO"Digite sua senha abaixo para acessar.","Logar","Quit");
                    }
                    
SetPlayerScoreplayeridINI_ReadInt("Score" ) );
                    
ResetPlayerMoneyplayerid );
                    
GivePlayerMoneyplayeridINI_ReadInt"Dinheiro" ) );
                    
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                    
INI_Close();
                }
            }
        }
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    if(
INI_Open(ObterINI(playerid))) {
        
INI_WriteInt("Score",PlayerInfo[playerid][pScore]);
        
INI_WriteInt("Dinheiro",GetPlayerMoney(playerid));
        
INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
        
INI_Save();
        
INI_Close();
    }
    return 
1;

Reply


Messages In This Thread
me ajudem please - by wender_sousa - 03.02.2013, 13:37
Re: me ajudem please - by Dwayne-Pheonix - 03.02.2013, 13:38
Re: me ajudem please - by wender_sousa - 03.02.2013, 13:50
Re: me ajudem please - by Dwayne-Pheonix - 03.02.2013, 13:57
Re: me ajudem please - by smiiir - 03.02.2013, 14:06
Re: me ajudem please - by wender_sousa - 03.02.2013, 14:47
Re: me ajudem please - by smiiir - 03.02.2013, 14:49
Re: me ajudem please - by wender_sousa - 03.02.2013, 15:09
Re: me ajudem please - by tonisantolia - 03.02.2013, 15:13
Re: me ajudem please - by smiiir - 03.02.2013, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)