IsPlayerInArea problem
#1

I've did a teleport, when you overtaking a certain point, behind you there is an explosion. But this don't work. What's wrong? Look my code
Код:
forward conto2(playerid);

public conto2()
{
new Float:X, Float:Y, Float:Z;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInArea(i,-552,-553,1992,1991)) //-552 minx, -553 maxX, 1992 miny, 1991 maxy
{
    GetPlayerPos(i,X, Y, Z);
    CreateExplosion(X, Y, Z, 12, 10.0);
    }
    }
return 1;
}

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:X, Float:Y, Float:Z;

    GetPlayerPos(playerid, X, Y, Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
        return 1;
    }
    return 0;
}
Wait your help
Important: On pawno there aren't any errors!
Reply
#2

it's because conto2() isn't called anywhere.

add this at OnGameModeInit ( for example )

pawn Код:
SetTimer("conto2", 1500, true);
and your remove "playerid" from the forward.
Reply
#3

pawn Код:
if(IsPlayerInArea(i,-552,-553,1992,1991)) //-552 minx, -553 maxX, 1992 miny, 1991 maxy
Cordinates should be like this:

EXEMPLE:
pawn Код:
3415.14 =X 256.14 = Z 13 = Y
Reply
#4

James Coral: I've tryed.....
Reply
#5

Now I've did this:
Under OnGameModeInit:
Код:
SetTimer("conto2", 2500, true);
And the forward is this:
Код:
forward conto2();

public conto2()
{
new Float:X, Float:Y, Float:Z;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInArea(i,-555.0,0106.0,-553.0,0100.0))
{
    GetPlayerPos(i,X, Y, Z);
    CreateExplosion(X, Y, Z-4, 10, 10.0); return SendClientMessage(i,0xFF0000AA, "Nice Jump!");
    }
    }
return 1;
}

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:X, Float:Y, Float:Z;

    GetPlayerPos(playerid, X, Y, Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
        return 1;
    }
    return 0;
}
Don't work...
Reply
#6

Anyone can help me please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)