Dm Zone immunity - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dm Zone immunity (
/showthread.php?tid=493862)
Dm Zone immunity -
Mahde - 10.02.2014
Hello , Im wondering , how to make the Spawn area , immunity for players from vehicles and weapons ? for example if vehicle come to spawn area just shoot it away and no one can attack in the plac
Re: Dm Zone immunity -
SwisherSweet - 10.02.2014
Well you can do this
IsPlayerInRangeOfPoint That will probably be the best thing to do.
Re: Dm Zone immunity -
Mahde - 10.02.2014
Quote:
Originally Posted by SwisherSweet
|
Thanks , so can i put like that , but i dont know how to push a player out of spawn zone
Код:
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);
}
}
Re: Dm Zone immunity -
SwisherSweet - 10.02.2014
Do you wanna push the player away or maybe a slap out of the vehicle?
If you wanna slap him out of the vehicle you can do this.
pawn Код:
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);
}
}
Re: Dm Zone immunity -
Mahde - 10.02.2014
Mmmmmm no no just reset weapons and puch his car out of range
Re: Dm Zone immunity -
SwisherSweet - 10.02.2014
Ok I have never done something like this so i don't know for sure, Tell me if it dosen't work...
pawn Код:
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);
}
}