Basado en mi server del samp
 
ÍndiceCalendarioFAQBuscarMiembrosGrupos de UsuariosRegistrarseConectarse

Comparte | 
 

 [Tutorial]xObjects

Ir abajo 
AutorMensaje
Admin
Admin
avatar

Cantidad de envíos : 7
Fecha de inscripción : 11/08/2009

MensajeTema: [Tutorial]xObjects   Mar Ago 11, 2009 3:03 am

weno como los createobject ke iso mi buen amigo jony son una mugre porke resisten poko en fs y gm oy les dire el nuevo avanze aunke no es muy nuevo ya ke ay otros como los YSI

prosigamos.

Informacion:

Los xObject son un tipo de objetos similares a los createobject solo ke reisiten mas objetos(700) mas omenos por 2 fs son 700 aunke yo tengo en mi server unos 2000

weno aki viene el tuto:

Tengan con mucho cuidado:

como primero deberan ir a la pagina paratransformar el mapa aki les dejo un link

http://gtamap.delux-host.com/converter/old/

Bueno les dire primero les saldra el primer numero en grande ke dice 1. y sale para exainar lo ke kieres transformar, ay buscan el mapa.

Despues les saldra el numero 2 en grande al lado del 1 y saldra el formato ke kieren ustedes pondran para no tener tanta crash el xObject streamer y lo marcan.

Despues van donde dice en grande COVERT MAP >>

y pulsan ay.

Despues les saldra algo como esto

Success: Your map has been converted

Your Nº de objects in your script have been successfully converted into your target format. This was the 226365. map convertion since we launched this service.

y mas abajo les aldra un cuadro con cordenadas.

Buenoasta ay vamos perfecto.

despues de eso deberan crear un filter script abren un pawn ponen new y boran todo ke no kede nada!

y pegan este codigo:

#include <a_samp>

forward Timer();

forward SetPlayerPosWithObjects(playerid,Float:x,Float:y,Float:z);

/*

SetPlayerPosWithObjects usage in your gamemode:

CallRemoteFunction("SetPlayerPosWithObjects","ifff",playerid,newx,newy,newz);

*/

//------------------------------------------------------------------------------

enum object_info

{

modelid,

Float:ox,

Float:oy,

Float:oz,

Float:orx,

Float:ory,

Float:orz,

Float:viewdist

}

