player did not spawn
#1

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)