Gang Zone stops flashing after respawn
#1

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?
Reply
#2

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
Reply
#3

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
Reply
#4

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..
Reply
#5

Thanks for that!

And what about my flashing problem?
Reply
#6

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
Reply
#7

Well,it works, but it only would apply to round zones.....

And the same problem is there...the player respawns-the flashing stops
Reply
#8

Anyone else can help me?

Sorry about double post.
Reply
#9

My problem is that after the player respawns my gangzones STOP flashing...Can anyone please help me?
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)