SA-MP Forums Archive
Problem with new registration system - 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: Problem with new registration system (/showthread.php?tid=452360)



Problem with new registration system - Don_Cage - 21.07.2013

I'm making a registration system and in the end the player can choose if he got there by plane,taxi,train etc..
He choose which one and after that he can login and should spawn at the place he choosed.
Thats where I have problems and he insted spawns in blue barry acres..
Why is that so?

pawn Код:
if(dialogid == 5016)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 26);
                        PlayerInfo[playerid][pPos_x] = 1449.950;
                        PlayerInfo[playerid][pPos_y] = -2287.7966;
                        PlayerInfo[playerid][pPos_z] = 14.5469;
                    }
                    else if(PlayerInfo[playerid][pSex] == 2)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 91);
                        PlayerInfo[playerid][pPos_x] = 1449.950;
                        PlayerInfo[playerid][pPos_y] = -2287.7966;
                        PlayerInfo[playerid][pPos_z] = 14.5469;
                    }
                }
                else if(listitem == 1)
                {
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 26);
                        PlayerInfo[playerid][pPos_x] = 818.8932;
                        PlayerInfo[playerid][pPos_y] = -1355.3688;
                        PlayerInfo[playerid][pPos_z] = 1.5078;
                    }
                    else if(PlayerInfo[playerid][pSex] == 2)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 91);
                        PlayerInfo[playerid][pPos_x] = 818.8932;
                        PlayerInfo[playerid][pPos_y] = -1355.3688;
                        PlayerInfo[playerid][pPos_z] = -0.5078;
                    }
                }
                else if(listitem == 2)
                {
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 26);
                        PlayerInfo[playerid][pPos_x] = 1743.0795;
                        PlayerInfo[playerid][pPos_y] = -1862.4318;
                        PlayerInfo[playerid][pPos_z] = -13.5763;
                    }
                    else if(PlayerInfo[playerid][pSex] == 2)
                    {
                        new bye[] = "Well it was nice meeting you!\nI hope you will enjoy your stay here\nin San Andreas.";
                        ShowPlayerDialog(playerid, 5017,DIALOG_STYLE_MSGBOX,"Enjoy your stay!",bye,"Select","Cancel");
                        PlayerInfo[playerid][pTut] = 1;
                        SetPlayerSkin(playerid, 91);
                        PlayerInfo[playerid][pPos_x] = 1743.0795;
                        PlayerInfo[playerid][pPos_y] = -1862.4318;
                        PlayerInfo[playerid][pPos_z] = -13.5763;
                    }
                }
            }
            else
            {
                Kick(playerid)
            }
        }



Re: Problem with new registration system - Lordzy - 21.07.2013

Use 'SetSpawnInfo' and set the coords before spawning. Then, use 'SpawnPlayer' function and spawn the player. The player will be spawned to the coords which are set on the function 'SetSpawnInfo'.


Re: Problem with new registration system - Don_Cage - 21.07.2013

Could you show me an example? Don't know how SetSpawnInfo works.


Re: Problem with new registration system - AdamCooper - 21.07.2013

pawn Код:
SetSpawnInfo(playerid, COPS, PlayerInfo[playerid][Skin], 229.826354,164.976119,1003.023437, 0, 0, 0, 0, 0, 0, 0); TogglePlayerControllable(iPlayer, false);
I'd suggest to make a stock called deafultspawn and then call it with DefultSpawn(playerid)


Re: Problem with new registration system - Tingesport - 21.07.2013

and then if you want to set those positions you declared..

pawn Код:
PlayerInfo[playerid][pPos_x] = 1449.950;
PlayerInfo[playerid][pPos_y] = -2287.7966;
PlayerInfo[playerid][pPos_z] = 14.5469;
use

pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
SetPlayerFacingAngle(playerid, -90);