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; }
forward IPIA(playerid);
public IPIA(playerid)
{
if(IsPlayerInArea(playerid, -3629.523925, -4407.841308, 1020.867858, -193.529113) && IsPlayerAdmin(playerid) == 1)
{
GameTextForPlayer(playerid, "~g~Welcome to the Island", 5000, 1);
}
else GameTextForPlayer(playerid, "~r~You are not permitted to enter this island", 5000, 1); SetPlayerHealth(playerid, 0.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;
}
SetTimer("IPIA", 1000, true);
Originally Posted by Revenation
Okay, that worked as in I die now, but the problem now is I die everywhere in SA XDD.. Also when im rcon logged in I still get the message and get killed. :P
|
forward IPIA(playerid);
public IPIA(playerid)
{
if(IsPlayerInArea(playerid, -3629.523925, -4407.841308, 1020.867858, -193.529113) && IsPlayerAdmin(playerid))
{
GameTextForPlayer(playerid, "~g~Welcome to the Island", 5000, 1);
}
else GameTextForPlayer(playerid, "~r~You are not permitted to enter this island", 5000, 1); SetPlayerHealth(playerid, 0.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;
}
Originally Posted by Revenation
Aww man, I thought it all worked, but it does except it only works on ID 0! I got my friend to join and it doesnt do anything for ID 1, it only affects ID 0. :S, Whats up with that?
|