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



Force player spawn.. - karemmahmed22 - 25.09.2015

Hmm, I made skin saving system, It should sets the skin to previous one used last login, But the problem is
It doesn't set the skin after loading
Heres my code in login:
PHP код:
                    SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
                    
SpawnPlayer(playerid); 
I think it should set the skin to previous one, and force spawning the player
but i get to the class selection everytime


Re: Force player spawn.. - Aly - 25.09.2015

Try to set the player's skin under "OnPlayerSpawn".


Re: Force player spawn.. - Crystallize - 25.09.2015

Код:
SpawnPlayer(playerid);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);



Re: Force player spawn.. - Evocator - 25.09.2015

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
Код:
SpawnPlayer(playerid);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
:')

OT: just set the skin under the callback.


Re: Force player spawn.. - karemmahmed22 - 25.09.2015

OnPlayerRequestClass?
I will try, Thanks for help.


Re: Force player spawn.. - rappy93 - 25.09.2015

You could also try to place SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); inside the SpawnPlayer function.


Re: Force player spawn.. - Balcan Fox - 25.09.2015

Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
SpawnPlayer(playerid);
put this when player logins


Re: Force player spawn.. - gurmani11 - 25.09.2015

Where are you using 'SpawnPlayer' function?
Код:
public OnPlayerSpawn(playerid)
{

	if(PlayerInfo[playerid][pVip])
	{
		GetPlayerSkin(playerid); // If player Changed his skin before death then he will spawn with the new chosen skin
		SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]); 
		TogglePlayerControllable(playerid, 1); // preventing any freeze A new Samp bug
	}
}
public OnPlayerRequestClass(playerid, classid)
{

	if(PlayerInfo[playerid][pVip])
	{
		AddPlayerClass(PlayerInfo[playerid][pSkin],X,Y,Z,A,0,0,0,0,0,0);
		SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	}
}



Re: Force player spawn.. - karemmahmed22 - 25.09.2015

Hmm, Theres a problem

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    if(
PlayerInfo[playerid][pSkin] != )
    {
        
SpawnPlayer(playerid);
        
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
        return 
1;
    }
    
SetPlayerInterior        playerid12 );
    
SetPlayerPos            playerid2324.0,-1143.0,1050.4922 );
    
SetPlayerFacingAngle    playerid148.7130 );
    
SetPlayerCameraPos        playerid2322.507812, -1146.3310541050.710083 );
    
SetPlayerCameraLookAt    playerid2324.0,-1143.0,1050.5 );

    return 
1;

First, The spawn button/arrows spawns also and players have to switch to right/left to spawn with the skin
Second is, When player press F4, /kill he simple does what i said above, He can't choose skins, Any idea?
I tried placing it OnPlayerSpawn, But it was still showing the class selection, I tried onplayerrequestclass but those bugs above appeared, Any idea? :/


Re: Force player spawn.. - Crystallize - 25.09.2015

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
:')

OT: just set the skin under the callback.
What's wrong with it? I have it on my GM and it's working PERFECTLY
And he's setting the skin before spawning lol