Random objects + spawns not being created
#1

Hey, I'm currently trying to get some objects to be created with a random object ID and spawn but they don't seem to show up in game. I'm using Incognito's streamer plugin, there are no errors. Am I doing something wrong?

Here's what I've got;
pawn Code:
new Objects[] =
{
    849, 851, 852, 853, 854
};

new Float:Spawns[][] =
{
    {-2236.210,-2568.430,31.140},
    {-2241.000,-2552.900,31.140},
    {-2251.390,-2563.750,31.140},
    {-2204.330,-2516.560,29.880},
    {-2203.080,-2501.970,29.840}
}

new spawn[5];
public OnGameModeInit()
{
    new randspawn = random(sizeof(Spawns));
    new randobject = random(sizeof(Objects));
    spawn[0] = CreateDynamicObject(Objects[randobject], Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
    spawn[1] = CreateDynamicObject(Objects[randobject], Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
    spawn[2] = CreateDynamicObject(Objects[randobject], Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
    spawn[3] = CreateDynamicObject(Objects[randobject], Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
    spawn[4] = CreateDynamicObject(Objects[randobject], Spawns[randspawn][0], Spawns[randspawn][1], Spawns[randspawn][2], 0, 0, 0, -1, -1, -1, 100.0);
}
Reply
#2

i think so u need to change

Objects[randobject][0]

to only

Objects[randobject]

think so i am not that good at randoming things .. try it and please remove [] from the object up there
when u use mine tech
Reply
#3

Yes I already tried that, I thought it would work but it compiles with error 035: argument type mismatch
Reply
#4

Could anyone possibly help with this?
Reply
#5

Code:
new Float:Spawn[][4]
Code:
new Objects[1] =
{
    {849}, {851}, {852}, {853}, {854}
};
Try this
Reply
#6

Tried it, "new Float:Spawn[][4]" would be "new Float:Spawn[][3] though, doesn't work
Reply
#7

Not sure but
You are doing single array here:

pawn Code:
new Object[] = ...
and using multi-array here:

pawn Code:
Objects[randobject][0]
just not sure.
Reply
#8

Quote:
Originally Posted by Jarnu
View Post
Not sure but
You are doing single array here:

pawn Code:
new Object[] = ...
and using multi-array here:

pawn Code:
Objects[randobject][0]
just not sure.
Oh yeah, I fixed that earlier should have edited my post. I'll edit now but even like that it still doesn't work
Reply
#9

Sorry for bumping old thread but I'm really having difficulties trying to work out why the objects are not showing up at all, can anyone help?
Reply
#10

tried using any other object plugin? like F_CreateObject or just CreateObject ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)