Gang Zone stops flashing after respawn,anyone? -
dusk - 07.02.2013
I want that after player is killed the gang zone would start to flash,it does. But after the killed player respawns it stops,how do i make it continue flashing?
Re: Gang Zone stops flashing after respawn -
Jstylezzz - 07.02.2013
Since you didn't show any code, I'm not sure how you did everything.
If you do something like the samp wiki said:
pawn Код:
new gangzone;
public OnGameModeInit()
{
gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
return 1;
}
public OnPlayerSpawn(playerid)
{
GangZoneFlashForPlayer(playerid,gangzone,COLOR_RED);
return 1;
}
It might work.
Check:
https://sampwiki.blast.hk/wiki/GangZoneFlashForPlayer
If this doesn't work, show some code, so we'll be able to help
Re: Gang Zone stops flashing after respawn -
dusk - 07.02.2013
That will just make it always flash,i want it to start after someones killed there.
OnGameModeInit
pawn Код:
Grove1 = GangZoneCreate(2343.640, -1732.445, 2642.237, -1613.464);
And OnPlayerDeath:
pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if((X < 2642.237) && (X > 2343.640) && (Y < -1613.464) && (Y > -1732.445))
{
SetTimer("laikas",60000,false);
GangZoneFlashForAll(Grove1,0xFF0000FF);
}
And i would appreciate if you told me how to find out if the player is in a zone,cuz its gonna suck when there is more zones in my way
Re: Gang Zone stops flashing after respawn -
Jstylezzz - 07.02.2013
If I was you, I would use IsPlayerInRangeOfPoint for that, just get the coords of the middle of the zone, and set the range to the max. range of the zone.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
It will be like:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
{
SetTimer("laikas",60000,false);
GangZoneFlashForAll(Grove1,0xFF0000FF);
}
under onplayerdeath, then do this for every zone..
Re: Gang Zone stops flashing after respawn -
dusk - 07.02.2013
Thanks for that!
And what about my flashing problem?
Re: Gang Zone stops flashing after respawn -
Jstylezzz - 07.02.2013
Well, I don't know if the code under onplayerdeath works, so I thought the way to go was with the IsPlayerInRangeOfPoint, so just replace that, and check if it works
Re: Gang Zone stops flashing after respawn -
dusk - 07.02.2013
Well,it works, but it only would apply to round zones.....
And the same problem is there...the player respawns-the flashing stops
Re: Gang Zone stops flashing after respawn -
dusk - 07.02.2013
Anyone else can help me?
Sorry about double post.
Re: Gang Zone stops flashing after respawn -
dusk - 07.02.2013
My problem is that after the player respawns my gangzones STOP flashing...Can anyone please help me?
Re: Gang Zone stops flashing after respawn -
dusk - 08.02.2013
bump