Virtual World ! - 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: Virtual World ! (
/showthread.php?tid=303623)
Virtual World ! -
dorperez - 14.12.2011
Hey Guys !
I have been downloaded this interior (
https://sampforum.blast.hk/showthread.php?tid=93619 ) and I want do that when player enter to vehicle number 51 it will teleport me to the interior.
Tnx guys !!
Re: Virtual World ! -
Sascha - 14.12.2011
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(playerid) == 51)
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerFacingAngle(playerid, A);
}
}
return 1;
}
replace X Y Z and A with some coords of an object from the map and later replace them with the correct coords
Re: Virtual World ! -
dorperez - 14.12.2011
When I am enter the vehicle as a passager I am falling...That how I defineded it:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
if(GetPlayerVehicleID(playerid) == 55)
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(Inenforcer[playerid], X, Y, Z);
SetPlayerPos(playerid, X+4, Y, Z);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 1);
Inenforcer[playerid] = 0;
TogglePlayerControllable(playerid,0);
SetTimerEx("wwelocker",1500,0,"i",playerid);
}
}
Re: Virtual World ! -
Rob_Maate - 14.12.2011
Set the interior BEFORE you set the position. Otherwise there's the off chance that they'll fall slightly before you change the interior
Re: Virtual World ! -
dorperez - 15.12.2011
Nothing dude ...Help plz ..
Re: Virtual World ! - T0pAz - 15.12.2011
This might help you
Quote:
Originally Posted by Sir_Brock
What Kye recommended to me was using a virtual world for the interior, so I did. On the spawn for Rappers (interior 5)/Grove (interior 2)/Drug Dealers (interior 12) on my server, I have made them spawn in virtual world 1.
And the in OnPlayerInteriorChange I have written this...
Код:
if((newinteriorid == 5 || newinteriorid == 2 || newinteriorid == 12) && GetPlayerVirtualWorld(playerid) == 0) SetPlayerVirtualWorld(playerid, 1);
if((oldinteriorid == 5 || oldinteriorid == 2 || oldinteriorid == 12) && newinteriorid == 0 && GetPlayerVirtualWorld(playerid) == 1) SetPlayerVirtualWorld(playerid, 0);
Kye says that he isn't sure whether this will be something that will be changed in 0.3b, so for now, this is the best solution going.
|
Re: Virtual World ! -
dorperez - 15.12.2011
Quote:
Originally Posted by T0pAz
This might help you
|
What should I do with that ?
Re: Virtual World ! -
dorperez - 16.12.2011
UP !!
Re: Virtual World ! -
dorperez - 16.12.2011
Help ...
Re: Virtual World ! -
dorperez - 17.12.2011
Didnt Worked
I have found this line
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 427)
{
SetPlayerPos(playerid, 2084.479980, -1374.825928, 300.628052);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 1);
Inenforcer[playerid] = GetPlayerVehicleID(playerid);
}