new Objects[][object_info] ={

exactamente igual.

debajo de new objects [][object_info] ={

pegan las corenadas ke transformaron en el covertidor de mapas. ej:

#include <a_samp>

forward Timer();

forward SetPlayerPosWithObjects(playerid,Float:x,Float:y,Float:z);

/*

SetPlayerPosWithObjects usage in your gamemode:

CallRemoteFunction("SetPlayerPosWithObjects","ifff",playerid,newx,newy,newz);

*/

//------------------------------------------------------------------------------

enum object_info

{

modelid,

Float:ox,

Float:oy,

Float:oz,

Float:orx,

Float:ory,

Float:orz,

Float:viewdist

}

{13666, -1079.9722, 396.3270, 17.0037, 0.0000, 0.0000, 56.2500, 500.0},

{13666, -1077.7345, 398.8462, 17.0038, 0.0000, 0.0000, 61.4066, 500.0},

{13666, -1075.9930, 401.5083, 17.1038, 0.0000, 0.0000, 69.1415, 500.0},

{13666, -1074.6260, 404.2614, 17.2038, 0.0000, 0.0000, 75.1576, 500.0},

{13666, -1073.9802, 406.5585, 17.2037, 0.0000, 0.0000, 84.6114, 500.0},

{13666, -1073.4932, 409.6138, 17.1787, 0.0000, 0.0000, 90.6274, 500.0},

{13666, -1073.4728, 412.1247, 17.2787, 0.0000, 0.0000, 100.9407, 500.0},

{13666, -1074.0962, 414.3818, 17.3287, 0.0000, 0.0000, 116.4105, 500.0},

{13666, -1075.3192, 416.9075, 17.3558, 0.0000, 0.0000, 126.7238, 500.0},

{13666, -1076.8693, 419.3053, 17.3717, 0.0000, 0.0000, 136.1777, 500.0},

{13666, -1078.6251, 420.8204, 17.4722, 0.0000, 0.0000, 149.9288, 500.0},

{13666, -1080.7491, 421.9958, 17.5287, 0.0000, 0.0000, 160.2421, 500.0},

{13666, -1083.3640, 422.9121, 17.5037, 0.0000, 0.0000, 171.4149, 500.0},

{13666, -1086.1615, 423.4400, 17.5537, 0.0000, 0.0000, 180.8687, 500.0},

{13666, -1088.9430, 423.4621, 17.6037, 0.0000, 0.0000, 191.1820, 500.0},

{13666, -1091.6954, 423.0124, 17.6464, 0.0000, 0.0000, 199.7765, 500.0},

{13666, -1094.3527, 422.0631, 17.7214, 0.0000, 0.0000, 209.2303, 500.0},

{13666, -1096.6957, 420.7365, 17.6787, 0.0000, 0.0000, 221.2625, 500.0},

{13666, -1098.7085, 419.0978, 17.6537, 0.0000, 0.0000, 230.7164, 500.0},

{13666, -1100.6625, 417.1544, 17.6948, 0.0000, 0.0000, 235.8730, 500.0},

{1676, -1078.8397, 398.2398, 14.7293, 0.0000, 0.0000, 315.0000, 500.0},

{1676, -1074.9580, 404.6232, 14.7293, 0.0000, 0.0000, 337.5000, 500.0},

{1676, -1074.3486, 414.9119, 14.7293, 0.0000, 0.0000, 22.5000, 500.0},

{1676, -1078.9309, 421.1964, 14.7293, 0.0000, 0.0000, 67.5000, 500.0},

{1676, -1086.2004, 423.5287, 14.7293, 0.0000, 0.0000, 78.7500, 500.0},

{1676, -1093.6692, 422.3031, 14.7220, 0.0000, 0.0000, 112.5000, 500.0},

{6987, -1207.2773, 165.0479, -6.3660, 0.0000, 0.0000, 135.0000, 500.0},

{1655, -1206.2905, 158.7231, 14.1486, 0.0000, 0.0000, 225.0000, 500.0},

{1655, -1201.1356, 153.5439, 18.3557, 14.6104, 0.0000, 225.0000, 500.0},

{1655, -1196.8660, 149.5854, 24.5381, 33.5180, 0.0000, 225.0000, 500.0},

{1655, -1194.0497, 146.7000, 32.2994, 46.4095, 0.0000, 225.0000, 500.0},

{1655, -1192.8259, 145.6331, 39.6249, 62.7388, 0.0000, 225.0000, 500.0},

{13666, -1317.5011, 125.2406, 17.1022, 0.0000, 0.0000, 326.2500, 500.0},

{13666, -1315.4054, 123.5429, 17.3522, 0.0000, 348.8273, 326.2500, 500.0},

{13666, -1313.1489, 121.6120, 17.7772, 0.0000, 338.5141, 326.2500, 500.0},

{13666, -1310.6609, 119.6306, 18.6276, 0.0000, 328.2008, 326.2500, 500.0},

{13666, -1308.7405, 117.8040, 20.2167, 0.0000, 323.0442, 326.2500, 500.0},

{13666, -1306.7151, 115.7853, 21.9734, 0.0000, 317.0282, 326.2500, 500.0},

{13666, -1305.2150, 114.3382, 23.8044, 0.0000, 312.7310, 326.2500, 500.0},

{3374, -1302.0343, 110.4844, 23.5415, 0.0000, 0.0000, 0.0000, 500.0},

{3374, -1305.8929, 108.9931, 23.2650, 0.0000, 0.0000, 0.0000, 500.0},

{3374, -1300.4520, 114.0433, 24.1122, 0.0000, 0.0000, 0.0000, 500.0},

{1655, -1093.2240, 412.7702, 14.1736, 0.0000, 0.0000, 315.0000, 500.0},

{1655, -1084.0872, 403.6271, 14.1736, 0.0000, 0.0000, 315.0000, 500.0},

{1655, -1088.4202, 407.9584, 14.1736, 0.0000, 0.0000, 315.0000, 500.0},

{1655, -1090.3209, 417.6151, 17.7929, 21.4859, 0.0000, 315.0000, 500.0},

{1655, -1084.7098, 411.9641, 17.7736, 21.4859, 0.0000, 315.0000, 500.0},

{1655, -1081.0730, 408.2981, 17.7546, 21.4859, 0.0000, 315.0000, 500.0},

{13641, -1079.6851, 417.2841, 23.7602, 0.8594, 342.8113, 45.0000, 500.0},

{1683, -1422.6859, 16.6466, 19.0511, 0.0000, 0.0000, 45.0000, 500.0},

{1634, -1457.9138, -15.1729, 14.5942, 0.0000, 0.0000, 315.0000, 500.0},

{1634, -1455.1155, -17.9811, 14.5942, 0.0000, 0.0000, 315.0000, 500.0},

{1634, -1452.1923, -20.9232, 14.5942, 0.0000, 0.0000, 315.0000, 500.0},

{1634, -1393.4069, 39.2955, 14.5942, 0.0000, 0.0000, 135.0000, 500.0},

{1634, -1396.2891, 42.1977, 14.5942, 0.0000, 0.0000, 135.0000, 500.0},

{1634, -1399.1876, 45.0944, 14.5942, 0.0000, 0.0000, 135.0000, 500.0} <----- aki ni va coma solo en el ""ULTIMO"" DEL PAWN NO VA COMA SOLO LA ULTIMA CORDENADA VA SIN COMA.

y al final agregan este codigo

};

enum player_info

{

objid[sizeof(Objects)],

bool:view[sizeof(Objects)]

}

new Player[MAX_PLAYERS][player_info];

//------------------------------------------------------------------------------

bool:IsInReach(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,Float:dist)

{

x = (x > x2) ? x - x2 : x2 - x;

if(x > dist) return false;

y = (y > y2) ? y - y2 : y2 - y;

if(y > dist) return false;

z = (z > z2) ? z - z2 : z2 - z;

if(z > dist) return false;

return true;

}

//------------------------------------------------------------------------------

new timer;

public OnFilterScriptInit()

{

print(" Loaded successful.");

timer = SetTimer("Timer",1000,1);

return 1;

}

public OnFilterScriptExit()

{

for(new i = 0; i < MAX_PLAYERS; i++)

{

for(new o = 0; o < sizeof(Objects); o++)

{

if(Player[view][o])

{

Player[view][o] = false;

DestroyPlayerObject(i,Player[objid][o]);

}

}

}

KillTimer(timer);

}

//------------------------------------------------------------------------------

public OnPlayerConnect(playerid)

{

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view] = false;

}

