Spawning issue
#1

Hi there,

I have this weird bug with spawning, which for I can't find a reason to explain it, nor a fix that could get rid of it. I am running a script on MySQL database. The trouble is, whenever a player is assigned to a faction (I mean, I'm not sure, there was no issues when player's faction was zero) and /enters an interior, after reconnecting, normally they should be spawned and a statistics dialog should appear on the screen. It only displays the dialog, and shows a class selection and spawn buttons. When you press spawn, this rubbish appears...



The other weird thing is that this time, I didn't get that, but my friend did. I could login normally again and get spawned again. Maybe because like I said, I wasn't in a faction, and he was.

Some /enter code...

Код:
command(enter, playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 5.0, -2491.0925,2363.2156,10.2724))
	{
	    SetPlayerPos(playerid, 207.737991,-109.019996,1005.132812);
	    SetPlayerInterior(playerid, 15);
	    GameTextForPlayer(playerid, "~w~Phat Clothing~n~~r~Type /exit to go outside", 3000, 5);
	    LoadInterior(playerid);
	}
After looking at this, it made me wonder whether it could be the player's interior not being reset OnPlayerDisconnect or Connect...

Faction spawn...

Код:
		else if(Player[playerid][SpawnPoint] == 6) //Faction Spawn
		{
		    TogglePlayerSpectating(playerid, false);
		    if(Player[playerid][ClothesUsed] == 1)
		    {
		    	SetSpawnInfo(playerid, 0, Player[playerid][Clothes1], Factions[Player[playerid][Faction]][fSpawnX], Factions[Player[playerid][Faction]][fSpawnY], Factions[Player[playerid][Faction]][fSpawnZ], Factions[Player[playerid][Faction]][fSpawnA], 0, 0, 0, 0, 0, 0);
		    	SetPlayerVirtualWorld(playerid, 0);
		    	SpawnPlayer(playerid);
		    	
		    	if(Player[playerid][Faction] == 1)
		   		{
		   		    SetPlayerArmour(playerid, 100);
				}
				if(Player[playerid][Faction] == 2)
				{
				    GivePlayerWeapon(playerid, 42, 99999);
				}
				SetPlayerArmedWeapon(playerid, 0);
			}
			else if(Player[playerid][ClothesUsed] == 2)
		    {
		    	SetSpawnInfo(playerid, 0, Player[playerid][Clothes2], Factions[Player[playerid][Faction]][fSpawnX], Factions[Player[playerid][Faction]][fSpawnY], Factions[Player[playerid][Faction]][fSpawnZ], Factions[Player[playerid][Faction]][fSpawnA], 0, 0, 0, 0, 0, 0);
		    	SetPlayerVirtualWorld(playerid, 0);
		    	SpawnPlayer(playerid);
		    	
		    	if(Player[playerid][Faction] == 1)
		   		{
		   		    SetPlayerArmour(playerid, 100);
				}
				if(Player[playerid][Faction] == 2)
				{
				    GivePlayerWeapon(playerid, 42, 99999);
				}
				SetPlayerArmedWeapon(playerid, 0);
			}
			else if(Player[playerid][ClothesUsed] == 3)
		    {
		    	SetSpawnInfo(playerid, 0, Player[playerid][Clothes3], Factions[Player[playerid][Faction]][fSpawnX], Factions[Player[playerid][Faction]][fSpawnY], Factions[Player[playerid][Faction]][fSpawnZ], Factions[Player[playerid][Faction]][fSpawnA], 0, 0, 0, 0, 0, 0);
		    	SetPlayerVirtualWorld(playerid, 0);
		    	SpawnPlayer(playerid);
		    	
		    	if(Player[playerid][Faction] == 1)
		   		{
		   		    SetPlayerArmour(playerid, 100);
				}
				if(Player[playerid][Faction] == 2)
				{
				    GivePlayerWeapon(playerid, 42, 99999);
				}
				SetPlayerArmedWeapon(playerid, 0);
			}
		}
	}
Reply
#2

MISSREAD THE question
Reply
#3

Do you use any AddPlayerClass in your script or is it all SetSpawnInfo?
Reply
#4

Just SetSpawnInfo. I don't use any AddPlayerClass, maybe that's probably why that screen above appears, but that isn't the question, the question is why it doesn't spawn, but instead returns with class selection, which shouldn't appear at all?
Reply
#5

Have you tried adding debug prints to the script? Perhaps its skipping something..
Although not your question, the reason for the "graphics error" is that you are not setting a spawn point when trying to spawn, so that perhaps links to the original problem in some way also.
Reply
#6

Quote:
Originally Posted by HighFlyer
Посмотреть сообщение
Just SetSpawnInfo. I don't use any AddPlayerClass, maybe that's probably why that screen above appears, but that isn't the question, the question is why it doesn't spawn, but instead returns with class selection, which shouldn't appear at all?
You already answered yourself with

Quote:
Originally Posted by HighFlyer
Посмотреть сообщение
Just SetSpawnInfo. I don't use any AddPlayerClass, maybe that's probably why that screen above appears
Reply
#7

Quote:
Originally Posted by [Lexi]
Посмотреть сообщение
You already answered yourself with
Yeah, but if you were intelligent enough to read my original post, you'd realize what I'm looking for. Obvious statements won't exactly be helpful whatsoever. The thing is, it should spawn without going to class selection.
Reply
#8

Try
pawn Код:
SetPlayerPos(playerid, 207.737991,-109.019996,1005.132812, 0.0);
Also check this ClickMe
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)