SA-MP Forums Archive
teleport problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: teleport problem (/showthread.php?tid=224490)



teleport problem - marrcko - 11.02.2011

Hi, i have 1 problem. Then i teleport to player the interior didn't change(still be 0).
pawn Код:
CMD:to(playerid, params[])
    {
        new id;

        if(playerDB[playerid][admin] || playerDB[playerid][sadmin] ||
       playerDB[playerid][gelit] || playerDB[playerid][selit])
        {
         if (sscanf(params, "u", id)) SendClientMessage(playerid,ZALSVA, "Naudokite: /to [dalis vardo]");
        else if (!IsPlayerConnected(id)) SendClientMessage(playerid,0xD9E916FF,"* zaidejas neprisijunges");
        else{
                new vidus = GetPlayerInterior(id);
                SetPlayerInterior(playerid,vidus);
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
                new Float:tempcoo[3];
                GetPlayerPos(id,tempcoo[0],tempcoo[1],tempcoo[2]);
                SetPlayerPos(playerid,tempcoo[0],tempcoo[1],tempcoo[2]);
                SetCameraBehindPlayer(playerid);
            }
        }
        return 1;
    }

    CMD:get(playerid, params[])
    {
        new id;

        if(playerDB[playerid][admin] || playerDB[playerid][sadmin] ||
       playerDB[playerid][gelit] || playerDB[playerid][selit])
        {
        if (sscanf(params, "u", id)) SendClientMessage(playerid,ZALSVA, "Naudokite: /get [id/dalis vardo]");
        else if (!IsPlayerConnected(id)) SendClientMessage(playerid,0xD9E916FF,"* zaidejas neprisijunges");
        else if (playerDB[id][admin]) SendClientMessage(playerid,ZALSVA, "Administratoriш kilnoti negalima!");
        else{
                new vidus = GetPlayerInterior(playerid);
                SetPlayerInterior(id,vidus);
                SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
                new Float:tempcoo[3];
                GetPlayerPos(playerid, tempcoo[0], tempcoo[1], tempcoo[2]);
                SetPlayerPos(id, tempcoo[0], tempcoo[1], tempcoo[2]);
                SetCameraBehindPlayer(id);
            }
        }
        return 1;
    }
P.S. sry for bad english.