a SpawnPlayer problem about RP. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: a SpawnPlayer problem about RP. (
/showthread.php?tid=271356)
a SpawnPlayer problem about RP. -
VivianKris - 24.07.2011
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.
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);
}
Re: a SpawnPlayer problem about RP. -
Jack_Leslie - 24.07.2011
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.
Re: a SpawnPlayer problem about RP. -
VivianKris - 24.07.2011
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.