Guest User

Untitled

a guest
Sep 8th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_OBJETOS 59 // Objetos no sv + 1
  4. forward PertoDeObjeto(objetoid);
  5. forward CoordenadasObjetos();
  6. enum objinfo
  7. {
  8. Float:obX,
  9. Float:obY,
  10. Float:obZ,
  11. };
  12. new ObjectInfo[MAX_OBJETOS][objinfo];
  13. public PertoDeObjeto(objetoid)
  14. {
  15. for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
  16. {
  17. if(PlayerToPoint(2.0,playerid,ObjectInfo[objetoid][obX],ObjectInfo[objetoid][obY],ObjectInfo[objetoid][obZ])
  18. {
  19. if(objetoid==1)
  20. {
  21. // Função se ele tiver perto do objeto numero 1 (começe a contar de zero ok não de 1)
  22. }
  23. else if(objetoid==2)
  24. {
  25. // Mesma coisa do de cima e assim por diante ^^
  26. }
  27. }
  28. }
  29. return 1;
  30. }
  31. public CoordenadasObjetos()
  32. {
  33. for(new x=0;x<sizeof(ObjectInfo);x++)
  34. {
  35. new Float:obXX,Float:obYY,Float:obZZ;
  36. GetObjectPos(x,obXX,obYY,obZZ);
  37. ObjectInfo[x][obX] = obXX;
  38. ObjectInfo[x][obY] = obYY;
  39. ObjectInfo[x][obZ] = obZZ;
  40. }
  41. }
  42. public OnPlayerConnect(playerid)
  43. {
  44. SetTimerEx("PertoDeObjeto",4000,1,"i",playerid);
  45. }
  46. public OnFilterScriptInit()
  47. {
  48. CoordenadasObjetos();
  49. }
Advertisement
Add Comment
Please, Sign In to add comment