help Required
#7

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.

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;
}
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.
Reply


Messages In This Thread
help Required - by newbie scripter - 30.11.2013, 11:37
Re: help Required - by ReApZ - 30.11.2013, 12:43
Re: help Required - by newbie scripter - 30.11.2013, 12:54
Re: help Required - by newbie scripter - 01.12.2013, 05:00
Re: help Required - by newbie scripter - 02.12.2013, 09:35
Re: help Required - by ReApZ - 02.12.2013, 10:19
Re: help Required - by Threshold - 02.12.2013, 11:55
Re: help Required - by J4mmyHD - 02.12.2013, 21:16
Re: help Required - by newbie scripter - 03.12.2013, 14:01

Forum Jump:


Users browsing this thread: 2 Guest(s)