Advertisement
Guest User

Untitled

a guest
Mar 16th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. stock IsPlayerInZone(playerid, zone[]) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
  2. {
  3. new TmpZone[MAX_ZONE_NAME];
  4. GetPlayer3DZone(playerid, TmpZone, sizeof(TmpZone));
  5. for(new i = 0; i != sizeof(gSAZones); i++)
  6. {
  7. if(strfind(TmpZone, zone, true) != -1)
  8. return 1;
  9. }
  10. return 0;
  11. }
  12.  
  13. stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
  14. {
  15. new Float:x, Float:y, Float:z;
  16. GetPlayerPos(playerid, x, y, z);
  17. for(new i = 0; i != sizeof(gSAZones); i++ )
  18. {
  19. 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])
  20. {
  21. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  22. }
  23. }
  24. return 0;
  25. }
  26.  
  27. stock GetPlayer3DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
  28. {
  29. new Float:x, Float:y, Float:z;
  30. GetPlayerPos(playerid, x, y, z);
  31. for(new i = 0; i != sizeof(gSAZones); i++ )
  32. {
  33. 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])
  34. {
  35. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  36. }
  37. }
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement