Problem with new registration system
#1

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

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'.
Reply
#3

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

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)
Reply
#5

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)