Nome: Antonio Rodrigues
Area de Especialização: Programação Geral ( PHP - PAWN - MYSQL )
Nivel de Especialização: Experiente ( 2 Anos )
Trabalho: Não tenho trabalhos postados na net, pois são todos particulares e exclusivos para um mode RPG que estrou construindo.. Mas, fiz um sistema de registro para postar algo aqui:
[code]#include < A_SAMP >
#include < DOF2 >
#define dLogin 0
#define dRegistro 1
enum pInfo
{adm}
new Dados [ MAX_PLAYERS ] [ pInfo ] ;
public OnFilterScriptInit()
return print(" FilterScript de Inscrição para Pawn Evolution!");
public OnPlayerConnect(playerid) {
new
file [ 70 ] ,
string [ 500 ] ,
ip [ 70 ] ;
GetPlayerIp ( playerid, ip , sizeof ip );
format ( file , sizeof file , "Contas/%s.ini", Nome ( playerid ) ) ;
if ( DOF2_FileExists ( file ) ) {
format ( string , sizeof string , "Nome: %s.\nIP: %s.\nStatus: REGISTRADO.\n\nDigite sua senha para logar-se:" , Nome ( playerid ) , ip ) ;
ShowPlayerDialog ( playerid , dLogin , DIALOG_STYLE_PASSWORD , "Fazendo seu Login:" , string , #Logar , #Sair ) ; }
else {
format ( string , sizeof string , "Nome: %s.\nIP: %s.\nStatus: NÃO REGISTRADO.\n\nDigite sua senha para logar-se:" , Nome ( playerid ) , ip ) ;
ShowPlayerDialog ( playerid , dRegistro , DIALOG_STYLE_PASSWORD , "Fazendo seu Registro:" , string , #Registrar , #Sair ) ; }
return ( true ) ;
}
public OnDialogResponse ( playerid , dialogid , response , listitem , inputtext[] ) {
new
file [ 70 ] ,
string [ 500 ] ,
ip [ 70 ] ;
GetPlayerIp ( playerid, ip , sizeof ip );
format ( file , sizeof file , "Contas/%s.ini", Nome ( playerid ) ) ;
if ( dialogid == dLogin ) {
if ( response == 0 ) return Kick ( playerid ) ;
if ( response == 1 ) {
if ( strcmp ( inputtext , DOF2_GetString ( file , #Senha ) , true ) == 0 )
return Dados [ playerid ] [ adm ] = DOF2_GetInt ( file , #adm ) ;
SendClientMessage ( playerid, -1 , "SERVER: Senha Errada!" ) ;
format ( string , sizeof string , "Nome: %s.\nIP: %s.\nStatus: REGISTRADO.\n\nDigite sua senha para logar-se:" , Nome ( playerid ) , ip ) ;
ShowPlayerDialog ( playerid , dLogin , DIALOG_STYLE_PASSWORD , "Fazendo seu Login:" , string , #Logar , #Sair ) ;
}
}
if ( dialogid == dRegistro ) {
if ( response == 0 ) return Kick ( playerid ) ;
if ( response == 1 ) {
DOF2_CreateFile ( file ) ;
DOF2_SetString ( file , #Senha , inputtext ) ;
DOF2_SetInt ( file , #adm , 0 ) ;
DOF2_SaveFile() ;
format ( string , sizeof string , "Nome: %s.\nIP: %s.\nStatus: REGISTRADO.\n\nDigite sua senha para logar-se:" , Nome ( playerid ) , ip ) ;
ShowPlayerDialog ( playerid , dLogin , DIALOG_STYLE_PASSWORD , "Fazendo seu Login:" , string , #Logar , #Sair ) ;
}
}
return ( true ) ;
}
stock Nome ( id ) {
new
snd [ MAX_PLAYER_NAME ] ;
GetPlayerName ( id , snd , sizeof snd );
return ( snd ) ;
}[/code]