Will this anti-car jack work?.. Cant test it
#1

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (!ispassenger)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerInVehicle(i,vehicleid))
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                SetPlayerPos(playerid,X,Y,Z+5);
            }
        }
    }
    return 1;
}
If anybody can test it I'll be glad
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (!ispassenger)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerInVehicle(i,vehicleid) && i != playerid)
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                SetPlayerPos(playerid,X,Y,Z+5);
            }
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by [FeK]DraKiNs
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (!ispassenger)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerInVehicle(i,vehicleid) && i != playerid)
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                SetPlayerPos(playerid,X,Y,Z+5);
            }
        }
    }
    return 1;
}
Are you sure? :O
Reply
#4

Yes Work,but use
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (!ispassenger)
    {
        for(new i = 0; i < MAX_PLAYERS; ++i)
        {
            if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && i != playerid)
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                SetPlayerPos(playerid,X,Y,Z+2.2);
            }
        }
    }
    return true;
}
Reply
#5

Won't work if there is more than one car and driver.

Try this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (!ispassenger)
    {
        new Float:X, Float:Y, Float:Z;
        for(new i = 0; i < MAX_PLAYERS; ++i)
        {
            if(GetPlayerState(i) == PLAYER_STATE_DRIVER && i != playerid)
            {
                GetPlayerPos(playerid,X,Y,Z);
                if(IsPlayerInRangeOfPoint(playerid, 3, X, Y, Z))
                    SetPlayerPos(playerid,X,Y,Z+0.1);
            }
        }
    }
    return true;
}
Reply
#6

Will not work if the car is pushed...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)