SA-MP Forums Archive
Como cambiar Virtual World - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Como cambiar Virtual World (/showthread.php?tid=490626)



Como cambiar Virtual World - Snoopythekill - 27.01.2014

Hola alguien me puede ayudar a que el vehiculo se cree en el mundo 10 ? ya intente media noche y nadamas no puedo :c esta parte es el setup de la carrera la que creeea las cordenadas,los vehiculos,chekpoints etc bueno eso creeo ya que el comando la manda a esa parte mm alguien me puede ayudar ? mundo 10 T.T porfi.
Код:
function SetupRaceForPlayer(playerid)
{
CPProgess[playerid] = 0;
TogglePlayerControllable(playerid, false);
CPCoords[playerid][3] = 0;
SetCP(playerid, CPProgess[playerid], CPProgess[playerid]+1, TotalCP, RaceType);
if(IsOdd(playerid)) Index2 = 1;
else Index2 = 0;
switch(Index2)
{
case 0:
{
if(PlayersCount[0] == 1)
{
RaceVehCoords[0][0] -= (6 * floatsin(-RaceVehCoords[0][3], degrees));
RaceVehCoords[0][1] -= (6 * floatcos(-RaceVehCoords[0][3], degrees));
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
}
}
case 1:
{
if(PlayersCount[1] == 1)
{
RaceVehCoords[1][0] -= (6 * floatsin(-RaceVehCoords[1][3], degrees));
RaceVehCoords[1][1] -= (6 * floatcos(-RaceVehCoords[1][3], degrees));
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2, RaceVehCoords[1][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[1][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2], RaceVehCoords[1][3], 20);
}
}
}
switch(Index2)
{
case 0:
{
if(PlayersCount[0] != 1)
{
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
PlayersCount[0] = 1;
}
}
case 1:
{
if(PlayersCount[1] != 1)
{
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2, RaceVehCoords[1][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[1][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[1][0], RaceVehCoords[1][1], RaceVehCoords[1][2], RaceVehCoords[1][3], 20);
PlayersCount[1] = 1;
}
}
}
new string[128];
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 10);
#endif
InfoTimer[playerid] = SetTimerEx("TextInfo", 500, 1, "e", playerid);
if(JoinCount == 1) format(string, sizeof(string), "RaceName: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~RaceTime: ~w~%s~n~~y~RacePosition: ~w~1/1~n~ ", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime));
else format(string, sizeof(string), "RaceName: ~w~%s~n~~p~~h~Checkpoint: ~w~%d/%d~n~~b~~h~RaceTime: ~w~%s~n~~y~RacePosition: ~w~%d/%d~n~ ", RaceName, CPProgess[playerid], TotalCP, TimeConvert(RaceTime), RacePosition[playerid], JoinCount);
TextDrawSetString(RaceInfo[playerid], string);
//TextDrawShowForPlayer(playerid, RaceInfo[playerid]);
JoinCount++;
return 1;
}
Gracias.


Respuesta: Como cambiar Virtual World - xHanks - 27.01.2014

Usa esto: SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), 10); (Lo adaptas a tu script)


Re: Como cambiar Virtual World - Daniel-92 - 27.01.2014

Se cambia con https://sampwiki.blast.hk/wiki/SetVehicleVirtualWorld


Respuesta: Como cambiar Virtual World - Snoopythekill - 27.01.2014

Eso ya lose pero como lo coloco :/ lo he eintentado de todas formas y no puedo T,T
Код:
if(PlayersCount[0] == 1)
{
RaceVehCoords[0][0] -= (6 * floatsin(-RaceVehCoords[0][3], degrees));
RaceVehCoords[0][1] -= (6 * floatcos(-RaceVehCoords[0][3], degrees));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), 10),CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
}
Asi tambien :
Код:
if(PlayersCount[0] == 1)
{
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), 10);
RaceVehCoords[0][0] -= (6 * floatsin(-RaceVehCoords[0][3], degrees));
RaceVehCoords[0][1] -= (6 * floatcos(-RaceVehCoords[0][3], degrees));
CreatedRaceVeh[playerid] = CreateVehicle(RaceVehicle, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2, RaceVehCoords[0][3], random(126), random(126), (60 * 60));
SetPlayerPos(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2]+2);
SetPlayerFacingAngle(playerid, RaceVehCoords[0][3]);
PutPlayerInVehicle(playerid, CreatedRaceVeh[playerid], 0);
Camera(playerid, RaceVehCoords[0][0], RaceVehCoords[0][1], RaceVehCoords[0][2], RaceVehCoords[0][3], 20);
Donde devo colocar el virtualworld
Gracias.


Respuesta: Como cambiar Virtual World - TheChaoz - 27.01.2014

Eso pasa porque no tienes ni idea de lo que el codigo hace. Te sugiero para evitarte futuros problemas como este que cuando uses un codigo, intentes al menos comprender que es lo que hace sin necesidad de testearlo.

pawn Код:
SetVehicleVirtualWorld(CreatedRaceVeh[playerid], 10);//Luego de crear el vehiculo



Respuesta: Como cambiar Virtual World - Snoopythekill - 27.01.2014

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
Eso pasa porque no tienes ni idea de lo que el codigo hace. Te sugiero para evitarte futuros problemas como este que cuando uses un codigo, intentes al menos comprender que es lo que hace sin necesidad de testearlo.

pawn Код:
SetVehicleVirtualWorld(CreatedRaceVeh[playerid], 10);//Luego de crear el vehiculo
Muchas Gracias alfin jajaja..! te juro que intente toda la noche y no pude pongo mucha atenciуn pero aun no comprendo muchas cosas, soy nuevo en el scripting pawno.

Saludos & Gracias.