If player is registered > load position -
Lz - 03.12.2012
I just edited my script so it saves the players position when disconnecting, When they connect i want them to spawn in the same place as they disconnected, Where/what else/ would i add too..
pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2]);
I tried
pawn Код:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new HashPass[129];
WP_Hash(HashPass, sizeof(HashPass), inputtext);
if(strcmp(HashPass, PlayerInfo[playerid][pPass]) == 0)
{
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
SetPlayerPos(playerid, PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2]);
}
return 1;
But it still makes them spawn at class 0's spawn location..
Question 2. How do i remove the 'spawn' Dialog when connecting, I want it so after they login they automatically spawn
Re: If player is registered > load position -
[HK]Ryder[AN] - 03.12.2012
Instead of SetPlayerPos use SetSpawnInfo and SpawnPlayer
will answer both your questions
Re: If player is registered > load position -
iSaad - 03.12.2012
Well AFAIK you are saving positions using an "
enum" so you can just load the player's position under "
OnPlayerSpawn"
Re: If player is registered > load position -
Lz - 03.12.2012
Quote:
Originally Posted by [HK]Ryder[AN]
Instead of SetPlayerPos use SetSpawnInfo and SpawnPlayer
will answer both your questions
|
Thanks man got that fixed now, Only thing is i need to delay the time he spawns in so that the map can load and he doesn't fall under, Would i use
pawn Код:
TogglePlayerControllable(playerid,0);
SetTimerEx("Unfreeze",12000,false,playerid);
}
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid,1);
}
Re: If player is registered > load position -
[HK]Ryder[AN] - 03.12.2012
use this
pawn Код:
TogglePlayerControllable(playerid,0);
SetTimerEx("Unfreeze",12000,false,"i",playerid);
}
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
TogglePlayerControllable(playerid,1);
return 1;
}
Re: If player is registered > load position -
Lz - 03.12.2012
Quote:
Originally Posted by [HK]Ryder[AN]
use this
pawn Код:
TogglePlayerControllable(playerid,0); SetTimerEx("Unfreeze",12000,false,"i",playerid); }
forward Unfreeze(playerid); public Unfreeze(playerid) { TogglePlayerControllable(playerid,1); return 1; }
|
Perfect, Thanks for your help man Rep++
Re: If player is registered > load position -
Elysian` - 03.12.2012
Why don't you just TogglePlayerSpectating(playerid, true); under OnPlayerConnect and on the login dialog use TogglePlayerSpectating(playerid, false);
Re: If player is registered > load position -
Lz - 03.12.2012
Quote:
Originally Posted by Windows32
Why don't you just TogglePlayerSpectating(playerid, true); under OnPlayerConnect and on the login dialog use TogglePlayerSpectating(playerid, false);
|
I did before that and it still showed the spawn dialog for some reason
However this way works anyhow