|
Well you can do this IsPlayerInRangeOfPoint That will probably be the best thing to do.
|
if(IsPlayerInVehicle(playerid, vehid))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
{
GameTextForPlayer(playerid, "~R~Stay Away from Spawn Zone",3000, 3);
//What the code which push the player out of SpawnZone
ResetPlayerWeapons(playerid);
}
}
if(IsPlayerInVehicle(playerid, vehid))
{
new Float:PlayerPosition[3];
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
{
GameTextForPlayer(playerid, "~R~Stay Away from Spawn Zone",3000, 3);
GetPlayerPos(playerid, PlayerPosition[0], PlayerPosition[1], PlayerPosition[2]);
SetPlayerPos(playerid, PlayerPosition[0], PlayerPosition[1], PlayerPosition[2] + 5);
ResetPlayerWeapons(playerid);
}
}
if(IsPlayerInVehicle(playerid, vehid))
{
new Float:VehiclePosition[3];
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
{
GameTextForPlayer(playerid, "~R~Stay Away from Spawn Zone",3000, 3);
GetVehiclePos(playerid, VehiclePosition[0], VehiclePosition[1], VehiclePosition[2]);
SetVehiclePos(playerid, VehiclePosition[0], VehiclePosition[1] -5, VehiclePosition[2]);
ResetPlayerWeapons(playerid);
}
}