OnPlayerRequestClass - Camera/ Animation Not Working
#1

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.



Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)