SetPlayerCameraPos HELP..
#1

I have made a cinematic camera, but when I run the script it immediately jumps into the last cinematic code ... how do I make the code run gradually?

PHP код:
CinematicCam(playerid)
{
    
SetPlayerCameraPos(playerid,1276.006469,-936.524597,90.039863);
    
SetPlayerCameraLookAt(playerid,1246.505981,-844.114501,81.519821);
    
InterpolateCameraPos(playerid,1276.006469,-936.524597,90.039863,1389.417602,-931.154968,82.439796,10000,CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid,1246.505981,-844.114501,81.519821,1426.016967,-844.654479,102.139877,10000,CAMERA_MOVE);
    
//=================================================================
    
SetPlayerCameraPos(playerid,1483.950439,-940.354980,261.869598);
    
SetPlayerCameraLookAt(playerid,1421.649658,-993.505432,189.409561);
    
InterpolateCameraPos(playerid,1483.950439,-940.354980,261.869598,1492.840576,-1644.854858,47.399536,34000,CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid,1421.649658,-993.505432,189.409561,1547.959716,-1675.065673,19.279478,32000,CAMERA_MOVE);
    
//=================================================================
    
SetPlayerCameraPos(playerid,369.816406,-1802.654541,7.591873); // this code is executed directly and passes the previous code !! :(
    
SetPlayerCameraLookAt(playerid,369.816589,-1803.047241,6.231879);
    
InterpolateCameraPos(playerid,369.816406,-1802.654541,7.591873,369.926391,-2010.772827,14.871878,34000,CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid,369.816589,-1803.047241,6.231879,369.836364,-2073.043701,21.061885,32000,CAMERA_MOVE);
    
//=================================================================

Reply
#2

why you dont try something like if because when it chose it will try every of that if something like this

pawn Код:
if(PlayerInfo[playerid][pAdmin] >=5)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 5(Head Admina):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=6)
            {   SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 6(Direktora):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=7)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 7(Vlasnik):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/setmoney,/setadmin,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"__
im not sure about it but i think
Reply
#3

and use something like commands /camera 1 uses first cinematic camera /camera 2 use second /camera 3 use third i dont know where you want to put those cameras but
Reply
#4

https://github.com/IllidanS4/PawnPlus
Download this include & plugin and use wait_ms(milisec) like this:
Код:
CinematicCam(playerid) 
{ 
    SetPlayerCameraPos(playerid,1276.006469,-936.524597,90.039863); 
    SetPlayerCameraLookAt(playerid,1246.505981,-844.114501,81.519821); 
    InterpolateCameraPos(playerid,1276.006469,-936.524597,90.039863,1389.417602,-931.154968,82.439796,10000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,1246.505981,-844.114501,81.519821,1426.016967,-844.654479,102.139877,10000,CAMERA_MOVE); 
    wait_ms(5000); //Will wait 5s before executing code below;
    //================================================================= 
    SetPlayerCameraPos(playerid,1483.950439,-940.354980,261.869598); //Executed after 5s from wait_ms
    SetPlayerCameraLookAt(playerid,1421.649658,-993.505432,189.409561); //Normally executed
    InterpolateCameraPos(playerid,1483.950439,-940.354980,261.869598,1492.840576,-1644.854858,47.399536,34000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,1421.649658,-993.505432,189.409561,1547.959716,-1675.065673,19.279478,32000,CAMERA_MOVE); 
    wait_ms(5000); //Will wait 5s before executing code below;
    //================================================================= 
    SetPlayerCameraPos(playerid,369.816406,-1802.654541,7.591873); // Executed after 5s from wait_ms
    SetPlayerCameraLookAt(playerid,369.816589,-1803.047241,6.231879); //Normally works
    InterpolateCameraPos(playerid,369.816406,-1802.654541,7.591873,369.926391,-2010.772827,14.871878,34000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,369.816589,-1803.047241,6.231879,369.836364,-2073.043701,21.061885,32000,CAMERA_MOVE); 
    //================================================================= 
}
Reply
#5

