CreateDynamicObject in all worlds(-1) and not in world 0
#1

Hello all,

I am making some custom interiors for the server and i want to create the objects in all worlds and not in world 0.
How can i manage that?

Admigo
Reply
#2

by checking the parameter you can change the Virtual World to value you want.

pawn Код:
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);
This: worldid = -1 just change the number, PS: the default is -1
Reply
#3

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
by checking the parameter you can change the Virtual World to value you want.

pawn Код:
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);
This: worldid = -1 just change the number, PS: the default is -1
I know that but i dont want to create 1000 objects of each...
Reply
#4

If you want to make the objects in all worlds, simply leave that parameter (worldid) because it is -1 by default. Also I don't get what you need, can you explain more?
Reply
#5

Quote:
Originally Posted by iZN
Посмотреть сообщение
If you want to make the objects in all worlds, simply leave that parameter (worldid) because it is -1 by default. Also I don't get what you need, can you explain more?
Admigo sorry for posting in your thread and not helping you, but,
I wanna reply to iZN's post:

-Admigo wants to create object in ALL virtual worlds except 0.
So if he uses -1 as worldid, it will create object in ALL world INCLUDING 0..
Reply
#6

Quote:
Originally Posted by erminpr0
Посмотреть сообщение
Admigo sorry for posting in your thread and not helping you, but,
I wanna reply to iZN's post:

-Admigo wants to create object in ALL virtual worlds except 0.
So if he uses -1 as worldid, it will create object in ALL world INCLUDING 0..
Yep you are right. Thanks for explaining more.
Reply
#7

pawn Код:
CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
Reply
#8

Thanks for explaining me erminpr0.

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
Please check erminpr0's post.

Try doing like this, you can also generate your custom objects through convertffs.com

pawn Код:
new worldz;
if(!IsValidWorld(worldz)
{
    CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldz);
}

stock IsValidWorld(world)
{
    return (1 <= world <= 2147483647);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)