05.08.2012, 20:26
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;
}