Spectating Vehicles
#4

Top of script
pawn Код:
new Shamaloff[MAX_PLAYERS];

New Shamal exit code
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

new InShamal[MAX_PLAYERS];

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new Float:X, Float:Y, Float:Z;
    if (PRESSED(KEY_SPRINT))
    {
        if(InShamal[playerid] == 0)
        {
          GetVehiclePos(Shamal, X, Y, Z);
          if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z))
          {
            InShamal[playerid] = 1;
                TogglePlayerSpectating(playerid, 1);
                PlayerSpectateVehicle(playerid, Shamal, 1);
            }
        }
        else if(InShamal[playerid] == 1)
        {
          Shamaloff[playerid] = 1;
          TogglePlayerSpectating(playerid, 0);
          InShamal[playerid] = 0;
        }
    }
    return 1;
}
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Shamaloff[playerid]==1)
    {
        Shamaloff[playerid] = 0;
        GetVehiclePos(Shamal, X, Y, Z);
        SetPlayerPos(playerid, X, Y+3, Z);
        return 1;

//Big problem you need to give them their skin and weapons back thats up to you...

    }
Thats about it I think and yes I know spec sucks :\

With love,
The Reymon.
Reply


Messages In This Thread
Spectating Vehicles - by V1ceC1ty - 06.10.2009, 13:37
Re: Spectating Vehicles - by oncedead - 06.10.2009, 15:45
Re: Spectating Vehicles - by V1ceC1ty - 06.10.2009, 16:02
Re: Spectating Vehicles - by oncedead - 06.10.2009, 16:15
Re: Spectating Vehicles - by V1ceC1ty - 06.10.2009, 16:21
Re: Spectating Vehicles - by oncedead - 06.10.2009, 16:24
Re: Spectating Vehicles - by V1ceC1ty - 06.10.2009, 16:27
Re: Spectating Vehicles - by oncedead - 06.10.2009, 16:31
Re: Spectating Vehicles - by oncedead - 06.10.2009, 16:39

Forum Jump:


Users browsing this thread: 1 Guest(s)