[HELP] AttachCameraToObject - Camera Bugs and Crash! -
[DkS]JR_Junior - 14.08.2012
I have the script for my server, is the mode First Person, this work fine, but now simply have started a bug:
The screen is flickering... falshing.
pawn Code:
if (strcmp("/ppessoa", cmdtext, true, 10) == 0)
{
if(PrimeiraPessoa[playerid] == 0)
{
ObjetoPrimeiraPessoa[playerid] = CreateObject(18685, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);//19300
AttachObjectToPlayer(ObjetoPrimeiraPessoa[playerid], playerid, 0.0, 0.2, 0.68, 0.0, 0.0, 0.0);
//AttachObjectToPlayer(ObjetoPrimeiraPessoa[playerid],playerid, 0.0, 0.12, 0.7, 0.0, 0.0, 0.0);
AttachCameraToObject(playerid, ObjetoPrimeiraPessoa[playerid]);
GameTextForPlayer(playerid, "~y~primeira pessoa~n~~w~ativado", 5000, 1);
PrimeiraPessoa[playerid] = 1;
return 1;
}
else
{
SetCameraBehindPlayer(playerid);
DestroyObject(ObjetoPrimeiraPessoa[playerid]);
PrimeiraPessoa[playerid] = 0;
GameTextForPlayer(playerid, "~y~primeira pessoa~n~~r~desativado", 5000, 1);
}
return 1;
}
The video not is my, but i used for example of the bug! Help me, please!
[ame]http://www.youtube.com/watch?v=Vz9WPmZM33c[/ame]
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
Baboon - 14.08.2012
Does the same happens with other skins or weapons?
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
[DkS]JR_Junior - 14.08.2012
Quote:
Originally Posted by Strawhats
Does the same happens with other skins or weapons?
|
Yes
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
Babul - 16.08.2012
rapid objectmovements can cause this. how are you moving the object? setting its position or moving it? if moving, @ which speed?
i experienced the flashing screen (like at the end) only, the white short flashes are beyound my knowledge o.O
oh, you can reset your camera: simply teleport you to somewhere else, this way the camera gets re-initialized, no need to /q anymore ^^
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
milanosie - 16.08.2012
Lol, you used my video :$
But yeah that happens sometimes, randomly...
I somehow managed to fix it myself though, don't know how.
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
[DkS]JR_Junior - 17.08.2012
I have teleported, but dont fix...
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
ipsBruno - 17.08.2012
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;
}
Re: [HELP] AttachCameraToObject - Camera Bugs and Crash! -
[DkS]JR_Junior - 18.08.2012
Valeu bruno... muito estranho... loguei hoje no server e nгo estava dando mais... vamos ver se volta, se voltar eu tento o teu modo... talvez seja bug no proprio samp, sei la!