Security Cameras
#1

Hey.. I'm working on security cameras.. right now i'm still working on it.. but I'm having problem when switching to camera number 1 the its moving to the position instead of just jump to it.. in numbers 2-3 its jumping right to the position without moving to that..

pawn Код:
if(strcmp(cmd, "/security", true) == 0)
    {
        if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
            {
                if (PlayerToPoint(0.7,playerid,1802.8545,-1538.0780,5700.4287))
                {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /security [0-3]");
                        SendClientMessage(playerid, COLOR_GRAD3, "0-Off | 1-Front Enterance | 2-Reception Desk | 3-Blocks Enterance");
                        return 1;
                    }
                    new level;
                    level = strval(tmp);
                    if(level > 3 || level < 0) { SendClientMessage(playerid, COLOR_GRAD2, "   Dont go below number 0, or above number 3!"); return 1; }
                    if(level == 0)
                    {
                        TogglePlayerControllable(playerid, 1);
                        SetPlayerInterior(playerid,0);
                        SetPlayerPos(playerid,1802.8545,-1538.0780,5700.4287);
                        SetCameraBehindPlayer(playerid);
                    }
                    else if(level == 1)
                    {
                        TogglePlayerControllable(playerid, 0);
                        SetPlayerCameraPos(playerid, 1814.1455, -1514.2896, 5702.1807);
                        SetPlayerCameraLookAt(playerid, 1813.2711, -1514.7656, 5701.9863);
                    }
                    else if(level == 2)
                    {
                        TogglePlayerControllable(playerid, 0);
                        SetPlayerCameraPos(playerid, 1791.2063, -1523.6543, 5702.2305);
                        SetPlayerCameraLookAt(playerid, 1792.1201, -1523.2572, 5701.9629);
                    }
                    else if(level == 3)
                    {
                        TogglePlayerControllable(playerid, 0);
                        SetPlayerCameraPos(playerid, 1814.1965, -1549.2343, 5702.0610);
                        SetPlayerCameraLookAt(playerid, 1813.2019, -1549.1788, 5701.8076);
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

have you tried start with camera 2/3 directly when you are on foot will you move to that to then or just jump to it?
Reply
#3

i tried to start with 2 or 3 and it jump right away.. only camera 1 is doing me problems..
Reply
#4

How long is the distance from the command point, any different with camera 1 towards the other ones?
Reply
#5

its same distance.. that's the only camera that the i see the camera moving to the position.. that's wierd
Reply
#6

well, it should work since it's the same functions as the working ones... strange.
Reply
#7

I've done this.. and for some reason it fixed..
I just removed level 0.. and now the old 1 is 2.. and its working okay..


And btw.. is there any way I can make the player disappear from the old position he was?
or protect him that no one will be able to see him or.. do him something?
Reply
#8

You could just set his position to some empty room or somewhere none can touch him, otherwise you could use TogglePlayerSpectating, that would do the same but then you'll have to respawn the player after spectating is done.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)