13.01.2012, 23:11
is this what your talking about?
stock GetPlayer2DZone(playerid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetPlayerPos(playerid, x22, y22, z22);
for(new i = 0; i != sizeof(gSANZones); i++ )
{
if(x22 >= gSANZones[i][SAZONE_AREA][0] && x22 <= gSANZones[i][SAZONE_AREA][3] && y22 >= gSANZones[i][SAZONE_AREA][1] && y22 <= gSANZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSANZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetPlayer2DRadarZone(playerid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetPlayerPos(playerid, x22, y22, z22);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x22 >= gSAZones[i][SAZONE_AREA][0] && x22 <= gSAZones[i][SAZONE_AREA][3] && y22 >= gSAZones[i][SAZONE_AREA][1] && y22 <= gSAZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetVehicle2DZone(vehicleid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetVehiclePos(vehicleid, x22, y22, z22);
for(new i = 0; i != sizeof(gSANZones); i++ )
{
if(x22 >= gSANZones[i][SAZONE_AREA][0] && x22 <= gSANZones[i][SAZONE_AREA][3] && y22 >= gSANZones[i][SAZONE_AREA][1] && y22 <= gSANZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSANZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetPlayer3DZone(playerid, zone[], len)
{
new Float33, Float:y33, Float:z33;
GetPlayerPos(playerid, x33, y33, z33);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x33 >= gSAZones[i][SANZONE_AREA][0] && x33 <= gSAZones[i][SANZONE_AREA][3] && y33 >= gSANZones[i][SAZONE_AREA][1] && y33 <= gSANZones[i][SAZONE_AREA][4] && z33 >= gSAZones[i][SANZONE_AREA][2] && z33 <= gSANZones[i][SAZONE_AREA][5])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock IsPlayerInZone(playerid, zone[])
{
new TmpZone[MAX_ZONE_NAME];
GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
for(new i = 0; i != sizeof(gSANZones); i++)
{
if(strfind(TmpZone, zone, true) != -1)
return 1;
}
return 0;
}
stock GetPlayer2DZone(playerid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetPlayerPos(playerid, x22, y22, z22);
for(new i = 0; i != sizeof(gSANZones); i++ )
{
if(x22 >= gSANZones[i][SAZONE_AREA][0] && x22 <= gSANZones[i][SAZONE_AREA][3] && y22 >= gSANZones[i][SAZONE_AREA][1] && y22 <= gSANZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSANZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetPlayer2DRadarZone(playerid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetPlayerPos(playerid, x22, y22, z22);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x22 >= gSAZones[i][SAZONE_AREA][0] && x22 <= gSAZones[i][SAZONE_AREA][3] && y22 >= gSAZones[i][SAZONE_AREA][1] && y22 <= gSAZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetVehicle2DZone(vehicleid, zone[], len)
{
new Float22, Float:y22, Float:z22;
GetVehiclePos(vehicleid, x22, y22, z22);
for(new i = 0; i != sizeof(gSANZones); i++ )
{
if(x22 >= gSANZones[i][SAZONE_AREA][0] && x22 <= gSANZones[i][SAZONE_AREA][3] && y22 >= gSANZones[i][SAZONE_AREA][1] && y22 <= gSANZones[i][SAZONE_AREA][4])
{
return format(zone, len, gSANZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock GetPlayer3DZone(playerid, zone[], len)
{
new Float33, Float:y33, Float:z33;
GetPlayerPos(playerid, x33, y33, z33);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x33 >= gSAZones[i][SANZONE_AREA][0] && x33 <= gSAZones[i][SANZONE_AREA][3] && y33 >= gSANZones[i][SAZONE_AREA][1] && y33 <= gSANZones[i][SAZONE_AREA][4] && z33 >= gSAZones[i][SANZONE_AREA][2] && z33 <= gSANZones[i][SAZONE_AREA][5])
{
return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
}
}
return 0;
}
stock IsPlayerInZone(playerid, zone[])
{
new TmpZone[MAX_ZONE_NAME];
GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
for(new i = 0; i != sizeof(gSANZones); i++)
{
if(strfind(TmpZone, zone, true) != -1)
return 1;
}
return 0;
}