SA-MP Forums Archive
IsPlayerInArea Problem - 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: IsPlayerInArea Problem (/showthread.php?tid=78992)



IsPlayerInArea Problem - JoeDaDude - 24.05.2009

Ok well this is my first try at IsPlayerInArea
I have the include file so i dont get the include problem
But i do get this....
Код:
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 213: tag mismatch
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
And here is my script
pawn Код:
IsPlayerInArea(playerid, 2356.912, -2700.379, 2832.266, -2356.926);
        SendClientMessage(playerid, COLOR_WHITE, "Test Positive");
What am i doing wrong?


Re: IsPlayerInArea Problem - miokie - 24.05.2009

Quote:
Originally Posted by JoeDaDude
Ok well this is my first try at IsPlayerInArea
I have the include file so i dont get the include problem
But i do get this....
Код:
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 213: tag mismatch
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Joe\Desktop\Server\gamemodes\sftdm.pwn(881) : warning 202: number of arguments does not match definition
And here is my script
pawn Код:
IsPlayerInArea(playerid, 2356.912, -2700.379, 2832.266, -2356.926);
        SendClientMessage(playerid, COLOR_WHITE, "Test Positive");

What am i doing wrong?
Im not sure but i might be:
pawn Код:
if(IsPlayerInArea(playerid, 2356.912, -2700.379, 2832.266, -2356.926))
{
    SendClientMessage(playerid, COLOR_WHITE, "Test Positive");
}
Or something...


Re: IsPlayerInArea Problem - JoeDaDude - 24.05.2009

Im still recieving the same errors


Re: IsPlayerInArea Problem - Lorrden - 24.05.2009

try to remove the last coord...
no rotation should be needed ?


Re: IsPlayerInArea Problem - JoeDaDude - 24.05.2009

Its not a rotation,
Its a MinimumX, MinimumZ, MaximumX, MaximumZ


Re: IsPlayerInArea Problem - Nero_3D - 24.05.2009

I think the best is if you show the code from the IsPlayerInArea include


Re: IsPlayerInArea Problem - JoeDaDude - 24.05.2009

pawn Код:
stock IsPlayerInAreaEx(playerid, Float:...) //By kool
{
    new Count = numargs();
    new Float:xe[255], Float:ye[255];
    new j=0;
    for(new i=1; i<Count; i+=2)
    {
        xe[j] = Float:getarg(i);
        ye[j] = Float:getarg(i+1);
        j++;
    }
    xe[j] = xe[0];
    ye[j] = ye[0];
    new Lines;
    new Float:xcut;
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=0; i<j; i++)
    {
        xcut = xe[i]+((y-ye[i])*(xe[i+1]-xe[i])/(ye[i+1]-ye[i]));
        if(((y >= ye[i] && y <= ye[i+1]) || (y >= ye[i+1] && y <= ye[i])) && xcut < x)
        {
            Lines++;
        }
    }
    if(Lines%2 == 1)
    {
        return 1;
    }
    return 0;
}



Re: IsPlayerInArea Problem - JoeDaDude - 24.05.2009

Any Help Will Be Much Appreciated,

EDIT: Sorry for double post


Re: IsPlayerInArea Problem - Nero_3D - 24.05.2009

That code is rly hard to understand

I suggest to use a normal one


Re: IsPlayerInArea Problem - JoeDaDude - 24.05.2009

What would you have for example,
I need something so a certain command will only work if the player is at ls docks,
if there outside that area then it wont work