OnPlayerRequestClass problem[+rep] - 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)
+--- Thread: OnPlayerRequestClass problem[+rep] (
/showthread.php?tid=481691)
OnPlayerRequestClass problem[+rep] -
ZBits - 17.12.2013
Hello,
I am using a moving camera function on OnPlayerRequestClass, the problem is that when i try to enter the class selection after connecting it doest go to the class selection but instead just stays at a unknown position, but when i hit spawn, it spawns me and the main part is that when i go to the class selection by /kill and F4 it takes me to the correct class selection.
My Code
Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, player_x,player_y,player_z);
SetPlayerFacingAngle(playerid, player_angle);
SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
PlayerPlaySound(playerid,1097,-119.9460,23.1096,12.2238);
if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo[playerid][SpawnDance] = false;
return 1;
}
Re: OnPlayerRequestClass problem[+rep] -
RafaelZam - 17.12.2013
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, player_x,player_y,player_z);
SetPlayerFacingAngle(playerid, player_angle);
SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
PlayerPlaySound(playerid,1097,-119.9460,23.1096,12.2238);
if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo[playerid][SpawnDance] = false;
return 1;
}
this is maybe the solution.
Re: OnPlayerRequestClass problem[+rep] -
DavidLuango - 17.12.2013
Moving camera function?
Have you ever thought of using InterPolateCameraPos?
Re: OnPlayerRequestClass problem[+rep] -
ZBits - 17.12.2013
Quote:
Originally Posted by Rafael_Zambrano
pawn Код:
public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, player_x,player_y,player_z); SetPlayerFacingAngle(playerid, player_angle); SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z); SetPlayerCameraLookAt(playerid, player_x,player_y,player_z); ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); PlayerPlaySound(playerid,1097,-119.9460,23.1096,12.2238); if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid); PlayerInfo[playerid][SpawnDance] = false; return 1; }
this is maybe the solution.
|
Nope, i just messed up the code while posting
@David
Mind showing me how it works?
Re: OnPlayerRequestClass problem[+rep] -
ZBits - 17.12.2013
Fixed, i re-build the code.
But i have a question, when ever i scroll fast through the class selection, the screns bugs for a second, why does that happen?, is there any way to prevent that from happening?