14.03.2010, 19:57
Okay well, I have mapped my own island in the sea and everything and I would like it so that you die when you go on it if you aren't an RCON Admin, This is the code I am trying to use.
It compiles fine and everything, no errors or warnings, but when I go ingame and go to my island, it doesnt do anything, as in I dont die or get any text and I am pretty sure the co-ords are right, I used seif's co-ords maker.
Код:
forward IPIA(playerid);
public IPIA(playerid)
{
if(IsPlayerInArea(playerid, -3629.523925, -4407.841308, 1020.867858, -193.529113))
{
if(IsPlayerAdmin(playerid) == 1)
{
GameTextForPlayer(playerid, "~g~Welcome to the Island", 500, 1);
}
else
{
GameTextForPlayer(playerid, "~r~You are not permitted to enter this island", 1000, 1);
SetPlayerHealth(playerid, 0);
}
}
}
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
return 0;
}

