SA-MP Forums Archive
OnPlayerRequestClass - Camera/ Animation Not Working - 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: OnPlayerRequestClass - Camera/ Animation Not Working (/showthread.php?tid=65001)



OnPlayerRequestClass - Camera/ Animation Not Working - member - 08.02.2009

Hi,

As the title suggests, I can't figure out why the camera angle, view, player position etc doesn't change for one class (case 4). Nothing seems to happen.

I've also noticed that I can't change the player animations for each class. The only solution to this was to put the animation afterwards so that only one animation applies to all characters, which is what I am using now.

Here it is:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
      case 0:
      {
        GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~g~]Attacker]",3000,3);
        ApplyAnimation(playerid,"PED","WALK_DRUNK",4.0,5000,0,0,0,0);
        SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, -1426.575805, 23.959726, 14.148437);
            SetPlayerFacingAngle(playerid, 219.106613);
            SetPlayerCameraPos(playerid, -1423.829833, 20.462652, 14.148437);
            SetPlayerCameraLookAt(playerid, -1426.575805, 23.959726, 14.148437);
      }
      case 1:
      {
        GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~b~]Defender]",3000,3);
        ApplyAnimation(playerid,"GANGS","DEALER_DEAL",4.0,5000,0,0,0,0);
      }
      case 2:
      {
        GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~y~]Referee]",3000,3);
        SetPlayerColor(playerid,AAD_COLOR_YELLOW);
        SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, -1426.575805, 23.959726, 14.148437);
            SetPlayerFacingAngle(playerid, 219.106613);
            SetPlayerCameraPos(playerid, -1423.829833, 20.462652, 14.148437);
            SetPlayerCameraLookAt(playerid, -1426.575805, 23.959726, 14.148437);
      }
      case 3:
      {
            GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~r~]DEATHMATCH TEAM]",3000,3);
            SetPlayerInterior(playerid, 1);
            SetPlayerPos(playerid, 959.1993,2127.9451,1011.0234);
            SetPlayerFacingAngle(playerid, 150.0000);
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            SetPlayerCameraPos(playerid, X + 5.0, Y, Z + 5.0);
            SetPlayerCameraLookAt(playerid, X, Y, Z);

      }
    }
    mySetPlayerColor(playerid,AAD_COLOR_GREY);
  SetPlayerPos(playerid, -1426.575805, 23.959726, 14.148437);
    SetPlayerFacingAngle(playerid, 219.106613);
    SetPlayerCameraPos(playerid, -1423.829833, 20.462652, 14.148437);
    SetPlayerCameraLookAt(playerid, -1426.575805, 23.959726, 14.148437);
    ApplyAnimation(playerid,"PLAYIDLES","TIME",4.1,1,1,1,1,1);
    return 1;
}
(ignore the indentation, it's perfect in the script)

Your help is much appreciated.






Re: OnPlayerRequestClass - Camera/ Animation Not Working - Grove - 08.02.2009

I can't see anything wrong with the script to be honest. Try adding debug statements.