a SpawnPlayer problem about RP.
#1

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
pawn Код:
SpawnPlayer(playerid);
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.

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);
}
Reply
#2

Add this above SpawnPlayer:
pawn Код:
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
With your spawn info.
Reply
#3

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Add this above SpawnPlayer:
pawn Код:
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
With your spawn info.

Thanks a lOT!!!!!!!!!
you give me now , i give you after.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)