17.04.2013, 17:48
This is what you want:
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
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;
}