First I suggest using an enum, so add this to the begin of your script.
pawn Код:
enum pInfo
{
pLvl
}
new PlayerInfo[playerid][pInfo];
The pLvl is where you're going to store your score.
You're going to use this format to check the level "PlayerInfo[playerid][pLvl]"
Now you will need to make the pLvl up-to-date, so put this to your OnPlayerUpdate
pawn Код:
if(GetPlayerScore(playerid) != PlayerInfo[playerid][pLvl])
{
PlayerInfo[playerid][pLvl] = GetPlayerScore(playerid);
}
This will basically check on every "OnPlayerUpdate" if your PlayerInfo[playerid][pLvl]" is your current score, if it is then nothing will happen, else it will set your "PlayerInfo[playerid][pLvl]" to your current score.
Now the code you posted should be like this.
pawn Код:
if(IsPlayerInArea(playerid,x,y,z)) {
if(PlayerInfo[playerid][pLvl] <= 9) {
return SetPlayerHealth(playerid, 0.0);
}
else
{
}
return 1;
}