SA-MP Forums Archive
Little Spawn help! - 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: Little Spawn help! (/showthread.php?tid=633573)



Little Spawn help! - Hunud - 03.05.2017

Hi,

Here we go again, Is there any possibility to avoid class selection(SKIN) after player login in! I know about SpawnPlayer(playerid) and blabla but where should i set it and I'm using skin saving, so whoever has own skin saved he should be spawned after login without any skin selection! +REP

I use something like this inside OnPlayerConnect

Код:
if(PlayerInfo[playerid][Skin] != -1)
     {
     	SpawnPlayer(playerid);
    	SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
     }
OnPlayerSpawn

Код:
SetPlayerSkin( playerid, PlayerInfo[playerid][Skin] );
So, How should i create to avoid skin (class selection) to peoples who saved his skin! Thanks REP


Re: Little Spawn help! - Hunud - 03.05.2017

Anyone ? Need it fast Sorry bump!


Re: Little Spawn help! - aoky - 03.05.2017

Here you go.

PHP код:
SpawnPlayer(playerid); 



Re: Little Spawn help! - Hunud - 03.05.2017

Quote:
Originally Posted by aoky
Посмотреть сообщение
Here you go.

PHP код:
SpawnPlayer(playerid); 
I wrote this above

Quote:

I know about SpawnPlayer(playerid) and blabla but where should i set it and I'm using skin saving




Re: Little Spawn help! - moura98 - 03.05.2017

Talk about this?
Код:
public OnPlayerRequestSpawn(playerid) return 0;



Re: Little Spawn help! - Hunud - 03.05.2017

Yea but, how do i check with this if player has a saved skin he will be spawned after login without any class(skin selection) ?


Re: Little Spawn help! - DarkSkull - 03.05.2017

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

Try using this before SpawnPlayer(playerid);

Put it under OnPlayerRequestClass.


Re: Little Spawn help! - Hunud - 03.05.2017

I tryed with OnPlayerRequestClass with this:


Same problem

Код:
 if(PlayerInfo[playerid][Skin] != -1)
	{
    SetSpawnInfo(playerid, 255, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
    SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
	}



Re: Little Spawn help! - DarkSkull - 03.05.2017

PHP код:
if(PlayerInfo[playerid][Skin] != -1)
{
    
SetSpawnInfo(playerid255PlayerInfo[playerid][Skin], 0.00.00.00.0000000);
    
SpawnPlayer(playerid);

I think this will work. Not sure. Try it out. Also change the x,y,z coords so that the player doesn't spawn in the middle of nowhere.


Re: Little Spawn help! - Hunud - 03.05.2017

I appriciate your help but still is problem! Used it like example

Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(PlayerInfo[playerid][Skin] != -1)
	{
    	SetSpawnInfo(playerid, 255, PlayerInfo[playerid][Skin], 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
    	SpawnPlayer(playerid);
	}
         SetPlayerPos(playerid, 414.6747,-4.1441,994.6751);
        SetPlayerCameraPos(playerid, 213.9725,-12.1422,994.2751);
	SetPlayerFacingAngle(playerid, 31.33);
	SetPlayerCameraLookAt(playerid, 312.6747,-3.3321,994.6751);
	return 1;
}