Virtual World
#1

i wont to do that if i enter car,
check what the car virtual world and what the player virtual world
and it's change the car virtual world to the player virtual world

some can help me?
Reply
#2

If you are in a virtual world number 0 and the vehicle is in number 1, then you can't see the vehicle.
So you cant enter a vehicle that has a different virtual world, because it doesn't exist in your world.
Reply
#3

you cant see im but you can get in to the car (invisible car)
Reply
#4

Well, it ain't that hard. Use OnPlayerEnterVehicle.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        new pVW = GetPlayerVirtualWorld(playerid);
        SetVehicleVirtualWorld(vehicleid, pVW);
    return 1;
}
Or, if that won't work, try using OnPlayerStateChange:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new pVW = GetPlayerVirtualWorld(playerid);
        new vID = GetPlayerVehicleID(playerid);
        SetVehicleVirtualWorld(vID, pVW);
    }
    return 1;
}
Reply
#5

work!

wait you can help me, if i in car and i change the virtual world, the car still in the first virtual world,
i can do that the car change the virtual world?


this is the code to changeworld:
Quote:

new string[256];
if(dialogid == ChangeWorld_Dialog)
{
if(!response) return SendClientMessage(playerid, 0xFFFFFF00, "You canceled the dialog.");
SetPlayerVirtualWorld(playerid, strval(inputtext));
format(string, sizeof(string), "Your virtual World change to : %d, GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid, 0xFFFFFF00, string);
return 0;
}

i try to do after the "You canceled the dialog." that:
Quote:

if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid,GetPlayerVehicleID(pla yerid),GetPlayerVirtualWorld(playerid));
}

but it dont work =\
Reply
#6

UP
Reply
#7

UP S:
Reply
#8

pawn Код:
if(dialogid == ChangeWorld_Dialog)
{
    if(!response) return SendClientMessage(playerid, 0xFFFFFF00, "You canceled the dialog.");
    SetPlayerVirtualWorld(playerid, strval(inputtext));
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(playerid));
    }
    format(string, sizeof(string), "Your virtual World change to : %d", GetPlayerVirtualWorld(playerid));
    SendClientMessage(playerid, 0xFFFFFF00, string);
    return 0;
}
Reply
#9

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)