SA-MP Forums Archive
Little help about spawning players - 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 help about spawning players (/showthread.php?tid=655380)



Little help about spawning players - IdonTmiss - 20.06.2018

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;
}



Re: Little help about spawning players - Sew_Sumi - 20.06.2018

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'.


Re: Little help about spawning players - IdonTmiss - 20.06.2018

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