PDA

View Full Version : No air veh's at spawn.


Snakekeeper
12/06/2013, 12:41 AM
Im very New to scripting pawn. and i would like to ask If its possible to make a FS that will Keep hydras/hunter/seasparrow out of spawn areas.

Ex: if i fly a hydra to spawn kill people in that area. It will bounce me out of the locations that i set.

Any help Will be good.

RALL0
12/06/2013, 12:46 AM
It would be easier to protect the players from spawn killing by using a timer, this can be useful for beginners: http://wiki.sa-mp.com/wiki/SetTimerEx

Snakekeeper
12/06/2013, 12:51 AM
I am trying to avoid anti spawn kill. Any other way that just effects ppl in air veh's like hydra and hunter?

RALL0
12/06/2013, 12:53 AM
Like I said already you can avoid spawn kill by just using 1 simple timer.

Snakekeeper
12/06/2013, 01:01 AM
Like I said already you can avoid spawn kill by just using 1 simple timer.

I am trying to avoid anti spawn kill.

People can kill ppl at the spawn just not with Hydras etc...

A timer to keep health from decreasing at spawn time doesn't help me there.

Ill just keep researching.

kaisersouse
12/06/2013, 01:04 AM
http://wiki.sa-mp.com/wiki/GangZoneCreate

I use GangZones to create "safe zones" at spawn. Can't use heavy weapons (RPG, minigun) within the zone, and can't enter w/ tank/hydra/hunter.

As soon as someone enters a safezone in a hydra/hunter....they just blow up haha

Slaykler
12/06/2013, 01:05 AM
When a player spawns do:

setplayerheath etc
settimerex 60000 < 1 minute

In the timer set the hp to what was in his file

Snakekeeper
12/06/2013, 01:05 AM
http://wiki.sa-mp.com/wiki/GangZoneCreate

I use GangZones to create "safe zones" at spawn. Can't use heavy weapons (RPG, minigun) within the zone, and can't enter w/ tank/hydra/hunter.

As soon as someone enters a safezone in a hydra/hunter....they just blow up haha

Perfect. Ty

Also. Like i said im new. I can make the zone with that link. But how do i add where hydra enters its blows up?

DaTa[X]
12/06/2013, 01:12 AM
if you are using gangzones you can use this stock function to see if the killer in zone with hydra or not

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
new Float:X, Float:Y, Float:Z;

GetPlayerPos(playerid, X, Y, Z);
if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
return 1;
}
return 0;
}

example

public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInArea(killerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY) && GetVehicleModel(GetPlayerVehicleID(killerid)) == 520)
{
//killer in hydra
}
return 1;
}

RALL0
12/06/2013, 01:14 AM
So you don't want people at the spawn to get killed, alright. I can give you an example how you can keep aircrafts away from the spawn base.


new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carid;
if(GetVehicleModel(carid) == //Plane ID
{
if(IsPlayerInRangeOfPoint(playerid, 40, x,y,z// coordinates of spawn));
{
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
SetPlayerFacingAngle(playerid, angle+180);
}
}
}


If the player in plane gets in reach of the spawn he automaticly turns 180 degrees

HurtLocker
12/06/2013, 01:18 AM
http://wiki.sa-mp.com/wiki/GangZoneCreate

I use GangZones to create "safe zones" at spawn. Can't use heavy weapons (RPG, minigun) within the zone, and can't enter w/ tank/hydra/hunter.

As soon as someone enters a safezone in a hydra/hunter....they just blow up haha
How do you detect if somebody entered the zone?