SA-MP Forums Archive
[Help] Position fail exterior pls help - 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: [Help] Position fail exterior pls help (/showthread.php?tid=521268)



[Help] Position fail exterior pls help - Shura - 22.06.2014

Hello, I need to get out of this whole car garage I go out and not stagnate in this way, here I leave the command, I need something else?

+ Rep to you can help me please.

COMMAND:
Код:
CMD:gsalir(playerid,params[])
{
        if(lastGarage[playerid] >= 0)
        {
            new lg = lastGarage[playerid];
            if(!IsPlayerInAnyVehicle(playerid))
            {
                SetPlayerPos(playerid,gInfo[lg][PosX],gInfo[lg][PosY],gInfo[lg][PosZ]);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
                }
                else
                {
                    new vid = GetPlayerVehicleID(playerid);
                    LinkVehicleToInterior(vid,0);
                    SetVehicleVirtualWorld(vid,0);
                    SetVehiclePos(vid,gInfo[lg][PosX],gInfo[lg][PosY],gInfo[lg][PosZ]);
                    SetPlayerVirtualWorld(playerid,0);
                    SetPlayerInterior(playerid,0);
                }
                lastGarage[playerid] = -999;
        }
        else return SendClientMessage(playerid,COLOR_ERROR,"Error: No estбs en ningun garage.");
        return 1;
}



Re: [Help] Position fail exterior pls help - RenovanZ - 22.06.2014

Why dont just +1.0 your 'X' ?
pawn Код:
CMD:gsalir(playerid,params[])
{
        if(lastGarage[playerid] >= 0)
        {
            new lg = lastGarage[playerid];
            if(!IsPlayerInAnyVehicle(playerid))
            {
                SetPlayerPos(playerid,gInfo[lg][PosX],gInfo[lg][PosY],gInfo[lg][PosZ]);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
                }
                else
                {
                    new vid = GetPlayerVehicleID(playerid);
                    LinkVehicleToInterior(vid,0);
                    SetVehicleVirtualWorld(vid,0);
                    SetVehiclePos(vid,gInfo[lg][PosX]+1.0,gInfo[lg][PosY],gInfo[lg][PosZ]); //x + 1.0
                    SetPlayerVirtualWorld(playerid,0);
                    SetPlayerInterior(playerid,0);
                }
                lastGarage[playerid] = -999;
        }
        else return SendClientMessage(playerid,COLOR_ERROR,"Error: No estбs en ningun garage.");
        return 1;
}



Respuesta: [Help] Position fail exterior pls help - Shura - 22.06.2014

With the X position I now know how to adjust it, in my case it was just you subtract not add, thank you very much.


Thanks,
+rep