Question

Всем привет! Решил покопаться в моде Redline RP (Perfomance, Radmir). Столкнулся с такой проблемкой: При телепортировании персонаж стоит на месте. Например: Я захожу в пикап бизнеса, но меняется только виртуальный мир, координаты не меняются.

Подскажите в чем может быть проблема.

Спойлер

    new Float:px,Float:py,Float:pz,string[128];
    if(sscanf(params,"p<,>fff",px,py,pz)) return SendClientMessage(playerid, 0xcececeFF, "Используйте: {ffffff} /rt [x] [y] [z]");
    SetPlayerPosEx(playerid,px,py,pz);
    format(string, sizeof(string), "Вы были телепортированы: %f, %f, %f",px,py,pz);
    SendClientMessage(playerid, 0xFFFFFFAA, string);

 

Edited by _bogdan_

Share this post


Link to post

4 answers to this question

  • 0

@_bogdan_, покпжите код функции SetPlayerPosEx.

Share this post


Link to post
  • 0

@odosenok 
 

Спойлер

stock SetPlayerPosEx(playerid, Float: x, Float: y, Float: z, Float: angle, interior = -1, virtual_world = -1, freeze = true)
{
    if(interior > 0)
        PlayerTeleportInit(playerid, x, y,  z, angle);

    SetPlayerPos(playerid, x, y, z);

    SetPlayerFacingAngle(playerid, angle);
    SetCameraBehindPlayer(playerid);
    
    if(interior != -1 && GetPlayerInterior(playerid) != interior)
        SetPlayerInterior(playerid, interior);
    
    if(virtual_world != -1 && GetPlayerVirtualWorld(playerid) != virtual_world)
        SetPlayerVirtualWorld(playerid, virtual_world);
    
    if(GetPlayerData(playerid, P_LAST_PICKUP) != -1)
        SetPlayerData(playerid, P_LAST_PICKUP, -1);
    
    if(freeze)
        TeleportFreeze(playerid, 1200);
    
    //g_anticheat[playerid][P_SET_POS_X] = x,
    //g_anticheat[playerid][P_SET_POS_Y] = y,
    //g_anticheat[playerid][P_SET_POS_Z] = z,
    //g_anticheat[playerid][P_SET_POS_TICK] = GetTickCount();
    
    //time_fix_brake[playerid] = GetTickCount() + 4000;
    
    return 1;
}

 

Share this post


Link to post
  • 0

@odosenok Как исправить баг?

Share this post


Link to post
  • 0

Попробуй использовать вот так

 

stock SetPlayerPosEx(playerid, Float: x, Float: y, Float: z, Float: angle, interior = -1, virtual_world = -1, freeze = true)
{
    if(interior > 0)
        PlayerTeleportInit(playerid, x, y,  z, angle);

    SetPlayerPos(playerid, x, y, z);

    SetPlayerFacingAngle(playerid, angle);
    SetCameraBehindPlayer(playerid);
  
  if(interior == -1 || interior > 0)
        PlayerTeleportInit(playerid, x, y,  z, angle);

    SetPlayerPos(playerid, x, y, z);

    SetPlayerFacingAngle(playerid, angle);
    SetCameraBehindPlayer(playerid);
    
    if(interior != -1 && GetPlayerInterior(playerid) != interior)
        SetPlayerInterior(playerid, interior);
    
    if(virtual_world != -1 && GetPlayerVirtualWorld(playerid) != virtual_world)
        SetPlayerVirtualWorld(playerid, virtual_world);
    
    if(GetPlayerData(playerid, P_LAST_PICKUP) != -1)
        SetPlayerData(playerid, P_LAST_PICKUP, -1);
    
    if(freeze)
        TeleportFreeze(playerid, 1200);
    
    //g_anticheat[playerid][P_SET_POS_X] = x,
    //g_anticheat[playerid][P_SET_POS_Y] = y,
    //g_anticheat[playerid][P_SET_POS_Z] = z,
    //g_anticheat[playerid][P_SET_POS_TICK] = GetTickCount();
    
    //time_fix_brake[playerid] = GetTickCount() + 4000;
    
    return 1;
}

 

Share this post


Link to post
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By def
      arizona.pwn(23374) : error 012: invalid function call, not a valid address
      arizona.pwn(23374) : error 001: expected token: ";", but found ")"
      arizona.pwn(23374) : error 029: invalid expression, assumed zero
      arizona.pwn(23374) : fatal error 107: too many error messages on one line
      жалуется на данную строчку:
       
      %s{cccccc}Для продолжения нажмите 'Далее'",PN(playerid),playerid,ItemsInfo[itemid][ItemName2],hours,cost*hours,Inventory[playerid][2][slot], AksColorName(Inventory[playerid][4][slot]), Inventory[playerid][5][slot] ? GetNameStripe(Inventory[playerid][5][slot]) : "");