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;
}
|
I don't see how that would work? The player is not frozen, he should be able to move the camera around himself.
|
|
also you will need to set player pos near the cameralookat. Setplayerpos should go before camera look at. if you want moving camera script or find include that moves camera foward when you press w or something.
|