SA-MP Forums Archive
Garage - 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: Garage (/showthread.php?tid=549379)



Garage - Metzone - 06.12.2014

Bueno, la cosa esque con el sistema de casa, hizeuno de garage, y bueno cuando lo compro y entro todo perfecto, pero cuando quiero entrar con auto, entro yel auto se queda fuera, lo puse de otra forma y cuando entro el usuario entra y el auto pero el user fuera del auto.


este es el codigo:


pawn Код:
for(new i = 0; i < sizeof(GarageInfo); i++){
                if (IsPlayerInRangeOfPoint(playerid,9,GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ])){
                    if(Info[playerid][pGaragekey] == i || Info[playerid][pGaragekey2] == i || GarageInfo[i][gLock] == 0){
                        new vehicleid = GetPlayerVehicleID(playerid);
                        Info[playerid][pVW] = i+6000;
                        SetPlayerVirtualWorld(playerid, i+6000);
                        SetVehicleVirtualWorld(vehicleid, i+6000);
                        SetVehiclePos(GetPlayerVehicleID(playerid), GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        SetPlayerPos(playerid,GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        SetPlayerFacingAngle(playerid, GarageInfo[i][gExteriorA]);
                        SetCameraBehindPlayer(playerid);
                        LoadObjects(playerid);
                        Streamer_UpdateEx(playerid, GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Cerrado", 5000, 1);
                    }
                    return 1;
         }
         }



Respuesta: Garage - jotajeda - 06.12.2014

https://sampwiki.blast.hk/wiki/PutPlayerInVehicle
pawn Код:
PutPlayerInVehicle( playerid,vehicleid , 0 ) ;



Re: Garage - Metzone - 06.12.2014

Pero aver, el usuario entra al garage, pero el vehiculo se queda fuera...


Respuesta: Garage - jotajeda - 06.12.2014

Quita йstas lineas.
pawn Код:
SetPlayerPos(playerid,GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
 SetPlayerFacingAngle(playerid, GarageInfo[i][gExteriorA]);
                        SetCameraBehindPlayer(playerid);
Y aсade el

SetVehicleZAngle


Re: Garage - Metzone - 06.12.2014

Lo hize y todo bien, pero si quiero entrar al garage a pie, no puedo, ya que no esta el setplayerpos...


Respuesta: Re: Garage - jotajeda - 06.12.2014

Quote:
Originally Posted by Metzone
Посмотреть сообщение
Lo hize y todo bien, pero si quiero entrar al garage a pie, no puedo, ya que no esta el setplayerpos...
Ponle un else y allн solo usas funciones para el player y no para el vehiculo.


Respuesta: Re: Garage - Zarco - 06.12.2014

Quote:
Originally Posted by Metzone
Посмотреть сообщение
Lo hize y todo bien, pero si quiero entrar al garage a pie, no puedo, ya que no esta el setplayerpos...
Simplemente aсade un if que sepa si esta en un vehнculo, si estб mueves el coche, si no esta muevas al player.

Код:
			if(IsPlayerInAnyVehicle(playerid))
			{
			//la funciуn que cumple si estб en el vehiculo

}else{

                       //la funciуn que cumple si no estб en el vehiculo
			}



Re: Garage - Metzone - 06.12.2014

їAsi?


pawn Код:
for(new i = 0; i < sizeof(GarageInfo); i++){
                if (IsPlayerInRangeOfPoint(playerid,9,GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ])){
                    if(Info[playerid][pGaragekey] == i || Info[playerid][pGaragekey2] == i || GarageInfo[i][gLock] == 0){
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                        new vehicleid = GetPlayerVehicleID(playerid);
                        new currentveh;
                        new Float:angle;
                        currentveh = GetPlayerVehicleID(playerid);
                        SetVehicleZAngle(currentveh, angle);
                        SetVehiclePos(GetPlayerVehicleID(playerid), GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        Streamer_UpdateEx(playerid, GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        Info[playerid][pVW] = i+6000;
                        SetPlayerVirtualWorld(playerid, i+6000);
                        SetVehicleVirtualWorld(vehicleid, i+6000);
                    }
                    }else{
                        SetPlayerPos(playerid,GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        SetPlayerFacingAngle(playerid,GarageInfo[i][gInteriorA]);
                        SetCameraBehindPlayer(playerid);
                    }
                    return 1;
         }
         }



Respuesta: Re: Garage - jotajeda - 06.12.2014

Quote:
Originally Posted by Metzone
Посмотреть сообщение
їAsi?


pawn Код:
for(new i = 0; i < sizeof(GarageInfo); i++){
                if (IsPlayerInRangeOfPoint(playerid,9,GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ])){
                    if(Info[playerid][pGaragekey] == i || Info[playerid][pGaragekey2] == i || GarageInfo[i][gLock] == 0){
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                        new vehicleid = GetPlayerVehicleID(playerid);
                        new currentveh;
                        new Float:angle;
                        currentveh = GetPlayerVehicleID(playerid);
                        SetVehicleZAngle(currentveh, angle);
                        SetVehiclePos(GetPlayerVehicleID(playerid), GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        Streamer_UpdateEx(playerid, GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        Info[playerid][pVW] = i+6000;
                        SetPlayerVirtualWorld(playerid, i+6000);
                        SetVehicleVirtualWorld(vehicleid, i+6000);
                    }
                    }else{
                        SetPlayerPos(playerid,GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                        SetPlayerFacingAngle(playerid,GarageInfo[i][gInteriorA]);
                        SetCameraBehindPlayer(playerid);
                    }
                    return 1;
         }
         }
Estб mal, asн:

pawn Код:
for(new i = 0; i < sizeof(GarageInfo); i++)
                {
                    if (IsPlayerInRangeOfPoint(playerid,9,GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ]))
                    {
                        if(Info[playerid][pGaragekey] == i || Info[playerid][pGaragekey2] == i || GarageInfo[i][gLock] == 0)
                        {
                            if(IsPlayerInAnyVehicle(playerid))
                            {
                                new vehicleid = GetPlayerVehicleID(playerid);
                                new currentveh;
                                new Float:angle;
                                currentveh = GetPlayerVehicleID(playerid);
                                SetVehicleZAngle(currentveh, angle);
                                SetVehiclePos(GetPlayerVehicleID(playerid), GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                                Streamer_UpdateEx(playerid, GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                                Info[playerid][pVW] = i+6000;
                                SetPlayerVirtualWorld(playerid, i+6000);
                                SetVehicleVirtualWorld(vehicleid, i+6000);
                            }
                            else
                            {
                                SetPlayerPos(playerid,GarageInfo[i][gInteriorX],GarageInfo[i][gInteriorY],GarageInfo[i][gInteriorZ]);
                                SetPlayerFacingAngle(playerid,GarageInfo[i][gInteriorA]);
                                SetCameraBehindPlayer(playerid);
                            }
                            return 1;
                        }
                    }
                }



Respuesta: Garage - Zarco - 06.12.2014

jotajeda podrнas pasarte por mi post a ver si me das alguna soluciуn?, gracias.

https://sampforum.blast.hk/showthread.php?tid=549461