SA-MP Forums Archive
[HELP] IsPlayerInRangeOfPoint Spamming - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] IsPlayerInRangeOfPoint Spamming (/showthread.php?tid=212302)



[HELP] IsPlayerInRangeOfPoint Spamming - Larsey123IsMe - 16.01.2011

How can i stop the spamming when i am in the area?
I get sammed this when i am nrear the area:

You entered the area!
You entered the area!
You entered the area!
You entered the area!
ect.. untill i leavethe area


pawn Код:
#include <a_samp>

forward Test();

public OnFilterScriptInit()
{
    SetTimer("Test", 1000, true);
    return 1;
}

public Test()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            SendClientMessage(i,0xFFFFFFFF,"You entered the area!");
            return 1;
        }
        return 1;
    }
    return 1;
}



Re: [HELP] IsPlayerInRangeOfPoint Spamming - [BEP]AcerPilot - 16.01.2011

pawn Код:
#include <a_samp>

new Send[MAX_PLAYERS] = 0;
forward Test();

public OnFilterScriptInit()
{
    SetTimer("Test", 1000, true);
    return 1;
}

public Test()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            if(Send[i] == 0)
            {
                SendClientMessage(i,0xFFFFFFFF,"You entered the area!");
                Send[i] = 1;
            }
        }
        else
        {
            Send[i] = 0;
        }
    }
    return 1;
}



Re: [HELP] IsPlayerInRangeOfPoint Spamming - Marricio - 16.01.2011

pawn Код:
#include <a_samp>

forward Test(playerid);
new EnteredArea[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Test", 1000, false);
    return 1;
}

public Test(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            if(EnteredArea[playerid] == 0)
            {
                SendClientMessage(i,0xFFFFFFFF,"You entered the area!");
                EnteredArea[playerid]= 1;
                return 1;
            }
        }
        else if(!IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            EnteredArea[playerid] = 0;
        }
        return 1;
    }
    return 1;
}
Not tested.


Re: [HELP] IsPlayerInRangeOfPoint Spamming - [BEP]AcerPilot - 16.01.2011

Quote:
Originally Posted by Marricio
Посмотреть сообщение
pawn Код:
#include <a_samp>

forward Test(playerid);
new EnteredArea[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Test", 1000, false);
    return 1;
}

public Test(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            if(EnteredArea[playerid] == 0)
            {
                SendClientMessage(i,0xFFFFFFFF,"You entered the area!");
                EnteredArea[playerid]= 1;
                return 1;
            }
        }
        else if(!IsPlayerInRangeOfPoint(i, 7.0, 2239.7747, 2430.8074, 3.2734))
        {
            EnteredArea[playerid] = 0;
        }
        return 1;
    }
    return 1;
}
Not tested.
You should use only else instead of else if(IsPlayer..


Re: [HELP] IsPlayerInRangeOfPoint Spamming - Larsey123IsMe - 16.01.2011

Thanks