02.12.2013, 11:55
Well first of all, when you set a player's interior, their camera is likely to follow. So in this situation, your best option is to probably use TogglePlayerSpectating. I haven't experimented with this, but my guess is that it would work.
This should work, but if it doesn't, let me know the results and I will edit the code accordingly. Also, to let you know, this will indeed affect any kind of 'suboff' commands, or anything similar that are used to get out of the submarine, so if you want to post that command here as well, I can edit it to fit with this command.
pawn Код:
CMD:sub(playerid, params[])
{
if(IsInSub[playerid] == false)
{
if(IsPlayerInWater(playerid))
{
new Float:Pos[3], sub1, sub2;
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
IsInSub[playerid] = true;
sub1 = CreateObject(19300, Pos[0] , Pos[1], Pos[2], 0, 0, 0);
sub2 = CreateObject(1612, 0, 0, 0, 0, 0, 0, 0.0);
AttachObjectToObject(sub2, sub1 ,0, 0, 2, 0, 0, 0, 1);
TogglePlayerSpectating(playerid, 1);
AttachCameraToObject(playerid, sub2);
}
else return SendClientMessage(playerid, -1, "Error: You Need To Be In Water To Use This Command");
}
return 1;
}