SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 03/10/2018, 03:49 PM   #1
Spoookymon
Little Clucker
 
Join Date: Apr 2017
Posts: 38
Reputation: 2
Angry [0.3.7] SetPlayerInterior bug

Can't set player interior if player was never spawned.

SetPlayerInterior returns 1 ( success ), but GetPlayerInterior returns 0.

* I'm using spectate mode to avoid default spawn system, so it might be part of the problem.
Spoookymon is offline   Reply With Quote
Old 03/10/2018, 10:10 PM   #2
Awide
Big Clucker
 
Join Date: Mar 2014
Posts: 95
Reputation: 6
Default Re: [0.3.7] SetPlayerInterior bug

Show the code.
Awide is offline   Reply With Quote
Old 04/10/2018, 11:48 AM   #3
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italy
Posts: 1,423
Reputation: 120
Default Re: [0.3.7] SetPlayerInterior bug

This is not a proper bug report, you should have posted in the scripting help section.
__________________
Desktop, Web, Mobile and Game Developer
  • SA-MP Game Modes and Filter Scripts (PAWN, SQL) (8 years experience)
  • Windows .NET Applications (WPF, UWP)
  • Android Applications (Java Android SDK, Xamarin)
  • Web Design and Development (Wordpress, ASP.NET MVC, PHP, SQL)
  • Game Development (Unity3D, GameMaker Studio, LibGDX)
sasinosoft@gmail.com
Use this email - don't PM
Sasino97 is offline   Reply With Quote
Old 04/10/2018, 06:17 PM   #4
Spoookymon
Little Clucker
 
Join Date: Apr 2017
Posts: 38
Reputation: 2
Default Re: [0.3.7] SetPlayerInterior bug

Sorry i was busy, example code:

Code:
#include <a_samp>

forward TIMER_SetInterior( playerid );


public OnGameModeInit()
{
    AddPlayerClass( 1, 207.737991, -109.019996, 1005.132812, 269.15, 26, 36, 28, 150, 0, 0 ); // CJ
	return 1;
}


public OnPlayerConnect( playerid )
{
	ShowPlayerDialog( playerid, 1, DIALOG_STYLE_MSGBOX, "Enable spectating mode", "Click next to enable spectating mode.", "Next", "" );
	return 1;
}


public OnDialogResponse( playerid, dialogid, response )
{
	if( dialogid == 1 )
	{
	    if( response )
		{
			TogglePlayerSpectating( playerid, 1 );
			SetPlayerCameraPos( playerid, 207.737991, -109.019996, 1005.532812 ); // Binco interior
			SetPlayerCameraLookAt( playerid, 207.4800, -103.9329, 1005.2578 );
			SetTimerEx( "TIMER_SetInterior", 1000, true, "i", playerid );
		}
	    return 1;
	}
	return 1;
}


public TIMER_SetInterior( playerid )
{
	SendClientMessage( playerid, -1, "Trying to set interior..." );
	
	if( SetPlayerInterior( playerid, 15 ) ) print( "SetPlayerInterior returns 1" );
	else print( "SetPlayerInterior returns 0" );
	
	printf( "GetPlayerInterior returns %i\n", GetPlayerInterior( playerid ) );
	return 1;
}


public OnPlayerSpawn( playerid )
{
	SetPlayerPos( playerid, 207.737991, -109.019996, 1005.132812 );
	return 1;
}
Spoookymon is offline   Reply With Quote
Old 05/10/2018, 10:37 AM   #5
J0sh...
High-roller
 
J0sh...'s Avatar
 
Join Date: Aug 2014
Location: Hamburger
Posts: 1,350
Reputation: 427
Default Re: [0.3.7] SetPlayerInterior bug

This probably doesn't get set correctly (by that I mean the data GetPlayerInterior fetches) because you're in a spectating state. However, you SHOULD be in the interior. Use /interior on the client side, it will tell what interior ID you're in.
__________________
🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔🍔
Yes I know my name has 3 dots.
Thanks for noticing, it was meant to signify a pause in the personal message asking to be named J0sh but they got included.
J0sh... is offline   Reply With Quote
Old 05/10/2018, 10:56 AM   #6
Variable™
Gangsta
 
Variable™'s Avatar
 
Join Date: Jul 2015
Location: Somewhere...
Posts: 748
Reputation: 153
Default Re: [0.3.7] SetPlayerInterior bug

Never encountered such bug. If you skip the class selection you'll be forced after next death unless you bypass it.
__________________
MW4 Community
Variable™ is offline   Reply With Quote
Old 05/10/2018, 05:39 PM   #7
Spoookymon
Little Clucker
 
Join Date: Apr 2017
Posts: 38
Reputation: 2
Default Re: [0.3.7] SetPlayerInterior bug

Quote:
Originally Posted by J0sh... View Post
This probably doesn't get set correctly (by that I mean the data GetPlayerInterior fetches) because you're in a spectating state. However, you SHOULD be in the interior. Use /interior on the client side, it will tell what interior ID you're in.
Hmm, yes /interior is 15, but you can't see binco interior, which should be client sided ?
And, if you remove SetPlayerCam... GTA map and water disappears, so you are in interior.

So it's GetPlayerInterior. It could be fixed with simple include, but plugins that use GetPlayerInterior ( like streamer ) would still return 0, so it's not an option, and should be fixed by Kal if possible.


Quote:
Originally Posted by Variable™ View Post
Never encountered such bug. If you skip the class selection you'll be forced after next death unless you bypass it.
Yes i'm bypass'ing it. I think that this class system should be removed, in most servers I've seen it's unused but you have to press "Spawn" to spawn in.
You don't have to remove it, just allow us to disable it. ( DisableClassSystem ? )
Spoookymon is offline   Reply With Quote
Old 09/10/2018, 09:19 PM   #8
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,315
Reputation: 3191
Default Re: [0.3.7] SetPlayerInterior bug

Actually the bug is the fact that TogglePlayerSpectating skips class selection, which puts you in a bug state. The fact that other things don't work from this point on isn't that surprising.
Y_Less is offline   Reply With Quote
Old 10/10/2018, 04:59 PM   #9
Spoookymon
Little Clucker
 
Join Date: Apr 2017
Posts: 38
Reputation: 2
Default Re: [0.3.7] SetPlayerInterior bug

Quote:
Originally Posted by Y_Less View Post
Actually the bug is the fact that TogglePlayerSpectating skips class selection, which puts you in a bug state. The fact that other things don't work from this point on isn't that surprising.
Turning off spectating mode spawns and auto kicks player from server, but if you use SpawnInfo before turning off spectating mode you don't get kicked.
I have been using this "method" to skip class selection for many years now, and i haven't noticed any other problems.
Spoookymon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda]SetPlayerInterior BUG Sergio_MOW Português/Portuguese 5 18/09/2011 07:11 PM
[SOLVED] SetPlayerInterior FreddeN Help Archive 5 09/02/2010 02:25 PM
First GetPlayerInterior and then SetPlayerInterior Bearfist Help Archive 4 10/12/2009 04:52 PM
SetPlayerInterior ? XxJoexX Help Archive 4 05/09/2009 11:53 PM


All times are GMT. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.