PDA

View Full Version : I have a Question


FaLLenGirL
22/07/2017, 11:34 AM
Hello there friends.
I have a simple questions for those who knows about what i'm talking.
Why if i use "TogglePlayerSpectating( playerid, true )" at public "OnPlayerConnect( playerid )", my map that must
to appear at public "OnPlayerRequestClass( playerid, classid )" don't appear ? I disable the spectate when a player "Login/Register" because i want to use "Spectate Mode" just when a player "Login/Register".

* If i use "TogglePlayerSpectate" even if it is disabled when the public "OnPlayerRequest" comes, appears to me
when i press "<< >> or SPAWN" just parts from map and then dissapear immediate. Does anyone have any idea?

jlalt
22/07/2017, 11:41 AM
You mean your objects not appearing when you TogglePlayerSpectate?

well if yes then you have to use Streamer Update.
you can use this after setting player pos

Streamer_Update(playerid);

or also you can use this which is more accurate.

Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);

FaLLenGirL
22/07/2017, 11:43 AM
You mean your objects not appearing when you TogglePlayerSpectate?

well if yes then you have to use Streamer Update.
you can use this after setting player pos

Streamer_Update(playerid);

or also you can use this which is more accurate.

Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z);

Hello there @jlalt

switch( classid )
{
case 0..55:
{
SetPlayerTime( playerid, 0, 0 );
SetPlayerInterior( playerid, 0 );

if( GetPlayerVirtualWorld( playerid ) != 11 )
SetPlayerVirtualWorld( playerid, 11 );

SetPlayerPos( playerid, 1929.6469,-2818.9055,5.7799 );
SetPlayerFacingAngle( playerid, 178.9658 );
ApplyAnimation( playerid, "DANCING", "DAN_Loop_A", 4.0, 1, 0, 0, 0, 0 );
ApplyAnimation( playerid, "DANCING", "DAN_Loop_A", 4.0, 1, 0, 0, 0, 0 );
SetPlayerAttachedObject( playerid, 0, 19079, 1, 0.330000, -0.079999, 0.150000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SetPlayerAttachedObject( playerid, 1, 18693, 5, -0.100000, 0.000000, -1.750000, 0.000000, 0.000000, 0.000000, 100.000000, 1.000000, 1.000000 );
SetPlayerAttachedObject( playerid, 2, 18693, 6, 0.000000, 0.000000, 1.750000, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SetPlayerCameraPos( playerid, 1928.8866, -2825.4265, 6.5730 );
SetPlayerCameraLookAt( playerid, 1929.1681, -2824.4680, 6.5030 );
Streamer_UpdateEx( playerid, 1931.51624, -2832.97754, 5.74180, 11 );
}
}

- I use this already.. or it is something wrong with it ?

StrikerZ
22/07/2017, 11:47 AM
Show the code of request class, I wanna clear out my doubt

FaLLenGirL
22/07/2017, 11:48 AM
forward OnPlayerRequestClass( playerid, classid );
public OnPlayerRequestClass( playerid, classid )
{
HideIntroTextdraws( playerid );
HideSpawnTextdraws( playerid );

gPlayerSpawned[ playerid ] = false;
gTeamSelection[ playerid ] = true;

TextDrawHideForPlayer( playerid, TextAfk1 );
TextDrawHideForPlayer( playerid, TextAfk2 );
TextDrawHideForPlayer( playerid, Name_Intro );
TextDrawHideForPlayer( playerid, Reaction_TD );

PlayerTextDrawHide( playerid, gTerswarTD[ playerid ] );
PlayerTextDrawHide( playerid, gTerswarBarTD[ playerid ] );
HidePlayerProgressBar( playerid, gTerswarBar[ playerid ] );

switch( classid )
{
case 0..55:
{
SetPlayerTime( playerid, 0, 0 );
SetPlayerInterior( playerid, 0 );

if( GetPlayerVirtualWorld( playerid ) != 11 )
SetPlayerVirtualWorld( playerid, 11 );

SetPlayerPos( playerid, 1929.6469,-2818.9055,5.7799 );
SetPlayerFacingAngle( playerid, 178.9658 );
ApplyAnimation( playerid, "DANCING", "DAN_Loop_A", 4.0, 1, 0, 0, 0, 0 );
ApplyAnimation( playerid, "DANCING", "DAN_Loop_A", 4.0, 1, 0, 0, 0, 0 );
SetPlayerAttachedObject( playerid, 0, 19079, 1, 0.330000, -0.079999, 0.150000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SetPlayerAttachedObject( playerid, 1, 18693, 5, -0.100000, 0.000000, -1.750000, 0.000000, 0.000000, 0.000000, 100.000000, 1.000000, 1.000000 );
SetPlayerAttachedObject( playerid, 2, 18693, 6, 0.000000, 0.000000, 1.750000, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SetPlayerCameraPos( playerid, 1928.8866, -2825.4265, 6.5730 );
SetPlayerCameraLookAt( playerid, 1929.1681, -2824.4680, 6.5030 );
Streamer_UpdateEx( playerid, 1931.51624, -2832.97754, 5.74180, 11 );
}
}
return 1;
}

That's it.
Also i saw that, one of the objects it is not dynamic and appear, can be this the problem ? Maybe i must make the objects from request not dynamic ?

jlalt
22/07/2017, 11:49 AM
NVM...

FaLLenGirL
22/07/2017, 11:51 AM
if( GetPlayerVirtualWorld( playerid ) != 11 ) SetPlayerVirtualWorld( playerid, 11 );
That "11" it is for World if u look closer. The Interior is 0.

StrikerZ
22/07/2017, 11:56 AM
Show any 1 line of your map code

FaLLenGirL
22/07/2017, 12:04 PM
Show any 1 line of your map code

Thank you very much to all, the problem was that the objects were dynamic. Solved. Thank you.