24.07.2011, 04:43
Hello everyone.
Im VivianKris, recentely I realzed a gamemode about RP.
but there is something dont run. plase help me.
I attach Register&Login system to Dialog.
When player logged on , i want player auto spawn, so I wrote
after Logged on,But it dont work.
I have test it , When Player First spawn, it will return to OnPlayerRequestClass.
But When Player in this Callback, SpawnPlayer(playerid); does not work!
Please help me this problem.
Im VivianKris, recentely I realzed a gamemode about RP.
but there is something dont run. plase help me.
I attach Register&Login system to Dialog.
When player logged on , i want player auto spawn, so I wrote
pawn Код:
SpawnPlayer(playerid);
I have test it , When Player First spawn, it will return to OnPlayerRequestClass.
But When Player in this Callback, SpawnPlayer(playerid); does not work!
Please help me this problem.
pawn Код:
new pLogged[MAX_PLAYERS];
pLogged[playerid] = 0;
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Logging","Please enter your password:","Login","Exit");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == DIALOG_LOGIN)
  {
  OnPlayerLogin(playerid,inputtext);
  }
  return 1;
}
Function OnPlayerLogin(playerid,password[])
{
new nickname[35];
format(nickname,sizeof(nickname),PLAYER_INFO, GetName(playerid));
new INI:handler = INI_Open(nickname);
INI_ParseFile(nickname, "LoadPlayerInfo", .bExtra = true, .extra = playerid);
if(strcmp(pInfo[playerid][pPass],password,false) == 0)
{
printf("Player %s Log on!",GetName(playerid));
pLogged[playerid] = 1;
SpawnPlayer(playerid);
}
else
{
pLogTries[playerid] ++;
if(pLogTries[playerid] > 3){Ban(playerid);}
else{ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Logging","Error password , enter again!","LOGIN","EXIT");}
}
INI_Close(handler);
}