SA-MP Forums Archive
Can't see vehicles after changing virtualworld - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't see vehicles after changing virtualworld (/showthread.php?tid=650255)



Can't see vehicles after changing virtualworld - Lirbo - 24.02.2018

after changing virtual world and coming back to the previous one I can't see any vehicle for some reason although I'm changing back to virtualworld 0 which is the vehicle virtual world as well. I'm using 0.3.DL is that a known issue?


Re: Can't see vehicles after changing virtualworld - DeMoo - 24.02.2018

PHP код:
 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualid); 



Re: Can't see vehicles after changing virtualworld - PepsiCola23 - 24.02.2018

make a debug for the car virtual world with GetVehicleVirtualWorld and see if it matches yours


Re: Can't see vehicles after changing virtualworld - Lirbo - 24.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
make a debug for the car virtual world with GetVehicleVirtualWorld and see if it matches yours
I did it, still nothing.
All I do is using /setvirtualworld [world] command and when I'm back the vehicles are gone but not the rest of the things such as pickups and 3dlabels.

PHP код:
CreateVehicle(4112600, -220014011, -1);
AddStaticVehicle(5202603, -219514001); // hydra 
nothing is wrong with my command though, when I use virtualworld change on playerspawn it won't show as well
PHP код:
CMD:setvirtualworld(playeridparams[])
{
    if(
sscanf(params"d"I[0])) return Message(playeridTYPE_USAGE"/virtualworld [virtualworld]");
    
SetPlayerVirtualWorld(playeridI[0]);
    return 
1;

before changing vw:


after changing vw:


after changing back to vw 0:


the screenshots are not edited, the hp loss is due to hunger and dehydration

Also it won't show vehicles that were created after changing the interior:
PHP код:
CMD:adminvehicle(playeridparams[])
{
    new 
string[64];
    if(
DB[playerid][Admin] < 3) return Message(playeridTYPE_ERROR"You're not allowed to use this command.");
    if(
sscanf(params"d"I[0])) return Message(playeridTYPE_USAGE"/adminvehicle [model id]");
    
DestroyVehicle(AVehicle[playerid]);
    
GetPlayerPos(playeridF[0], F[1], F[2]);
    
GetPlayerFacingAngle(playeridF[3]);
    
AVehicle[playerid] = CreateVehicle(I[0], F[0], F[1], F[2], F[3], 11, -1);
    
SetVehicleVirtualWorld(AVehicle[playerid], GetPlayerVirtualWorld(playerid));
    
LinkVehicleToInterior(AVehicle[playerid], GetPlayerInterior(playerid));
    
SetVehicleNumberPlate(AVehicle[playerid], "{FFFFFF}Admin");
    
//PutPlayerInVehicle(playerid, AVehicle[playerid], 0);
    
format(stringsizeof(string), "Spawned an OOC Admin vehicle (%d)."GetVehicleModel(AVehicle[playerid]));
    
Message(playeridTYPE_ADMINstring);
    return 
1;




Re: Can't see vehicles after changing virtualworld - PepsiCola23 - 24.02.2018

maybe you set another vw other than 0 when a player connects?


Re: Can't see vehicles after changing virtualworld - Lirbo - 24.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
maybe you set another vw other than 0 when a player connects?
It's not related, the player can see the vehicles when they spawn, however after changing interior they can't see it when they come back to the virtual work of the vehicle


Re: Can't see vehicles after changing virtualworld - PepsiCola23 - 24.02.2018

can you use this when you login,after you use cmd,and after you use cmd back again,and do the same thing for the car`s virtual world?

PHP код:
YCMD:vw(playeridparams[], help)
    {
        new 
string[32];
        
format(stringsizeof(string), "vw %d"GetPlayerVirtualWorld(playerid));
        
SendClientMessage(playerid0xFFFFFFFFstring);
        return 
1;
    } 



Re: Can't see vehicles after changing virtualworld - Lirbo - 24.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
can you use this when you login,after you use cmd,and after you use cmd back again,and do the same thing for the car`s virtual world?

PHP код:
YCMD:vw(playeridparams[], help)
    {
        new 
string[32];
        
format(stringsizeof(string), "vw %d"GetPlayerVirtualWorld(playerid));
        
SendClientMessage(playerid0xFFFFFFFFstring);
        return 
1;
    } 
https://imgur.com/a/Yfsi0


Re: Can't see vehicles after changing virtualworld - PepsiCola23 - 24.02.2018

try this

PHP код:
YCMD:setvw(playeridparams[], help)
{
    new 
id,intid;
    if(
sscanf(params"ui"idintid)) return SendUsage(playerid,"/setvw <Name/Playerid> <vw>");
    
SetPlayerVirtualWorld(idintid);




Re: Can't see vehicles after changing virtualworld - Lirbo - 24.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
try this

PHP код:
YCMD:setvw(playeridparams[], help)
{
    new 
id,intid;
    if(
sscanf(params"ui"idintid)) return SendUsage(playerid,"/setvw <Name/Playerid> <vw>");
    
SetPlayerVirtualWorld(idintid);

it's working the same as my command, dude it doesn't work