Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock IsPlayerInZone(playerid, zone[]) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
- {
- new TmpZone[MAX_ZONE_NAME];
- GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
- for(new i = 0; i != sizeof(gSAZones); i++)
- {
- if(strfind(TmpZone, zone, true) != -1)
- return 1;
- }
- return 0;
- }
- stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++ )
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return 0;
- }
- stock GetPlayer3DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++ )
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement