VirtualWorld+Streamer
#1

I got a problem when Spawning in a virtual world. Why do I need to get killed or die first in that place before I can see the objects?
pawn Код:
CMD:cs(playerid, params[])
{
    if(gCommandsDisabled[playerid]==true)
    {
    ShowPlayerDialog(playerid, DIALOG_EVADE, DIALOG_STYLE_MSGBOX, "Leave Menu", "You must Leave first before using this command", "Leave", "Cancel");
    return 1;
    }
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "{6666FF}(/cs) {00CCFF}%s {6666FF}has Teleported to Counter-Strike",pName);
    SendClientMessageToAll(playerid, string);
    SetPlayerVirtualWorld(playerid, 2);
    DestroyVehicle(GetPlayerVehicleID(playerid));
    new Random = random(sizeof(RandomSpawnCsDM));
    SetPlayerPos(playerid, RandomSpawnCsDM[Random][0], RandomSpawnCsDM[Random][1], RandomSpawnCsDM[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawnCsDM[Random][3]);
    GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Counter-Strike",2000,3);
    gCommandsDisabled[playerid]=true;
    return 1;
}
Reply
#2

You won't be able to see objects in a virtual world unless you spawn the objects in that world,
That is if it's your map.
******: How to spawn objects in a virtual world

That should tell you how.


Hope this helped
Reply
#3

Quote:
Originally Posted by KingyKings
Посмотреть сообщение
You won't be able to see objects in a virtual world unless you spawn the objects in that world,
That is if it's your map.
******: How to spawn objects in a virtual world

That should tell you how.


Hope this helped
I still don't get It after I get killed and teleport to that map I can now run around on that map and see objects.

Edit: If I use my Dialog Teleport I can see object's without killing my self before I teleport to that map. What's the difference??

pawn Код:
case 1:
                {
                    if(gCommandsDisabled[playerid]==true)
                    {
                    ShowPlayerDialog(playerid, DIALOG_EVADE, DIALOG_STYLE_MSGBOX, "Leave Menu", "You must Leave first before using this command", "Leave", "Cancel");
                    return 1;
                    }
                    new string[128], pName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
                    format(string, sizeof(string), "{6666FF}(/cs) {00CCFF}%s {6666FF}has Teleported to Counter Strike",pName);
                    GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Counter-Strike",2000,3);
                    SetPlayerVirtualWorld(playerid, 2);
                    DestroyVehicle(GetPlayerVehicleID(playerid));
                    SendClientMessageToAll(playerid, string);
                    new Random = random(sizeof(RandomSpawnCsDM));
                    SetPlayerPos(playerid, RandomSpawnCsDM[Random][0], RandomSpawnCsDM[Random][1], RandomSpawnCsDM[Random][2]);
                    SetPlayerFacingAngle(playerid, RandomSpawnCsDM[Random][3]);
                    CreateDynamicObject(10946, -2261.0671386719, 1785.4710693359, 3.3126780986786, 0, 0, 0,2,-1,-1,300.0);
                    CreateDynamicObject(10946, -2260.9309082031, 1832.5231933594, 3.2876780033112, 0, 0, 180,2,-1,-1,300.0);
                    CreateDynamicObject(5463, -2259.2067871094, 1808.7338867188, 27.753015518188, 0, 0, 0,2,-1,-1,300.0);
                    CreateDynamicObject(3887, -2228.0598144531, 1847.9217529297, 9.663948059082, 0, 0, 270,2,-1,-1,300.0);
Reply
#4

Hmm..
Maybe make a timer and every so often it will reload the objects for that player.

It could possibly just be a simple load problem.

The world change is also probably effecting it.
Make a timer so when the player types the command it will freeze them while the objects load. That could be another idea.
Reply
#5

Quote:
Originally Posted by KingyKings
Посмотреть сообщение
Hmm..
Maybe make a timer and every so often it will reload the objects for that player.

It could possibly just be a simple load problem.

The world change is also probably effecting it.
Make a timer so when the player types the command it will freeze them while the objects load. That could be another idea.
Ah thanks I get it. Something like this??

pawn Код:
public OnPlayerSpawn(playerid)
{
    TogglePlayerControllable(playerid, false);
    SetTimerEx("Unfreeze", 5000, false, "i", playerid);
    return 1;
}

forward Unfreeze(playerid);
public Unfreeze(playerid)
{
    TogglePlayerControllable(playerid, true);
    return 1;
}
But unfortunately that map is deathmatch. If they see player standing or the (freeze) and they shoot the player, they get damage?
Reply
#6

Yes, like that.
If the player is frozen then they shouldnt take damage.

Hope I helped
Reply
#7

Quote:
Originally Posted by KingyKings
Посмотреть сообщение
Yes, like that.
If the player is frozen then they shouldnt take damage.

Hope I helped
Ah Okay maybe for now that would be my choice! +rep hehe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)