#1

under OnPlayerDeath
pawn Код:
if(pInfo[playerid][Team] == 2)
    {
        new Float:XZ;
        new Float:YZ;
        new Float:ZZ;
        GetPlayerPos(playerid, XZ, YZ, ZZ);
        {
            DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
        }
        GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
    }
then I need something like this on the timer
pawn Код:
if(IsPlayerInArea(i, XZ-20, XZ+20, YZ-20, YZ+20))//wont work, how should I do it ?
how will I put the coords ? That one won't work
Reply
#2

bump, plz help
Reply
#3

I think you have to use SetPVar

Example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:XZ;
    new Float:YZ;
    new Float:ZZ;
    GetPlayerPos(playerid, XZ, YZ, ZZ);
    {
        DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
        SetPVarFloat(playerid, "DeathAreaXZ_1", XZ-20);
        SetPVarFloat(playerid, "DeathAreaYZ_1", YZ-20);
        SetPVarFloat(playerid, "DeathAreaXZ_2", XZ+20);
        SetPVarFloat(playerid, "DeathAreaXZ_2", YZ+20);
    }
    GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
    return 1;
}
pawn Код:
if(IsPlayerInArea(i, GetPVarFloat(playerid, "DeathAreaXZ_1"), GetPVarFloat(playerid, "DeathAreaYZ_1"), GetPVarFloat(playerid, "DeathAreaXZ_2"), GetPVarFloat(playerid, "DeathAreaYZ_2"))
It it worth a try =/
Reply
#4

would that work if I'm checking if there's ANY player on the area ? like using foreach
and I tested it didn't work
Reply
#5

Errm.

pawn Код:
GetPlayerPos(playerid, XZ, YZ, ZZ);
{
}
Error der!

pawn Код:
if(pInfo[playerid][Team] == 2)
    {
        new Float:XZ;
        new Float:YZ;
        new Float:ZZ;
        GetPlayerPos(playerid, XZ, YZ, ZZ);
        DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
        GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
    }
Brackets aren't necessary
Reply
#6

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Errm.

pawn Код:
GetPlayerPos(playerid, XZ, YZ, ZZ);
{
}
Error der!

pawn Код:
if(pInfo[playerid][Team] == 2)
    {
        new Float:XZ;
        new Float:YZ;
        new Float:ZZ;
        GetPlayerPos(playerid, XZ, YZ, ZZ);
        DeathArea = GangZoneCreate(XZ-20, YZ-20, XZ+20, YZ+20);
        GangZoneShowForAll(DeathArea, VIRUS_ZONE_COLOR);
    }
Brackets aren't necessary
Oh ok, I'll remove them. but do u know how to use IsPlayerInArea with that
Reply
#7

What do you mean
Reply
#8

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
What do you mean
where a player dies it will create the gangzone (so far works) and then it will check if any other player get inside that gangzone, if it is in there he will lose health (I need a way to check if the player is in the gangzone)
Reply
#9

bump
Reply
#10

save all the pos

then make like

if( Pos[0] >= MINX && Pos[0] <= MAXX && Pos[1] >= MINY && Pos[1] <= MAXY )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)