SA-MP Forums Archive
Camera wont set on class selection - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Camera wont set on class selection (/showthread.php?tid=139399)



Camera wont set on class selection - Mikep. - 04.04.2010

Code:

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{  
  SetPlayerPos(playerid,170.8213,1089.6483,21.8681);
  SetPlayerCameraPos(playerid,172,1094.6276,25);
  SetPlayerCameraLookAt(playerid,172.4376,1089.7999,23);
  SetPlayerFacingAngle(playerid, 333);
  return 1;
}
Result:



This is starting to get on my nerves.


Re: Camera wont set on class selection - RSX - 04.04.2010

Player doesn't get to class request.. atleast looks like that.
(I have no problems with that and have close syntax to that)


Re: Camera wont set on class selection - Joe_ - 04.04.2010

Mhhh... I dunno.

One thing I see is you're making the camera look at the camera position, not the player position.

yeah and as above said, it looks like your login system is stopping OnPlayerRequestClass, and when you login, you must spawn or something, try disabling your login system and see if it works, if it does, try moving your "must login" to OnPlayerRequestSpawn.


Re: Camera wont set on class selection - Mikep. - 04.04.2010

UPDATE:

public OnPlayerRequestClass(playerid, classid)
{

SetPlayerPos(playerid, 2341.8713,1725.1122,25.2689);
SetPlayerCameraPos(playerid, 2335.43,1718.92,23);
SetPlayerCameraLookAt(playerid, 2342.11,1724.43,23);
SetPlayerFacingAngle(playerid, 140);

if(!GetPVarInt(playerid, "Logged")) SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin"));
return 1;
}

New stuff, still old problem.


Re: Camera wont set on class selection - Joe_ - 04.04.2010

I don't think you can set a players skin if he's not spawned either, set the skin when the person requests to spawn, or skip class selection all together for the player and give him his skin.


Re: Camera wont set on class selection - RSX - 04.04.2010

More code >> more help !


Re: Camera wont set on class selection - gotenks918 - 04.04.2010

Didn't someone mention something about toggling spectate off?


Re: Camera wont set on class selection - ziomal432 - 04.04.2010

I think it's because you use GUI.


Re: Camera wont set on class selection - Mikep. - 04.04.2010

That's exactly right. I removed the dialog and it worked fine. Thanks guys.