new Float:CellCoords[MAX_CELLS][6] = {
{212.5313,106.9000,998.0156,218.5313,112.9000,1005.0156},
{216.5279,106.9000,998.0156,222.5279,112.9000,1005.0156},
{220.5461,106.9000,998.0156,226.5461,112.9000,1005.0156},
{224.4537,106.9000,998.0156,230.4537,112.9000,1005.0156},
{195.1000,159.0693,1002.0300,201.1000,165.0693,1009.0300},
{190.8782,171.9000,1002.0234,196.8782,177.9000,1009.0234},
{195.1000,171.9000,1002.0234,201.1000,177.9000,1009.0234}
};
public IsPlayerOutCellArea(playerid, Float:data[6])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X >= data[0] && X <= data[3] && Y >= data[1] && Y <= data[4] && Z >= data[2] && Z <= data[5])
{
return 1;
}
return 0;
}
public CheckPlayerLogged()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
for (new j = 0; j < MAX_CELLS; j++)
{
if (!IsPlayerOutCellArea(i, CellCoords[j]))
{
if (Logged[i] != 1 && Spawned[i] == 1)
{
SetPlayerCellSpawn(i);
GameTextForPlayer(i, "~g~You must login to play in this server!~n~~w~Type: /register (password)~n~~n~~y~Already registered?~n~~w~Type: /login (password)", 15000,3);
SendClientMessage(i, COLOR_WHITE, "Login! /register [password] to register an account, /login [password] to login to that account!");
}
if (Logged[i] == 1)
{
}
}
}
}
}
return 1;
}