createobject - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: createobject (
/showthread.php?tid=470939)
createobject -
ic3cr3am - 20.10.2013
Код:
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+
Re: createobject -
ic3cr3am - 20.10.2013
help?
Re: createobject -
Dragonsaurus - 20.10.2013
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]);
}
Re: createobject -
Konstantinos - 20.10.2013
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]);