Hospital System (isPlayerInArea Help)
#5

It's not working, because I'm guessing this is how you created the variables:

pawn Код:
new sf;
new lsas;
new lscg;
These variables are all set to 0. So, when the script is going through the first if statement in DeadCountdown(), the HospLocation[playerid] is always going to equal to zero, which is also equal to "sf". This is why the player always spawns in San Fierro.

Edit:
Try using this:
pawn Код:
#define sf      1
#define lsas    2
#define lscg    3

public isPlayerInArea(playerid) // If you want you change this to getPlayerArea so it could match the function more.
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X <= -2885.0598 && X >= -1405.0571 && Y <= -1021.6824 && Y >= 1436.9240) return sf;
    else if(X <= 130.7416 && X >= 1447.1925 && Y <= -2843.7100 && Y >= -799.4094) return lsas;
    else if(X <= 1700.8179 && X >= 2903.0476 && Y <= -2860.2761 && Y >= -701.8962) return lscg;
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    HospLocation[playerid] = isPlayerInArea(playerid);
    return 1;
}
Reply


Messages In This Thread
Hospital System (isPlayerInArea Help) - by Phil_Cutcliffe - 30.11.2013, 14:26
Re: Hospital System (isPlayerInArea Help) - by Ada32 - 30.11.2013, 14:40
Re: Hospital System (isPlayerInArea Help) - by Phil_Cutcliffe - 30.11.2013, 14:48
Re: Hospital System (isPlayerInArea Help) - by Phil_Cutcliffe - 30.11.2013, 15:56
Re: Hospital System (isPlayerInArea Help) - by JJB562 - 30.11.2013, 16:10
Re: Hospital System (isPlayerInArea Help) - by Phil_Cutcliffe - 30.11.2013, 20:47
Re: Hospital System (isPlayerInArea Help) - by Pottus - 30.11.2013, 21:06

Forum Jump:


Users browsing this thread: 4 Guest(s)