Need some help at login script -
ttloko2 - 24.01.2012
sup guys? im currently making a login filterscript and i need your help i got the following errors:
Код:
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(35) : error 036: empty statement
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(36 -- 38) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(39) : warning 217: loose indentation
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(40) : warning 225: unreachable code
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(40) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(40 -- 41) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(41) : error 001: expected token: ";", but found "else"
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(41) : fatal error 107: too many error messages on one line
these are the lines:
Код:
public OnPlayerConnect(playerid)
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
if(dini_Exists(Data));
(
(
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your passwordbelow:","Login","Cancel");
return 1;
)
else
(
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
return 1;
)
)
return 1;
}
im using the current includes,defines:
Код:
#define FILTERSCRIPT
#define DIALOG_REGISTER
#define DIALOG_LOGIN
#define COLOR_BLUE 0xADD8E6FF
#define COLOR_RED 0xFF0000FF
#define COLOR_YELLOW 0xFFFF00AA
#include <a_samp>
#include <dini>
Re: Need some help at login script -
Richie - 24.01.2012
First change your brackets to the right ones. Its { and }, not ( and )
Re: Need some help at login script -
milanosie - 24.01.2012
Код:
public OnPlayerConnect(playerid)
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
if(dini_Exists(Data)) //Dont use ; here
{
{ //its { and not (
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your passwordbelow:","Login","Cancel");
return 1;
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
return 1;
}
}
return 1;
}
Re: Need some help at login script -
Konstantinos - 24.01.2012
We open brackets { } not parentheses ( )
pawn Код:
public OnPlayerConnect( playerid )
{
new
Data[ 64 ], name [MAX_PLAYER_NAME ];
GetPlayerName( playerid, name, sizeof( name ) );
format( Data, sizeof( Data ), "/Accounts/%s.txt", name );
if( dini_Exists( Data ) )
{
ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Enter your passwordbelow:", "Login", "Cancel" );
}
else
{
ShowPlayerDialog( playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Enter your password below:", "Register", "Cancel" );
}
return 1;
}
Re: Need some help at login script -
ttloko2 - 24.01.2012
im getting these errors:
Код:
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : warning 215: expression has no effect
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : error 001: expected token: ";", but found ")"
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(38) : fatal error 107: too many error messages on one line
here:
Код:
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
Re: Need some help at login script -
Konstantinos - 24.01.2012
I don't have any errors
pawn Код:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Post lines from 30 to 40
Re: Need some help at login script -
milanosie - 24.01.2012
pawn Код:
public OnPlayerConnect( playerid )
{
new Data[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format( Data, sizeof(Data), "/Accounts/%s.txt", name);
if(dini_Exists(Data))
{
ShowPlayerDialog(playerid, 601, DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Enter your passwordbelow:","Login","Cancel");
return 1;
}
else
{
ShowPlayerDialog(playerid, 602, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
return 1;
}
return 1;
}
Forgot dialog id
Re: Need some help at login script -
Konstantinos - 24.01.2012
He has
pawn Код:
#define DIALOG_REGISTER 601
// 601 is random
#define DIALOG_LOGIN 602
// 602 is random
Else if the errors would be
pawn Код:
error 017: undefined symbol "DIALOG_REGISTER"
error 017: undefined symbol "DIALOG_LOGIN"
Re: Need some help at login script -
ttloko2 - 24.01.2012
Код:
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(41) : warning 225: unreachable code
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(230) : error 001: expected token: ")", but found "{"
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(253) : error 001: expected token: ")", but found "{"
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(281) : warning 217: loose indentation
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(292 -- 293) : error 001: expected token: ",", but found "}"
C:\Users\Carlos\Desktop\Nova pasta\plugins\Login.pwn(299) : warning 217: loose indentation
hole code:
Код:
public OnPlayerConnect(playerid)
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
if(dini_Exists(Data))
{
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
return 1;
}
else----ERROR (41)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","Enter your password below:","Register","Cancel");
return 1;
}
}
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER)
{
if(response==0)
{
SendClientMessage(playerid,COLOR_RED,"You did not registered");
Kick(playerid);
return 1;
} -ERROR
if(response==1)
{
if(!strlen(inputtext)
{
SendClientMessage(playerid,COLOR_RED,"Unsifitient letters");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
return 1;
}
else
{
Register(playerid,inputtext);
return 1;
}
}
}
if(dialogid==DIALOG_LOGIN)
{
if(response==0)
{
SendClientMessage(playerid,0x800080AA,"You did not login");
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext)
{ - ERROR
SendClientMessage(playerid,COLOR_RED,"Incorrect Password");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
return 1;
}
else
{
Login(playerid,inputtext);
return 1;
}
} }
return 1;
}
Код:
stock Register(playerid, key[])
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
dini_Create (Data);
dini_Set (Data,"Password",key);
SendClientMessage(playerid,COLOR_YELLOW,"You have registered sucessfully!");
return 1; - ERROR
}
stock Login(playerid, key[])
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
if(!strcmp(key,dini_Get(Data,"Password"),false))
{
SetPlayerScore(playerid,dini_Int(Data,"Level"));
SendClientMessage(playerid,COLOR_BLUE,"You have logged in sucessfully!" -ERROR
}
else
{
SendClientMessage(playerid,COLOR_RED,"Incorrect Password");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
}
return 1; -ERROR
}
Re: Need some help at login script -
Konstantinos - 24.01.2012
pawn Код:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
pawn Код:
#include <a_samp>
#include <dini>
#define COLOR_RED -1
#define COLOR_YELLOW -1
#define COLOR_BLUE -1
#define DIALOG_REGISTER 601
#define DIALOG_LOGIN 602
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER) {
if(response==0) {
SendClientMessage(playerid,COLOR_RED,"You did not registered");
Kick(playerid);
return 1;
}
if(response==1) {
if(!strlen(inputtext)) {
SendClientMessage(playerid,COLOR_RED,"Unsifitient letters");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
return 1;
}
else {
Register(playerid,inputtext);
return 1;
}
}
}
if(dialogid==DIALOG_LOGIN) {
if(response==0) {
SendClientMessage(playerid,0x800080AA,"You did not login");
Kick(playerid);
return 1;
}
if(response==1) {
if(!strlen(inputtext)) {
SendClientMessage(playerid,COLOR_RED,"Incorrect Password");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
return 1;
}
else {
Login(playerid,inputtext);
return 1;
}
}
}
return 1;
}
stock Register(playerid, key[])
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
dini_Create (Data);
dini_Set (Data,"Password",key);
SendClientMessage(playerid,COLOR_YELLOW,"You have registered sucessfully!");
return 1;
}
stock Login(playerid, key[])
{
new Data[64];
new name [MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Data,sizeof(Data),"/Accounts/%s.txt",name);
if(!strcmp(key,dini_Get(Data,"Password"),false)) {
SetPlayerScore(playerid,dini_Int(Data,"Level"));
SendClientMessage(playerid,COLOR_BLUE,"You have logged in sucessfully!");
}
else {
SendClientMessage(playerid,COLOR_RED,"Incorrect Password");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel");
}
return 1;
}