SA-MP Forums Archive
Player can't spawn -,- - 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)
+--- Thread: Player can't spawn -,- (/showthread.php?tid=346364)



Player can't spawn -,- - Fmfan - 28.05.2012

I can't spawn when I type my passowrd in dialog...

Codes:
pawn Код:
case DIALOG_LOGIN1:
{
      if(!response)
      {
            Kick(playerid);
      }
      else
      {
            new pwlength = strlen(inputtext);
            if(pwlength > 0)
            {
                new pw[200];
                format(pw, sizeof(pw), "%s", dini_Get(path, "password"));
                if(strcmp(inputtext, pw) == 0)
                {
                    pInfo[playerid][sex] = dini_Int(path, "sex");
                    pInfo[playerid][age] = dini_Int(path, "age");
                    pInfo[playerid][logged] = 1;
                    SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Login", "Wrong passoword!", "Return", "");
                }
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX,  "Login", "You must type in your passoword!", "Return", "");
            }
      }
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid, 2092.7478,1454.8173,35.4844);
    return 1;
}



Re: Player can't spawn -,- - Jochemd - 28.05.2012

Where do you show this dialog? If in OnPlayerConnect, I believe you have to use SetSpawnInfo first (fixed in 0.3e or not?)


Re: Player can't spawn -,- - Face9000 - 28.05.2012

What you mean "i cant spawn"..?You get kicked or what?If so:

pawn Код:
SpawnPlayer(playerid);
I heard this function is bugged.It kicks the player when using it.


Re: Player can't spawn -,- - JaKe Elite - 28.05.2012

Logitech, SpawnPlayer is fixed in 0.3e


Re: Player can't spawn -,- - Face9000 - 28.05.2012

Quote:
Originally Posted by Romel
Посмотреть сообщение
Logitech, SpawnPlayer is fixed in 0.3e
Ah,sorry then.


Re: Player can't spawn -,- - ReneG - 28.05.2012

It still isn't common practice to damn straight spawn the player in OnPlayerConnect, set a delaying timer of at least 100 MS.


Re: Player can't spawn -,- - Fmfan - 28.05.2012

I didn't put in script code to spawn player on connect, he needs to login first. But when I login nothing happens


Re: Player can't spawn -,- - JaKe Elite - 28.05.2012

you have to set a timer after login using SetTimerEx like VincentDunn said.

ex.

pawn Код:
SetTimerEx("OnPlayerSpawnEx", 2000, false, "d", playerid); //will create a timer in 2000 milesec (2 secs) with params playerid (integer - d/i)

forward OnPlayerSpawnEx(playerid);
public OnPlayerSpawnEx(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
didn't test yet but maybe it work


Re: Player can't spawn -,- - Fmfan - 28.05.2012

not working