Help IsPlayerInRangeOffThePoint
#1

Hi!

Can someone tell me how to make that if player is in is rengeoffthepoint vith car it will throw him away.

Please Help
Reply
#2

What exactly do you mean by throw away?
Reply
#3

What do you mean??
Reply
#4

pawn Код:
if(IsPlayerInRangeOfPoint(playerid,rang,Float:x,y,z))
{
    RemovePlayerFromVehicle(playerid);
    return 1;
}
Reply
#5

Quote:
Originally Posted by TomatoRage
Посмотреть сообщение
Код:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,rang,Float:x,y,z)){    RemovePlayerFromVehicle(playerid);    return 1;}
Dude, why do you use [pawn] inside [code] that's not needed.
Reply
#6

I dont want that it will remove player from vehicle I want that it will throw vehicle away from the point!
Reply
#7

What do you mean ??
I don't understand what do you want
Reply
#8

This is what you want:
pawn Код:
forward AreaChecker(playerid);

new Pveh[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    SetTimer("AreaChecker", 200, 1);
    return 1;
}

public AreaChecker()
{
    new Float: X, Float:Y, Float:Z, Float:Velocity[3];
    GetPlayerPos(playerid, X, Y, Z);
    for(new i=0; i<MAX_PLAYERS; i++)
       {
              if(IsPlayerConnected(i))
              {
            if (X > xmin && Y > ymin && X < xmax && Y < ymax)
            {
                if (IsPlayerInAnyVehicle(playerid))
                {
                Pveh = GetPlayerVehicleID(playerid);
                GetVehicleVelocity(Pveh, Velocity[0], Velocity[1], Velocity[2]);
                SetVehicleVelocity(Pveh, -Velocity[0], -Velocity[1], Velocity[2]);
                }
            }
        }
    }
    return 1;
}
BUT if the player goes with small speed, he won't be launched. I wil work some more on it and perhaps make it perfect in some minutes
Reply
#9

I want that if player will be in this coordiats with car 1925.8215,-2248.3164,16.4398
it will throw car away
Reply
#10

So, replace my xmin, ymin, xmax, ymax variables, with your values. But I need time to make it that a player gets launched even if he goes with low speed and i don't have that time.

EDIT: You do something wrong. An area is defined by 4 numbers; not 3 as you mention... go check how creategangzone works. This is the same thing.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)