Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_OBJETOS 59 // Objetos no sv + 1
- forward PertoDeObjeto(objetoid);
- forward CoordenadasObjetos();
- enum objinfo
- {
- Float:obX,
- Float:obY,
- Float:obZ,
- };
- new ObjectInfo[MAX_OBJETOS][objinfo];
- public PertoDeObjeto(objetoid)
- {
- for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
- {
- if(PlayerToPoint(2.0,playerid,ObjectInfo[objetoid][obX],ObjectInfo[objetoid][obY],ObjectInfo[objetoid][obZ])
- {
- if(objetoid==1)
- {
- // Função se ele tiver perto do objeto numero 1 (começe a contar de zero ok não de 1)
- }
- else if(objetoid==2)
- {
- // Mesma coisa do de cima e assim por diante ^^
- }
- }
- }
- return 1;
- }
- public CoordenadasObjetos()
- {
- for(new x=0;x<sizeof(ObjectInfo);x++)
- {
- new Float:obXX,Float:obYY,Float:obZZ;
- GetObjectPos(x,obXX,obYY,obZZ);
- ObjectInfo[x][obX] = obXX;
- ObjectInfo[x][obY] = obYY;
- ObjectInfo[x][obZ] = obZZ;
- }
- }
- public OnPlayerConnect(playerid)
- {
- SetTimerEx("PertoDeObjeto",4000,1,"i",playerid);
- }
- public OnFilterScriptInit()
- {
- CoordenadasObjetos();
- }
Advertisement
Add Comment
Please, Sign In to add comment