[How to fix this bug ? ]
#1

Why When I Join my Server First sure i got Register But When I'm Relog i still get Register Why is not login??
Code :
Код:
// OnPlayerConnect
TogglePlayerSpectating(playerid,1);
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,256,"~r~Hello %s !",name);
GameTextForPlayer(playerid,string,10000,6);
format(string,256,"Players/%s.ini",name);
if(fexist(string))
{
 ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Welcome! Please Login!","Login","Exit");
}
else
{
 ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register","Welcome! Please Register!","Register","Exit");
}

// ReadWrite Player Functions
ReadPlayer(line,playerid)
{
 new string[256],name[MAX_PLAYER_NAME];
 new File:player;
 GetPlayerName(playerid,name,sizeof(name));
 format(string,256,"Players/%s.ini",name);
 player = fopen(string, io_read);
 for(new i=1; i<=line; i++)
 {
  fread(player,string);
  if(line==i)
  {fclose(player); return string;}
 }
 return string;
}

WritePlayer(text[],playerid, bool:filestart)
{
 new string[256],name[MAX_PLAYER_NAME];
 new File:player;
 GetPlayerName(playerid,name,sizeof(name));
 format(string,256,"Players/%s.ini",name);
 player = fopen(string, io_append);
 if(filestart)
 {
  fwrite(player,text);
 }
 else
 {
  format(string,256,"\n%s",text);
  fwrite(player,string);
 }
 fclose(player);
}
there is a viled code??
Reply
#2

Can you provide us what you have under OnPlayerDialogResponse for the register dialog as the issue might be there.
Reply
#3

Where? I'm not find it ~! Bro i use my Server On Ultra-Host...
Reply
#4

heeelp me all plesae
Reply
#5

When you register, does your playerfile actually exist?
If it doesn't exist, show the code under OnDialogResponse for the register window, so we can see why it doesn't get saved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)