SA-MP Forums Archive
How to remove "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: How to remove "Spawn"? (/showthread.php?tid=454822)



How to remove "Spawn"? - HenrySunseri - 30.07.2013

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;
}



Re: How to remove "Spawn"? - thimo - 30.07.2013

Why would you remove spawn?


Re: How to remove "Spawn"? - HenrySunseri - 30.07.2013

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


Re: How to remove "Spawn"? - Sublime - 30.07.2013

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.


Re: How to remove "Spawn"? - PrinceKumar - 30.07.2013

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


Re: How to remove "Spawn"? - HenrySunseri - 30.07.2013

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;
}



Re: How to remove "Spawn"? - Sublime - 30.07.2013

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]


Re: How to remove "Spawn"? - Konstantinos - 30.07.2013

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.


Re: How to remove "Spawn"? - HenrySunseri - 30.07.2013

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.


Re: How to remove "Spawn"? - Scenario - 30.07.2013

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