[HELP] AttachCameraToObject - Camera Bugs and Crash!
#7

Is bug ..

I use this:
pawn Code:
//// TOP OF gm: new gCameraPlayer[MAX_PLAYERS];


//// onplayerconnect -> gCameraPlayer[playerid] = CreateObject(19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);

//// onplayerdisconnect -> DestroyObject(gCameraPlayer[playerid]);



//// in setplayerpos
//// SetCameraBehindPlayer(playerid);
//// SetTimerEx("fixCamera", 500, false, "d", playerid);

///  in fixCamera
///  SetCameraBehindPlayer(playerid);
///  AttachObjectToPlayer(gCameraPlayer[playerid], playerid, 0.0, 0.3, 0.75  , 0.0, 0.0, 0.0);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    if(!IsPlayerInAnyVehicle(playerid)){

        AttachObjectToPlayer(gCameraPlayer[playerid], playerid, 0.0, 0.3, 0.75  , 0.0, 0.0, 0.0);

        AttachCameraToObject(playerid, gCameraPlayer[playerid]);


    }

    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate) {


    if( newstate != PLAYER_STATE_ONFOOT) {
        return SetCameraBehindPlayer(playerid);
    }

    AttachObjectToPlayer(gCameraPlayer[playerid], playerid, 0.0, 0.3, 0.75  , 0.0, 0.0, 0.0);

    AttachCameraToObject(playerid, gCameraPlayer[playerid]);

    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)