How to remove "Spawn"?
#1

Well, I'm experiencing a pretty confusing error that I shouldn't be experiencing in the first place. I have a login system set up for my server, and after the player types the correct password it brings them to the "Arrow left, arrow right and spawn" screen. After clicking SPAWN you get a bunch of messed up colours and "Stay within the worlds boundaries". However, I do not even want that screen and I just want the player to spawn with a selected skin. If anyone can tell me how to do that please help me out.

Код:
public OnPlayerConnect(playerid)
 {
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME+1];
    if (fexist(UserPath(playerid)))
    GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "Admin: %s has joined the server.", name);
	strreplace(name, '_', ' ');
	SendClientMessage(playerid, -1, "Welcome!");
	SendMessageToAdmins(string);
    return 1;
}
Reply
#2

Why would you remove spawn?
Reply
#3

re-read the post please. I want to remove it so the player doesn't have to click "spawn" upon connect.
Reply
#4

This is an example code of direct spawning without pressing the "Spawn" button, hope you can adapt this into your script.

pawn Код:
public OnPlayerSpawn(playerid)
{
      SetSpawnInfo(playerid, 0, 299, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
      SpawnPlayer(playerid);
      return 1;
}
After 0 (0 is after playerid in SetSpawnInfo), you see 299. That's Claude's skin, by default to me. You can change that skin ID to any kind, and adapt this script into your script.
Reply
#5

Show me ur login dialog box codes and if u have onplayerspawn callback then show me the codes
Reply
#6

Alright, so I added that code to my OnPlayerSpawn but whenever I login it still brings me to the spawn screen.
Here is my OnPlayerSpawn currently:
Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pJailed] == 1)
    {
    SetPlayerInterior(playerid, 6);
    SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
    }
	else
	{
    SetSpawnInfo(playerid, 0, 299, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
    SpawnPlayer(playerid);
	}
	return 1;
}
Reply
#7

Try this.

pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpecating(playerid, 1);
    FixSpawn{playerid} = 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(SpawnFix{playerid} == 1)
    {
        SpawnFix{playerid} = 0;
        SetPlayerPos(playerid, 1958.33, 1343.12, 15.36);
        TogglePlayerSpectating(playerid, 0);
    }
    return 1;
}
And make sure to make this on top of the script above;

new SpawnFix[MAX_PLAYERS]
Reply
#8

Quote:
Originally Posted by Sublime
Посмотреть сообщение
This is an example code of direct spawning without pressing the "Spawn" button, hope you can adapt this into your script.

pawn Код:
public OnPlayerSpawn(playerid)
{
      SetSpawnInfo(playerid, 0, 299, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
      SpawnPlayer(playerid);
      return 1;
}
After 0 (0 is after playerid in SetSpawnInfo), you see 299. That's Claude's skin, by default to me. You can change that skin ID to any kind, and adapt this script into your script.
Everytime a player spawns, that player will re-spawn once again.

Spawn the player after logging in or in OnPlayerRequestClass.
Reply
#9

Quote:
Originally Posted by Sublime
Посмотреть сообщение
Try this.

pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpecating(playerid, 1);
    FixSpawn{playerid} = 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(SpawnFix{playerid} == 1)
    {
        SpawnFix{playerid} = 0;
        SetPlayerPos(playerid, 1958.33, 1343.12, 15.36);
        TogglePlayerSpectating(playerid, 0);
    }
    return 1;
}
And make sure to make this on top of the script above;

new SpawnFix[MAX_PLAYERS]
Are you able to put the OnPlayerConnect part into my own OnPlayerConnect for me? Wherever I put it I get mass compiling errors. I posted my onplayerconnect in the first post.
Reply
#10

There are 5 easy steps to hiding the default class selection menu.

1) TogglePlayerSpectating(playerid, true);
2) Show login/register crap...
3) TogglePlayerSpectating(playerid, false); (once logged in or registered)
4) SetSpawnInfo(playerid, ...);
5) SpawnPlayeri(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)