Register.pwn(113) : error 017: undefined symbol "UserPath" Register.pwn(115) : error 035: argument type mismatch (argument 1) Register.pwn(115) : error 017: undefined symbol "bExtra" Register.pwn(115) : warning 215: expression has no effect Register.pwn(115) : error 029: invalid expression, assumed zero
This All Of "OnPlayerConnect" Errors There!!!!
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid))
{
INI_ParseFile(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Plesae Enter Your Password to log in your account!","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Plesae Enter You'r new Password For Register!","Register","Quit");
}
return 1;
}
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(fexist(UserPath(playerid)))
if(fexist(UserPath(playerid))
INI_ParseFile(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
Try this:
PHP код:
|
new UserPath[MAX_PLAYERS];
Register.pwn(115) : error 012: invalid function call, not a valid address
Register.pwn(115) : warning 215: expression has no effect
Register.pwn(115) : error 001: expected token: ";", but found ")"
Register.pwn(115) : error 029: invalid expression, assumed zero
public OnPlayerConnect(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Plesae Enter Your Password to log in your account!","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Plesae Enter Your new Password For Register!","Register","Quit"); } return 1; }
if(fexist(UserPath(playerid)))
//Top of your script
#define PATH "%s.ini" // change it if you want ..
//Somewhere else
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
public LoadUser_date[playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
return 1;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
stock udb_hash(buf[])
{
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
public LoadUser_date(playerid,name[],value[])
{
INI_String("Password",PlayerInfo[playerid][pPass], 129);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Password invaild,type new password!","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"date");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bankmoney",0);
INI_WriteInt(File,"Banned",0);
INI_Close(File);
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
SendClientMessage(playerid,-1,"You've succsefully logged in your account!");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Password incorrect,type agian!","Login!","Quit!");
}
}
}
}
return 1;
}
something error??
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Password invaild,type new password!","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"date");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bankmoney",0);
INI_WriteInt(File,"Banned",0);
INI_Close(File);
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
SendClientMessage(playerid,-1,"You've succsefully logged in your account!");
}
else ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Password incorrect,type agian!","Login!","Quit!");
}
}
}
return 0;
}
Try this
And show me all the errors if you got. PHP код:
|
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}