• Уважаемый Гость.
    - Прежде чем создать свою тему, пожалуйста, попробуй воспользоваться этим -> ПОИСКОМ !!!
    - После решения Вашего вопроса (проблемы) - нажмите "Лучший ответ", на сообщении, которое его решило. За игнорирование этого действия - Вы получите соответствующее предупреждение. Мы - стараемся Вам помочь. Уделите 10 секунд - чтобы нажать кнопку. (Если у Вас нет такой возможности - укажите в последнем своем сообщении какой ответ Вы считаете лучшим. Наши модераторы сделают это за Вас)
    ЗАПРЕЩЕНО:
    - Cоздавать темы с названиями "Помогите", "Плиз", "Ошибка", "Не могу найти", "Хелп" и тому подобное;
    - Cоздавать темы без детального описания того, что нужно исправить.
    - Cоздавать темы из одного скриншота.
    За игнор правил форума - Ваша тема будет удалена, а Вы получите системное предупреждение.

Почему персонаж не спавнится на координаты после авторизаций на сервере?

Статус
В этой теме нельзя размещать новые ответы.

Petr_Simso

Дебютант
Добрый день, такая ситуация.Вроде все отлично, должно спавнится, а почему то оно не спавнится, уже злость берет :(
Показываю весь код авторизаций.
PHP:
stock show_login(playerid)
{
    new string[250];
    if(GetPVarInt(playerid, "WrongPassword") == 0)
    {
        format(string, sizeof(string), "{FFFFFF}Авторизация\n\n{FFFFFF}Логин: {319610}%s{FFFFFF}\nПароль:", player_info[playerid][NAME]);
     }
    else
    {
       format(string, sizeof(string), "{FFFFFF}Авторизация\n\n\n{FFFFFF}Логин: {319610}%s{FFFFFF}\n{FF4621}Неверный пароль: %d",player_info[playerid][NAME], 4-GetPVarInt(playerid, "WrongPassword"));
    }
     SPD(playerid, 7, DIALOG_STYLE_INPUT, "{4ac7ff}Авторизация", string, "GO", "Отмена");
     logins_timers[playerid] = SetTimerEx("logintimes", 29999, true, "d", playerid);
     login_timer[playerid] = SetTimerEx("logintime", 30000, true, "d", playerid);
     SetPVarInt(playerid, "timetologin", 1);
}
Код:
case 7:
          {
              if(!strlen(inputtext))
              {
                show_login(playerid);
              }
              else
              {
                  new query[160], temp[15];
                  mysql_real_escape_string(inputtext, temp);
                  format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `login` = '%s' AND `password` = '%s' LIMIT 1", player_info[playerid][NAME], temp);
                  mysql_function_query(dbHandle, query, true, "player_login", "i", playerid);
              }
          }
Код:
forward player_login(playerid);
public player_login(playerid)
{
    new rows[2], temp[64];
    cache_get_data(rows[0], rows[1]);
    if(rows[0])
    {
        cache_get_field_content(0, "id", temp), player_info[playerid][ID] = strval(temp);
        cache_get_field_content(0, "email", temp), strmid(player_info[playerid], temp, 0, strlen(temp), 32);
        cache_get_field_content(0, "sex", temp), player_info[playerid][SEX] = strval(temp);
        cache_get_field_content(0, "admin", temp), player_info[playerid][ADMIN] = strval(temp);
        cache_get_field_content(0, "skin", temp), player_info[playerid][SKIN] = strval(temp);
        cache_get_field_content(0, "level", temp), player_info[playerid][LEVEL] = strval(temp);
        cache_get_field_content(0, "exp", temp), player_info[playerid][EXP] = strval(temp);
        cache_get_field_content(0, "time", temp), player_info[playerid][TIME] = strval(temp);
        cache_get_field_content(0, "money", temp), player_info[playerid][MONEY] = strval(temp);
        cache_get_field_content(0, "zd", temp), player_info[playerid][ZD] = strval(temp);
        cache_get_field_content(0, "viso", temp), player_info[playerid][VISO] = strval(temp);
        cache_get_field_content(0, "oren", temp), player_info[playerid][OREN] = strval(temp);
        cache_get_field_content(0, "sels", temp), player_info[playerid][SELS] = strval(temp);
        cache_get_field_content(0, "golod", temp), player_info[playerid][GOLOD] = strval(temp);
        cache_get_field_content(0, "virus", temp), player_info[playerid][VIRUS] = strval(temp);
        cache_get_field_content(0, "on", temp), player_info[playerid][ON] = strval(temp);
        cache_get_field_content(0, "referal", temp), strmid(player_info[playerid][REFERAL], temp, 0, strlen(temp), 24);
        cache_get_field_content(0, "hp", temp), player_info[playerid][HP] = strval(temp);
        cache_get_field_content(0, "dlic", temp), player_info[playerid][DLIC] = strval(temp);
        cache_get_field_content(0, "glic", temp), player_info[playerid][GLIC] = strval(temp);
        cache_get_field_content(0, "chats", temp), player_info[playerid][CHATS] = strval(temp);
        cache_get_field_content(0, "ochats", temp), player_info[playerid][OCHATS] = strval(temp);
        cache_get_field_content(0, "nicks", temp), player_info[playerid][NICKS] = strval(temp);
        cache_get_field_content(0, "nickcs", temp), player_info[playerid][NICKCS] = strval(temp);
        cache_get_field_content(0, "ids", temp), player_info[playerid][IDS] = strval(temp);
        cache_get_field_content(0, "vehs", temp), player_info[playerid][VEHS] = strval(temp);
        cache_get_field_content(0, "house", temp), player_info[playerid][HOUSE] = strval(temp);
        cache_get_field_content(0, "spawn", temp), player_info[playerid][SPAWN] = strval(temp);
        cache_get_field_content(0, "guest", temp), player_info[playerid][GUEST] = strval(temp);
        cache_get_field_content(0, "met", temp), player_info[playerid][MET] = strval(temp);
        cache_get_field_content(0, "patr", temp), player_info[playerid][PATR] = strval(temp);
        cache_get_field_content(0, "drugs", temp), player_info[playerid][DRUGS] = strval(temp);
        cache_get_field_content(0, "mute", temp), player_info[playerid][MUTE] = strval(temp);
        cache_get_field_content(0, "warn", temp), player_info[playerid][WARN] = strval(temp);
        cache_get_field_content(0, "frac", temp), player_info[playerid][FRAC] = strval(temp);
        cache_get_field_content(0, "rang", temp), player_info[playerid][RANG] = strval(temp);
        cache_get_field_content(0, "fskin", temp), player_info[playerid][FSKIN] = strval(temp);
        cache_get_field_content(0, "dmoney", temp), player_info[playerid][DMONEY] = strval(temp);
        cache_get_field_content(0, "upgrade", temp), player_info[playerid][UPGRADE] = strval(temp);
        cache_get_field_content(0, "work", temp), player_info[playerid][WORK] = strval(temp);
        SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
        new query[80], newip[16];
        GetPlayerIp(playerid, newip, 16);
        format(query, sizeof(query), "UPDATE `accounts` SET `lastip` = '%s' WHERE `id` = '%d'", newip, player_info[playerid][ID]);
        mysql_function_query(dbHandle, query, false, "", "");
        if(player_info[playerid][OREN] == 0)
        {
            SetPVarInt(playerid, "logged", 1);
            SpawnPlayer(playerid);
        }
    }
    else
    {
        if(GetPVarInt(playerid, "WrongPassword") == 3)
        {
            SCM(playerid, COLOR_RED, "Неверный пароль /q(/quit) .");
            Kick(playerid);
        }
        SetPVarInt(playerid, "WrongPassword", GetPVarInt(playerid, "WrongPassword")+ 1);
        show_login(playerid);
    }
}
Код:
public OnPlayerSpawn(playerid)
{
    if(GetPVarInt(playerid, "logged") == 0)
    {
        SCM(playerid, COLOR_GREY, "Должны авторизаваться");
        Kick(playerid);
        return 1;
    }
    if(player_info[playerid][OREN] == 0)
    {
        if(player_info[playerid][LEVEL] == 1 && player_info[playerid][LEVEL] == 2 && player_info[playerid][LEVEL] == 3)
        {
            switch(random(2))
            {
                case 0:
                {
                    SetCameraBehindPlayer(playerid);
                     SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1759.8994,-1900.3701,13.5635);
                    SetPlayerFacingAngle(playerid, 270.0);
                }
                case 1:
                {
                    SetCameraBehindPlayer(playerid);
                     SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1202.0745,-1756.1912,13.5863);
                    SetPlayerFacingAngle(playerid, 75.0);
                }
            }
        }
    }
    return 1;
}
У меня в базе данных прописана строчка oren = 0, он логиниться, происходит спавн, но почему он в воздухе летит? Когда в паблике OnPlayerSpawn прописан тоже oren = 0 и он должен кидать на координаты. Что ему надо?

Дело в том что принты проходят полностью OnPlayerSpawn.
Если я ставлю просто координаты вот такие.
Вот так просто он спавнит:
PHP:
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1759.8994,-1900.3701,13.5635);
SetPlayerFacingAngle(playerid, 270.0);
А нужно с:
PHP:
if(player_info[playerid][OREN] == 0)
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу