// - Lock Casinos Filterscript by Rush -
// For more information and possible updates, visit: http://forum.sa-mp.com/
// Feel free to make modifications to this script, but please give credit where credit is due, and even better,
// inform me of your changes on SA-MP forum so they can be added to the 'official' version if they are good. (c) Yagu :P
#include <a_samp>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Lock Casinos FS by Rush");
print("--------------------------------------\n");
SetTimer("CheckIsPlayersInCasino",1000,1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
forward CheckIsPlayersInCasino();
forward IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy);
#define COLOR_BRIGHTRED 0xDC143CAA
public CheckIsPlayersInCasino()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && GetPlayerInterior(i)>0)
{
if (IsPlayerInArea(i,1983,2004,1002,1034))
{
SetPlayerPos(i,2006,1018,994.4688);
SetPlayerFacingAngle(i,270);
SendClientMessage(i,COLOR_BRIGHTRED,"The Four Dragons Casino is locked!");
}
else if (IsPlayerInArea(i,2220,2252,1638,1694))
{
SetPlayerPos(i,2236,1696,1008.3594);
SetPlayerFacingAngle(i,180);
SendClientMessage(i,COLOR_BRIGHTRED,"Caligula's Casino is locked!");
}
else if (IsPlayerInArea(i,1117,1143,-11,-2))
{
SetPlayerPos(i,1133,-11.5,1000.6797);
SetPlayerFacingAngle(i,180);
SendClientMessage(i,COLOR_BRIGHTRED,"Casino is locked!");
}
}
}
}
public IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}