public OnPlayerDisconnect(playerid)

{

for(new i = 0; i < sizeof(Objects); i++)

{

if(Player[playerid][view])

{

Player[playerid][view] = false;

DestroyPlayerObject(playerid,Player[playerid][objid]);

}

}

}

//------------------------------------------------------------------------------

public Timer()

{

for(new i = 0; i < MAX_PLAYERS; i++)

if(IsPlayerConnected(i))

PlayerObjectUpdate(i);

}

PlayerObjectUpdate(playerid)

{

new Float:pos[3];

GetPlayerPos(playerid,pos[0],pos[1],pos[2]);

for(new i = 0; i < sizeof(Objects); i++)

{

if(!Player[playerid][view])

{

if(IsInReach(pos[0],pos[1],pos[2],Objects[ox],Objects[oy],Objects[oz],Objects[viewdist]))

{

Player[playerid][view] = true;

Player[playerid][objid] = CreatePlayerObject(playerid,Objects[modelid],Objects[ox],Objects[oy],Objects[oz],Objects[orx],Objects[ory],Objects[orz]);

}

} else if(!IsInReach(pos[0],pos[1],pos[2],Objects[ox],Objects[oy],Objects[oz],Objects[viewdist]))

{

Player[playerid][view] = false;

DestroyPlayerObject(playerid,Player[playerid][objid]);

}

}

}

public SetPlayerPosWithObjects(playerid,Float:x,Float:y,Float:z)

{

for(new i = 0; i < sizeof(Objects); i++)

{

if(!Player[playerid][view])

{

if(IsInReach(x,y,z,Objects[ox],Objects[oy],Objects[oz],Objects[viewdist]))

{

Player[playerid][view] = true;

Player[playerid][objid] = CreatePlayerObject(playerid,Objects[modelid],Objects[ox],Objects[oy],Objects[oz],Objects[orx],Objects[ory],Objects[orz]);

}

} else if(!IsInReach(x,y,z,Objects[ox],Objects[oy],Objects[oz],Objects[viewdist]))

{

Player[playerid][view] = false;

DestroyPlayerObject(playerid,Player[playerid][objid]);

}

}

SetPlayerPos(playerid,Float:x,Float:y,Float:z);

}

public OnPlayerSpawn(playerid)

PlayerObjectUpdate(playerid);
Volver arriba Ir abajo
Ver perfil de usuario http://newgenerationrpg.activo.mx
 
[Tutorial]xObjects
Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
New Generation Roleplay :: Tuto y Documentacion Pawno-
Cambiar a: