11.01.2014, 23:15
Hello, I've ran into a problem.
Whatever I do, the camera is not changing position.
The debug message is coming through just fine, so is the "return camera to player" part and the 3D text. It's just not moving the camera.
Whatever I do, the camera is not changing position.
The debug message is coming through just fine, so is the "return camera to player" part and the 3D text. It's just not moving the camera.
pawn Код:
COMMAND:snakecam(playerid, params[])
{
new count_h = 0;
for(new h = 0; h < sizeof(HouseInfo); h++)
{
count_h++;
}
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if (PlayerInfo[playerid][pdSuspensionDay] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently suspened of the Police department !");
if(GetPVarInt(playerid, "Duty") != 1 && GetPVarInt(playerid, "Member") == 7) return SendClientMessage(playerid, COLOR_WHITE, "You are not on duty !");
if(GetPVarInt(playerid, "Member") == 7)
{
if(P_snakecam[playerid] == 0)
{
if(count_h == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " You are not near a house.");
}
else
{
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]))
{
PlayerTag[playerid] = Create3DTextLabel("((Snakecam mode))", COLOR_WHITE, 0, 0, 0, 15, 0,1);
SetPlayerInterior(playerid,HouseInfo[h][hEInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hEWorld]);
P_snakecam[playerid] = 1;
Update3DTextLabelText(PlayerTag[playerid],COLOR_PURPLE,"((Snakecam mode))");
Attach3DTextLabelToPlayer(Text3D:PlayerTag[playerid], playerid, 0, 0, 0.0);
//SetPlayerCameraPos(playerid,50, 20, 10);
SetPlayerCameraPos(playerid,HouseInfo[h][hExitX],HouseInfo[h][hExitY],HouseInfo[h][hExitZ]);
SendClientMessage(playerid, COLOR_WHITE, "[DEBUG]: Command came through.");
}
}
}
}
else
{
SetCameraBehindPlayer(playerid);
P_snakecam[playerid] = 0;
Delete3DTextLabel(PlayerTag[playerid]);
}
}
else SendClientMessage(playerid, COLOR_GREY, "You're not a cop!");
return 1;
}