Actually i got problem in my script i am using move camera after login password but problem is i cant see plyaer classes while pressing next button and other problem is that when i spawn my camera still moving and player not showing ....
Its not full code if you cant see there problem tell me i will show full code.
pawn Код:
public OnGameModeInit()
{
SetGameModeText("ELRP");
SetTimer("MoneyTimer", 1000, 1);
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(3, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
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); //smooth dancing. It's most fitting to the music
PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
//making sure the timer gets executed only once, so the camera doesn't go to fast
if (PlayerInfo[playerid][SpawnDance]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoveCamera", moving_speed, true, "i", playerid);
PlayerInfo[playerid][SpawnDance] = false; //preventing the timer to execute again
return 1;
}
public MoveCamera(playerid)
{
//this is called trigonometry. It makes the camera spin
//you can experiment with this line. Just change the values 2, 10 and 3 to make different effects
SetPlayerCameraPos(playerid, player_x - 2 * floatsin(-PlayerInfo[playerid][SpawnAngle], degrees), player_y - 10 * floatcos(-PlayerInfo[playerid][SpawnAngle], degrees), player_z + 3);
SetPlayerCameraLookAt(playerid, player_x, player_y, player_z + 0.5);
//changing the angle a little
PlayerInfo[playerid][SpawnAngle] += 0.5;
if (PlayerInfo[playerid][SpawnAngle] >= 360.0)
PlayerInfo[playerid][SpawnAngle] = 0.0;
public OnPlayerConnect(playerid)
{
// server side money
ResetPlayerCash(playerid); //Resetting the players cash variable to zero.
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"""Login","""Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"""Register...","""Type your password below to register a new account.","Register","Quit");
}
PlayerInfo[playerid][SpawnDance] = true;
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //preventing a bug for the animation not being applied the first time OnPlayerRequestClass is called
return 1;
}
}