13.04.2018, 12:49
Hi, how can I set a mapping to be shown only if a player is in specific virtualworld?
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, areaid = -1, priority = 0)
Assuming you are using Incognito's streamer, you can specify the world(s) in the CreateDynamicObject function.
PHP код:
|
CreateObject(19363, 1174.2612, -1354.5870, 38.0153, 0.0000, 0.0000, 90.0000); //wall011
CMD:enter(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 1172.7439,-1323.3291,15.4013))
{
SendClientMessage(playerid, -1, "{FFCC33} All Saints General Hospital. ");
SetPlayerPos(playerid, 1179.7336, -1308.0152, 40.5419);
SetPlayerInterior(playerid, 0);
CreateObject(19363, 1174.2612, -1354.5870, 38.0153, 0.0000, 0.0000, 90.0000);
SetPlayerVirtualWorld(playerid, 1);
}
}
After you set your map, and your coords at that map you must put that
map objects in the virtual world that you choose for your map in that command, here '/entermap'.
So if you have some objects like (examples):
CreateDynamicObject( 1697, -984.5000000, -659.2000100, 260.0, 31.7670000, 0.0, 0.0, .worldid = 10 );
CreateDynamicObject( 1697, -988.9660000, -659.2000100, 260.0, 31.7610000, 0.0, 0.0, .worldid = 10 );
CreateDynamicObject( 1697, -980.0332000, -659.1992200, 260.0, 31.7610000, 0.0, 0.0, .worldid = 10 );
CreateDynamicObject( 1697, -975.5673800, -659.1992200, 260.0, 31.7610000, 0.0, 0.0, .worldid = 10 );
CreateDynamicObject( 1697, -971.1015600, -659.1992200, 260.0, 31.7610000, 0.0, 0.0, .worldid = 10 );
that .worldid is the tag of the world ID from the "CreateDynamicObject" function, you just have to
add to your end of the object the world like you see in the code above, or you can simply put the
world without the tag ".worldid". Ex: CreateDynamicObject( 1697, -984.5000000, -659.2000100, 260.0, 31.7670000, 0.0, 0.0, 10 );
CMD:entermap( playerid, params[ ] ) // you must make a command from your map, like you want (this is an example).
{
SetPlayerVirtualWorld( playerid, 10 ) // you must set the world ID, it not requires the interior ID if you don't set it in the object code, but if you set the interior ID different from the original value you must set it in the comand with "SetPlayerInterior( playerid, Int ID );"
SetPlayerPos( playerid, x, y, z ); // x, y, z = your spawn coords at that map.
return 1;
}