[FilterScript] [FS]BirdView (NEW-More functions.)
#6

Sorry, but I've made a more-rational option...

pawn Код:
#include <a_samp>
// [FS] BirdView by Mach97 & irinel1996
new Float:mapX[MAX_PLAYERS], Float:mapY[MAX_PLAYERS], Float:mapZ[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/mapon", true, 6) == 0)
    {
        SetPVarInt(playerid, "MapStarted", 1);
        TogglePlayerControllable(playerid, 0);
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        mapX[playerid] = x; mapY[playerid] = y; mapZ[playerid] = z + 340.0;
        TogglePlayerControllable(playerid, 0);
        SetPlayerPos(playerid, mapX[playerid], mapY[playerid], -70.0);
        SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
        SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
        return 1;
    }
    if(strcmp(cmdtext, "/mapoff", true, 7) == 0)
    {
        SetPVarInt(playerid, "MapStarted", 0);
        TogglePlayerControllable(playerid, 1);
        SetCameraBehindPlayer(playerid);
        return 1;
    }
    return 0;
}
public OnPlayerUpdate(playerid)
{
    if(GetPVarInt(playerid, "MapStarted") == 1)
    {
        new o, ud, lr;
        GetPlayerKeys(playerid, o, ud, lr);

        if(ud > 0)
        {
            mapY[playerid] -= 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], -70.0);
        }
        else if(ud < 0)
        {
            mapY[playerid] += 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], -70.0);
            return 1;
        }
        if(lr > 0)
        {
            mapX[playerid] += 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], -70.0);
        }
        else if(lr < 0)
        {
            mapX[playerid] -= 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
            SetPlayerPos(playerid,mapX[playerid], mapY[playerid], -70.0);
            return 1;
        }
    }
    return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPVarInt(playerid, "MapStarted") == 1)
    {
        if(newkeys & KEY_SPRINT) // +
        {
            mapZ[playerid] += 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
        }
        else if(newkeys & KEY_CROUCH) // -
        {
            mapZ[playerid] -= 10.0;
            SetPlayerCameraPos(playerid, mapX[playerid], mapY[playerid], mapZ[playerid]);
            SetPlayerCameraLookAt(playerid, mapX[playerid], mapY[playerid], 0.0);
            return 1;
        }
    }
    return 1;
}
Howbeit, nice FS, I remember doing another camera view the player as a gta1-2, and your work will look great in an observatory (as in GTA United).
Reply


Messages In This Thread
[FS]BirdView (NEW-More functions.) - by [DOG]irinel1996 - 22.09.2011, 19:27
Re: [FS]BirdView (NEW-More functions.) - by FireCat - 22.09.2011, 19:29
Re : [FS]BirdView (NEW-More functions.) - by Naruto_Emilio - 22.09.2011, 19:31
Re: [FS]BirdView (NEW-More functions.) - by Issam - 22.09.2011, 19:43
Re: [FS]BirdView (NEW-More functions.) - by [DOG]irinel1996 - 22.09.2011, 19:48
Re: [FS]BirdView (NEW-More functions.) - by OKStyle - 23.09.2011, 02:47
Re: [FS]BirdView (NEW-More functions.) - by Ironboy - 23.09.2011, 07:13
Re: [FS]BirdView (NEW-More functions.) - by iPLEOMAX - 23.09.2011, 09:17
Re: [FS]BirdView (NEW-More functions.) - by Gamer_Z - 23.09.2011, 09:51
Re: [FS]BirdView (NEW-More functions.) - by Lorenc_ - 23.09.2011, 10:15
Re: [FS]BirdView (NEW-More functions.) - by _ELIX_ - 23.09.2011, 10:24
Re: [FS]BirdView (NEW-More functions.) - by IstuntmanI - 23.09.2011, 10:35
Re: [FS]BirdView (NEW-More functions.) - by [DOG]irinel1996 - 23.09.2011, 13:20
Re: [FS]BirdView (NEW-More functions.) - by davve95 - 23.09.2011, 13:26
Re: [FS]BirdView (NEW-More functions.) - by Gamer_Z - 23.09.2011, 20:29
Re : Re: [FS]BirdView (NEW-More functions.) - by Naruto_Emilio - 23.09.2011, 21:57
Re: [FS]BirdView (NEW-More functions.) - by [DOG]irinel1996 - 23.09.2011, 22:31
Re: Re : Re: [FS]BirdView (NEW-More functions.) - by Gamer_Z - 23.09.2011, 22:33
Re: [FS]BirdView (NEW-More functions.) - by [DOG]irinel1996 - 24.09.2011, 00:49
Re: [FS]BirdView (NEW-More functions.) - by OKStyle - 24.09.2011, 13:53
Re: [FS]BirdView (NEW-More functions.) - by SantarioLeone - 01.10.2011, 02:06
Re: [FS]BirdView (NEW-More functions.) - by V_LOPE - 01.10.2011, 03:20
Re : [FS]BirdView (NEW-More functions.) - by Varkoll_ - 01.10.2011, 07:43

Forum Jump:


Users browsing this thread: 5 Guest(s)