SA-MP Forums Archive
player did not 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: player did not spawn (/showthread.php?tid=555312)



player did not spawn - PowerF - 07.01.2015

why i'm did not spawn when im connecting?

Код:
   LoadPlayerTextDraws( playerid );			LoadBeachSpawn( playerid );
    InfoTD_MSG(playerid, 3000, "~w~Loading~w~~h~...");
    admin3D[ playerid ] = Create3DTextLabel( "", ~1, 0.0, 0.0, 0.0, 50.0, 0, 1 );

	// ( Spam Protection )
	PlayerInfo[ playerid ][ Spawned ] = ( 0 );
    
    for(new i = 0; i < 30; i++) SendClientMessage( playerid, ~1, " " ); // Clear Chat
	session[ connections ] = session[ connections ] + 1;
    #if USE_ANTI_STEALER == true
	   	new str[ 100 ];
		gpci( playerid , str , sizeof( str ) );
		if( !strcmp( str , DISALLOWED_ADDRESS ,true ) )
		{
			SendClientMessage( playerid , ~1 ,""R"[ "O"Anti Stealer "R"]" );
			BanEx( playerid, "# Map Stealer / RakSampClient" );
	    }
    #endif

	for ( new i = 0; i < 12; i++ )
	    PlayerTextDrawShow( playerid, ConnectTD[ i ] );

	OnPlayerConnectEx( playerid );              //CheckPlayerAccount( playerid );
    gsString[ 0 ] = EOS;
    new connecting_ip[ 16 ];
	PlayerLogo[ playerid ] = false;
	GetPlayerIp( playerid, connecting_ip, 16 );
	if ( GetNumberOfPlayersOnThisIP( connecting_ip ) > MAX_CONNECTIONS_FROM_IP )

	format( gsQuery, 512, "SELECT * FROM `Banlist` WHERE `IP` = '%s' OR `Name` = '%s'", connecting_ip, PlayerName( playerid ) );
    mysql_query( gsQuery, THREAD_CHECK_BANS_LIST, playerid );
    TogglePlayerSpectating(playerid, true);
	LoadRemoveBuildings( playerid );
    return ( 1 );
}



Re: player did not spawn - Rufio - 07.01.2015

You have no indentation, at all. Your code is extremely hard to read, but as far as I am concerned with your code, you have set TogglePlayerSpectating function to true which will cause the client to spectate instead of spawning. use SetSpawnInfo and then SpawnPlayer if you would like to spawn a person upon connecting.

More info is here;

https://sampwiki.blast.hk/wiki/SetSpawnInfo
https://sampwiki.blast.hk/wiki/SpawnPlayer

Edit: Also if you'd like to spawn player upon connecting, delete TogglePlayerSpectating(playerid,true); aswell.