Help IsPlayerInRangeOffThePoint -
kalanerik99 - 17.04.2013
Hi!
Can someone tell me how to make that if player is in is rengeoffthepoint vith car it will throw him away.
Please Help
Re: Help IsPlayerInRangeOffThePoint -
Sithis - 17.04.2013
What exactly do you mean by throw away?
Re: Help IsPlayerInRangeOffThePoint -
Jack_Ryder - 17.04.2013
What do you mean??
Re: Help IsPlayerInRangeOffThePoint -
TomatoRage - 17.04.2013
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,rang,Float:x,y,z))
{
RemovePlayerFromVehicle(playerid);
return 1;
}
Re: Help IsPlayerInRangeOffThePoint -
BlackID - 17.04.2013
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.
Re: Help IsPlayerInRangeOffThePoint -
kalanerik99 - 17.04.2013
I dont want that it will remove player from vehicle I want that it will throw vehicle away from the point!
Re: Help IsPlayerInRangeOffThePoint -
TomatoRage - 17.04.2013
What do you mean ??
I don't understand what do you want
Re: Help IsPlayerInRangeOffThePoint -
HurtLocker - 17.04.2013
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
Re: Help IsPlayerInRangeOffThePoint -
kalanerik99 - 17.04.2013
I want that if player will be in this coordiats with car
1925.8215,-2248.3164,16.4398
it will throw car away
Re: Help IsPlayerInRangeOffThePoint -
HurtLocker - 17.04.2013
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.