createobject
#1

Код:
new Float:Objects[][7] =
{
	{4242,859.2998000,-4622.3994100,0.1000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (2)
	{4242,859.2998000,-4622.3994100,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (3)
	{4242,659.6992200,-4622.3994100,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (4)
	{4242,659.7000100,-4370.8999000,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (5)
	{4242,859.2998000,-4370.8994100,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (6)
};
now, how do i create all of those objects?

help = rep+
Reply
#2

help?
Reply
#3

pawn Код:
new Obj[sizeof(Objects)]; // under the code above you posted.

// This under OnGameModeInit or OnFilterScriptInit:
for(new i = 0; i < sizeof(Objects); i++)
{
    Obj[i] = CreateObject(Objects[i][0], Objects[i][1], Objects[i][2], Objects[i][3], Objects[i][4], Objects[i][5], Objects[i][6]);
}
Reply
#4

pawn Код:
enum Objects_enum
{
    modelid,
    Float: X,
    Float: Y,
    Float: Z,
    Float: rX,
    Float: rY,
    Float: rZ
};

new Objects[][Objects_enum] =
{
    {4242,859.2998000,-4622.3994100,0.1000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (2)
    {4242,859.2998000,-4622.3994100,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (3)
    {4242,659.6992200,-4622.3994100,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (4)
    {4242,659.7000100,-4370.8999000,-8.7000000,0.0000000,0.0000000,0.0000000}, //object(sbsbed5law2) (5)
    {4242,859.2998000,-4370.8994100,-8.7000000,0.0000000,0.0000000,0.0000000} //object(sbsbed5law2) (6)
};
   
// OnGameModeInit/OnFilterScriptInit
for(new i; i != sizeof(Objects); i++) CreateObject(Objects[i][modelid], Objects[i][X], Objects[i][Y], Objects[i][Z], Objects[i][rX], Objects[i][rY], Objects[i][rZ]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)