SA-MP Forums Archive
SetPlayerCameraPos - 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: SetPlayerCameraPos (/showthread.php?tid=454096)



SetPlayerCameraPos - Jhony_Blaze - 27.07.2013

Hello, I want to change the position of the camera when the register/log in box appears, I need some help cause I tried something,but didn't worked. Also I've tried to change the coordinates where new players will spawn after they register, that didn't worked either, what I am doing wrong ?

this is where I changed the coordinates

Код:
public OnPlayerSpawn(playerid)
{
    TogglePlayerSpectating(playerid, false);
	// Anti F4 Bug - Logging/Registering
	if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
	{
		if(IsPlayerNPC(playerid)) return 1;
		SetPlayerPos(playerid, -2197.6575,-2376.3530,30.6250);
		SetPlayerCameraPos(playerid, -2190.9714,-2374.7695,30.4688);
		SetPlayerCameraLookAt(playerid, -2190.9714,-2374.7695,30.4688);
	    SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	    new file[64];
		format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    // Player isn't banned
	    if(dini_Int(file, "AdminAccount") == 1)
		{
		    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		    SetPlayerName(playerid, dini_Get(file, "OldName"));
		    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
		    SSSShowDialog(playerid, 2);
		}
		if(!dini_Exists(file))
		{
		    SSSShowDialog(playerid, 1);
		    return 1;
		}
		else
		{
			SSSShowDialog(playerid, 2);
		}
		return 1;
	}



Re: SetPlayerCameraPos - wumpyc - 27.07.2013

I think you are doing this when they already spawn (OnPlayerSpawn). You should change camera position under OnPlayerRequestClass I believe.


Re: SetPlayerCameraPos - Jhony_Blaze - 27.07.2013

This is OnPlayerSpawn it says public OnPlayerSpawn