SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 02/08/2011, 11:44 AM   #1
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Virtual World

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?
shahartal is offline  
Old 02/08/2011, 12:22 PM   #2
MetalScript
Big Clucker
 
MetalScript's Avatar
 
Join Date: Jul 2010
Location: Estonia
Posts: 75
Reputation: 4
Default Re: Virtual World

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.
__________________

80.79.113.21:7777

Code:
[GameMode]                                     [FilterScript]                                         [Include]
AllLife Gang TDM                             Automatic Weather&Time                 None

[Tool/Web/Other]
None
MetalScript is offline  
Old 02/08/2011, 12:27 PM   #3
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Re: Virtual World

you cant see im but you can get in to the car (invisible car)
shahartal is offline  
Old 02/08/2011, 12:42 PM   #4
antonio112
Gangsta
 
antonio112's Avatar
 
Join Date: Aug 2009
Location: Romania
Posts: 970
Reputation: 87
Default Re: Virtual World

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

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        new pVW = GetPlayerVirtualWorld(playerid);
        SetVehicleVirtualWorld(vehicleid, pVW);
    return 1;
}

Or, if that won't work, try using OnPlayerStateChange:

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new pVW = GetPlayerVirtualWorld(playerid);
        new vID = GetPlayerVehicleID(playerid);
        SetVehicleVirtualWorld(vID, pVW);
    }
    return 1;
}
__________________
antonio112 is offline  
Old 02/08/2011, 01:46 PM   #5
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Re: Virtual World

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 =\
shahartal is offline  
Old 03/08/2011, 12:35 PM   #6
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Re: Virtual World

UP
shahartal is offline  
Old 04/08/2011, 12:22 PM   #7
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Re: Virtual World

UP S:
shahartal is offline  
Old 04/08/2011, 12:30 PM   #8
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: Virtual World

pawn Code:
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;
}
MadeMan is offline  
Old 04/08/2011, 05:24 PM   #9
shahartal
Big Clucker
 
Join Date: Jul 2011
Location: sa-mp
Posts: 63
Reputation: 3
Default Re: Virtual World

Thanks
shahartal is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual world knackworst Help Archive 10 23/10/2010 05:34 PM
About a virtual world. DevilRP Help Archive 6 27/05/2010 03:59 PM


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.