Quote:
Originally Posted by Deken
Посмотреть сообщение
why you dont try something like if because when it chose it will try every of that if something like this

pawn Код:
if(PlayerInfo[playerid][pAdmin] >=5)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 5(Head Admina):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=6)
            {   SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 6(Direktora):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=7)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 7(Vlasnik):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/setmoney,/setadmin,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"__
im not sure about it but i think
Quote:
Originally Posted by Deken
Посмотреть сообщение
and use something like commands /camera 1 uses first cinematic camera /camera 2 use second /camera 3 use third i dont know where you want to put those cameras but
Quote:
Originally Posted by NexyAG
Посмотреть сообщение
https://github.com/IllidanS4/PawnPlus
Download this include & plugin and use wait_ms(milisec) like this:
Код:
CinematicCam(playerid) 
{ 
    SetPlayerCameraPos(playerid,1276.006469,-936.524597,90.039863); 
    SetPlayerCameraLookAt(playerid,1246.505981,-844.114501,81.519821); 
    InterpolateCameraPos(playerid,1276.006469,-936.524597,90.039863,1389.417602,-931.154968,82.439796,10000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,1246.505981,-844.114501,81.519821,1426.016967,-844.654479,102.139877,10000,CAMERA_MOVE); 
    wait_ms(5000); //Will wait 5s before executing code below;
    //================================================================= 
    SetPlayerCameraPos(playerid,1483.950439,-940.354980,261.869598); //Executed after 5s from wait_ms
    SetPlayerCameraLookAt(playerid,1421.649658,-993.505432,189.409561); //Normally executed
    InterpolateCameraPos(playerid,1483.950439,-940.354980,261.869598,1492.840576,-1644.854858,47.399536,34000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,1421.649658,-993.505432,189.409561,1547.959716,-1675.065673,19.279478,32000,CAMERA_MOVE); 
    wait_ms(5000); //Will wait 5s before executing code below;
    //================================================================= 
    SetPlayerCameraPos(playerid,369.816406,-1802.654541,7.591873); // Executed after 5s from wait_ms
    SetPlayerCameraLookAt(playerid,369.816589,-1803.047241,6.231879); //Normally works
    InterpolateCameraPos(playerid,369.816406,-1802.654541,7.591873,369.926391,-2010.772827,14.871878,34000,CAMERA_MOVE); 
    InterpolateCameraLookAt(playerid,369.816589,-1803.047241,6.231879,369.836364,-2073.043701,21.061885,32000,CAMERA_MOVE); 
    //================================================================= 
}
Thank you guys for helping me, i'll try it
Reply
#6

Quote:
Originally Posted by Deken
Посмотреть сообщение
why you dont try something like if because when it chose it will try every of that if something like this

pawn Код:
if(PlayerInfo[playerid][pAdmin] >=5)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 5(Head Admina):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=6)
            {   SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 6(Direktora):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________");
            }
            if(PlayerInfo[playerid][pAdmin] >=7)
            {
                SendClientMessage(playerid,-1,""CRVENA"____________________________________________________________________ ");
                SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Komande Admina Level 7(Vlasnik):/kill,/heal,/jetpack,/kick,/jail,/giveweapon,/ban,/setmoney,/setadmin,/cc(/clearchat)");
                SendClientMessage(playerid,-1,""CRVENA"__
im not sure about it but i think
That's bad code buddy, if I'm Admin Lvl 7 then I'll get the messages for every level before it. That's why else-if exists.
Reply
#7

Quote:
Originally Posted by sammp
Посмотреть сообщение
That's bad code buddy, if I'm Admin Lvl 7 then I'll get the messages for every level before it. That's why else-if exists.
I use code from NexyAG, and the results work well!... and it is useful for timers on other codes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)