SetObjectWorld
#1

Does anyone know if there is a function like "SetObjectWorld" where i can set and objects world?

I am trying to make 2 different gamemodes in one, but I am wondering also if I can make certain commands work in certain worlds.

Examples;

like if i do /ar 2 it will arrest 2 if he is in world 43 (CnR world)

and if someone does /kill they will die if they are in world 1 (stunt)

Thanks!
-Kevin
Reply
#2

You should realy check out Incognitos streamer<<<<<--Click
It has interior and vw setting on the CreateDynamicObject. Not sure if pawno has this function sorry.
Reply
#3

The only "native" possibility id know is, to use playerobjects, and to create them only for players in the wanted world. But I would guess thats the way the streamer does it, so i wouldnt recommend scripting it yourself
Reply
#4

Quote:
Originally Posted by iggy1
Посмотреть сообщение
You should realy check out Incognitos streamer<<<<<--Click
It has interior and vw setting on the CreateDynamicObject. Not sure if pawno has this function sorry.

i am using that streamer =D

but i just don'w know how to do it. XD do you (or anyone else) know how to do it?
Reply
#5

pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);

Example:

//This will create an object in virtual world 10
CreateDynamicObject(1225, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, -1, -1, 200.0);
And for the commands you can check if the player is in a certain virtual world:

pawn Код:
if(!strcmp(cmdtext, "/kill", true, 5))
{
    if(GetPlayerVirtualWorld(playerid) != 1) return SendClientMessage(playerid, 0xAFFFFAF, "ERROR: You are not in the Stunt virtual world");
    SetPlayerHealth(playerid, 0);
    return 1;
}
Reply
#6

here's an example of one of my objects....

Код:
//object(barrel4) (4)
    CreateDynamicObject(1225,-800.09747314,3559.79174805,182.39744568,0.00000000,0.00000000,0.00000000);
So it would be:

Код:
//object(barrel4) (4)
    CreateDynamicObject(1225,-800.09747314,3559.79174805,182.39744568,0.00000000,10,0.00000000);
Is that right?
Reply
#7

Hmm I don't think that would work, this will work though...

pawn Код:
CreateDynamicObject(1225, -800.09747314, 3559.79174805, 182.39744568, 0.0, 0.0, 0.0, 10, -1, -1, 100);

The parameters are:

//ModelID, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid, interiorid, playerid, drawdistance
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)