13.03.2009, 19:07
ok i created a gangzone. It's for police. I want if a player who is not TEAM_COP enters the zone, to decrease health until he leaves (trespassing). There is no function or callback where i do this. How would i check
public IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if( x > xmin && y > ymin && z > zmin && x < xmax && y < ymax && z < zmax) return 1;
return 0;
}
public IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if( x > -1699.399 && y > 649.2913 && z > zmin && x < -1575.793 && y < 743.9704 && z < zmax) { GameTextForPlayer(playerid,"YOU ARE TRESSPASSING",5000,5); } return 1; }
Originally Posted by cj101
Код:
public IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if( x > -1699.399 && y > 649.2913 && z > zmin && x < -1575.793 && y < 743.9704 && z < zmax) { GameTextForPlayer(playerid,"YOU ARE TRESSPASSING",5000,5); } return 1; } |
public IsInZone()
{
for(new i; i<PLAYERS_MAX; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax)//Replace with your own coords
{
//he is so do something here
}
}
}
}