24.05.2015, 08:59
Hello guys i have one problem.
my problem is here
if player input false password again login without any problems.
onplayerconnect function for get password.
Thanks!
my problem is here
Код:
if(!strcmp(inputtext,P_DATA[playerid][password],false))return ShowPlayerDialog(playerid,DIALOG_LOG,DIALOG_STYLE_INPUT,"LOGIN","TYPE YOUR PASSWORD","LOGIN","KICK");
onplayerconnect function for get password.
Код:
public OnPlayerConnect(playerid){ for(var i;i<_:info;++i)P_DATA[playerid][info:i]=0; //var is new in pawn, why i like javascript :D var name[MAX_PLAYER_NAME]; static Q[256],DBResult:Result; GetPlayerName(playerid,name,sizeof(name)); format(Q,sizeof(Q),"SELECT password FROM USERS WHERE username = '%s'",name); Result = db_query(database,Q); if(db_num_rows(Result)){ db_get_field_assoc(Result,"password",P_DATA[playerid][password],256); ShowPlayerDialog(playerid,DIALOG_LOG,DIALOG_STYLE_INPUT,"LOGIN","TYPE YOUR PASSWORD","LOGIN","KICK"); } else{ ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"REGISTER","TYPE YOUR PASSWORD","REGISTER","KICK"); } db_free_result(Result); over 1; //over is return :D #define over return }