Force player spawn..
#1

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
Reply
#2

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

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

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

OT: just set the skin under the callback.
Reply
#5

OnPlayerRequestClass?
I will try, Thanks for help.
Reply
#6

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

Код:
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
Reply
#8

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

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? :/
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)