Little help about spawning players
#1

So yeah I use this code to spawn a player to spawn ofc, It does set player position and everything but the camera's bugged i tried SetCameraBehindPlayer(playerid); but nothing

pawn Код:
SetSpawnInfo(playerid, 0, 0, 1728.5672, -1668.3918, 22.6093, 1.0, -1, -1, -1, -1, -1, -1);
SpawnPlayer(playerid);
SpawnTPlayer(playerid);
Here's the "SpawnTPlayer"

pawn Код:
FUNCTION: SpawnTPlayer(playerid)
{
    SetPlayerHealth(playerid, 99.0);
    SetPlayerArmour(playerid, 99.0);
    SetCameraBehindPlayer(playerid);
    if(p_data[playerid][pReg] == 1)
    {
        SetPlayerSkin(playerid, p_data[playerid][pSkin]);
    }
    if(GetPlayerSkin(playerid) == 0)
    {
        p_data[playerid][pSkin] = 59;
        SetPlayerSkin(playerid, 59);
    }
    if(DMZ[playerid] == 0)
    {
        SetPlayerPos(playerid, 1728.5672, -1668.3918, 22.6093);
        SetPlayerInterior(playerid, 18);
        SetPlayerFacingAngle(playerid, 45.420341);
    }  
    return true;
}
Reply
#2

I had this come up last month or 3, where the camera bugs if you don't use the character selection screen and just spawn the player or something. I'll just see if it's still an active thread.


Wow, such a lot of threads to search through, but I found it...

https://sampforum.blast.hk/showthread.php?tid=649247&page=3

You may want to read over the users complete issues, and the duplicate thread. Just confirm your issue is actually the same, and not just 'similar'.

If you use the same technique as they had, it's highly likely you just need those extra few lines, but it's good to double-check it, and to re-check the rest of your code in regards to this 'fix'.
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
I had this come up last month or 3, where the camera bugs if you don't use the character selection screen and just spawn the player or something. I'll just see if it's still an active thread.


Wow, such a lot of threads to search through, but I found it...

https://sampforum.blast.hk/showthread.php?tid=649247&page=3

You may want to read over the users complete issues, and the duplicate thread. Just confirm your issue is actually the same, and not just 'similar'.

If you use the same technique as they had, it's highly likely you just need those extra few lines, but it's good to double-check it, and to re-check the rest of your code in regards to this 'fix'.
fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)