Jon Cameron
Умник
Возникла ещё одна проблема. После регистрации/авторизации, персонаж спавнится с нулевым скином, на нулевые координаты, хотя координаты спавна выставлены и данные, в том числе и скин сохраняется нормально.
Вроде бы загрузка данных написана правильно, по крайней мере на другом моде она работала без сбоев
Ума не приложу, что не так?
Я думал сначала, что проблема в переменной login[MAX_PLAYERS] (проверка на авторизованность)
так как ранее уже сталкивался с такой проблемой, что работала только проверка на авторизованность на Пварах, может я что - то не так сделал, но не суть. По сути все правильно должно быть и должно работать, а на деле не так =\
Вроде бы загрузка данных написана правильно, по крайней мере на другом моде она работала без сбоев
PHP:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == arrowleft[playerid]) // действие на нажатие левой стрелки
{
switch(player_info[playerid][pSex])
{
case 1: // Если пол мужской
{
switch(player_info[playerid][pColorSkin])
{
case 1: //Если цвет кожи черный
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 4:
{
SetPlayerSkin(playerid,220);
SetPVarInt(playerid,"selectskin",220);
}
case 5:
{
SetPlayerSkin(playerid,4);
SetPVarInt(playerid,"selectskin",4);
}
case 14:
{
SetPlayerSkin(playerid,5);
SetPVarInt(playerid,"selectskin",5);
}
case 28:
{
SetPlayerSkin(playerid,14);
SetPVarInt(playerid,"selectskin",14);
}
case 220:
{
SetPlayerSkin(playerid,28);
SetPVarInt(playerid,"selectskin",28);
}
}
}
case 2: // Если цвет кожи белый
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 48: // 48 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,26);
SetPVarInt(playerid,"selectskin",26);
}
case 2:
{
SetPlayerSkin(playerid,48);
SetPVarInt(playerid,"selectskin",48);
}
case 6:
{
SetPlayerSkin(playerid,2);
SetPVarInt(playerid,"selectskin",2);
}
case 20:
{
SetPlayerSkin(playerid,6);
SetPVarInt(playerid,"selectskin",6);
}
case 26:
{
SetPlayerSkin(playerid,20);
SetPVarInt(playerid,"selectskin",20);
}
}
}
}
}
case 2: // Если пол женский
{
switch(player_info[playerid][pColorSkin])
{
case 1: // Если черный цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 13: // 13 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,298);
SetPVarInt(playerid,"selectskin",298);
}
case 65:
{
SetPlayerSkin(playerid,13);
SetPVarInt(playerid,"selectskin",13);
}
case 195:
{
SetPlayerSkin(playerid,65);
SetPVarInt(playerid,"selectskin",65);
}
case 215:
{
SetPlayerSkin(playerid,195);
SetPVarInt(playerid,"selectskin",195);
}
case 298:
{
SetPlayerSkin(playerid,215);
SetPVarInt(playerid,"selectskin",215);
}
}
}
case 2: // Если белый цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 90: // 90 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,237);
SetPVarInt(playerid,"selectskin",237);
}
case 41:
{
SetPlayerSkin(playerid,90);
SetPVarInt(playerid,"selectskin",90);
}
case 55:
{
SetPlayerSkin(playerid,41);
SetPVarInt(playerid,"selectskin",41);
}
case 151:
{
SetPlayerSkin(playerid,55);
SetPVarInt(playerid,"selectskin",55);
}
case 237:
{
SetPlayerSkin(playerid,151);
SetPVarInt(playerid,"selectskin",151);
}
}
}
}
}
}
}
if(clickedid == arrowright[playerid]) // действие на нажатие правой стрелки
{
switch(player_info[playerid][pSex])
{
case 1: // Если пол мужской
{
switch(player_info[playerid][pColorSkin])
{
case 1: // Если черный цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 4: // 4 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,5);
SetPVarInt(playerid,"selectskin",5);
}
case 5:
{
SetPlayerSkin(playerid,14);
SetPVarInt(playerid,"selectskin",14);
}
case 14:
{
SetPlayerSkin(playerid,28);
SetPVarInt(playerid,"selectskin",28);
}
case 28:
{
SetPlayerSkin(playerid,220);
SetPVarInt(playerid,"selectskin",220);
}
case 220:
{
SetPlayerSkin(playerid,4);
SetPVarInt(playerid,"selectskin",4);
}
}
}
case 2: // Если светлый цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 48: // 48 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,2);
SetPVarInt(playerid,"selectskin",2);
}
case 2:
{
SetPlayerSkin(playerid,6);
SetPVarInt(playerid,"selectskin",6);
}
case 6:
{
SetPlayerSkin(playerid,20);
SetPVarInt(playerid,"selectskin",20);
}
case 20:
{
SetPlayerSkin(playerid,26);
SetPVarInt(playerid,"selectskin",26);
}
case 26:
{
SetPlayerSkin(playerid,48);
SetPVarInt(playerid,"selectskin",48);
}
}
}
}
}
case 2: // Если женский пол
{
switch(player_info[playerid][pColorSkin])
{
case 1: // Если черный цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 13: // 13 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,65);
SetPVarInt(playerid,"selectskin",65);
}
case 65:
{
SetPlayerSkin(playerid,195);
SetPVarInt(playerid,"selectskin",195);
}
case 195:
{
SetPlayerSkin(playerid,215);
SetPVarInt(playerid,"selectskin",215);
}
case 215:
{
SetPlayerSkin(playerid,298);
SetPVarInt(playerid,"selectskin",298);
}
case 298:
{
SetPlayerSkin(playerid,13);
SetPVarInt(playerid,"selectskin",13);
}
}
}
case 2: // Если светлый цвет кожи
{
switch(GetPVarInt(playerid,"selectskin"))
{
case 90: // 90 скин (с которого начинается отсчет)
{
SetPlayerSkin(playerid,41);
SetPVarInt(playerid,"selectskin",41);
}
case 41:
{
SetPlayerSkin(playerid,55);
SetPVarInt(playerid,"selectskin",55);
}
case 55:
{
SetPlayerSkin(playerid,151);
SetPVarInt(playerid,"selectskin",151);
}
case 151:
{
SetPlayerSkin(playerid,237);
SetPVarInt(playerid,"selectskin",237);
}
case 237:
{
SetPlayerSkin(playerid,90);
SetPVarInt(playerid,"selectskin",90);
}
}
}
}
}
}
SelectTextDraw(playerid, 0xFFFFFFFF);
}
if(clickedid == Text:select[playerid]) // Нажимаем на Select
{
player_info[playerid][pSkin] = GetPVarInt(playerid,"selectskin");
SetPlayerSkin(playerid,player_info[playerid][pSkin]);
SelectTextDraw(playerid, 0xFFFFFFFF);
TextDrawHideForPlayer(playerid, Text:arrowleft[playerid]);
TextDrawHideForPlayer(playerid, Text:arrowright[playerid]);
TextDrawHideForPlayer(playerid, Text:prev[playerid]);
TextDrawHideForPlayer(playerid, Text:nextt[playerid]);
TextDrawHideForPlayer(playerid, Text:select[playerid]);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, 1760.1757,-1902.5409,13.5646); // Спавн после окончания регистрации.
SetPlayerFacingAngle(playerid, 293.3417);
SetPVarInt(playerid,"logged",1);
//login[playerid] = 1;
CancelSelectTextDraw(playerid);
TogglePlayerControllable(playerid,1);
SpawnPlayer(playerid);
new sex_text[10];
switch(player_info[playerid][pSex])
{
case 1: sex_text = "Мужской";
case 2: sex_text = "Женский";
}
new colorskin_text[10];
switch(player_info[playerid][pColorSkin])
{
case 1: colorskin_text = "Черный";
case 2: colorskin_text = "Белый";
}
static const info[] = "{169FF1}Ваш ник: {18CF26}%s\n\
{169FF1}Ваш пароль: {18CF26}%s\n\
{169FF1}Ваш E-mail: {18CF26}%s\n\
{169FF1}Ваш пол: {18CF26}%s\n\
{169FF1}Ваш цвет кожи: {18CF26}%s\n\
{169FF1}Приятной игры на new.pwn!";
new info_string[sizeof(info)+MAX_PLAYER_NAME+30+30+20-2*5];
format(info_string,sizeof(info_string),info,player_info[playerid][pName],player_info[playerid][pPass],player_info[playerid][pEmail],sex_text,colorskin_text);
SPD(playerid,6,DIALOG_STYLE_MSGBOX,"{F0FF00}Окончание регистрации",info_string,"Закрыть","");
}
return true;
}
PHP:
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid,"regskin") == 1) //выбор скина
{
SetPVarInt(playerid,"regskin",0);
InterpolateCameraPos(playerid, 628.361999, -1764.837890, 19.931350, 628.361999, -1764.837890, 19.931350, 1000);
InterpolateCameraLookAt(playerid, 630.895507, -1769.109252, 19.350666, 630.895507, -1769.109252, 19.350666, 1000);
SetPlayerPos(playerid, 630.8016,-1774.0349,18.9629);
SetPlayerScore(playerid,player_info[playerid][pLevel]);
SetPlayerFacingAngle(playerid, 339.8602); // Z координата персонажа
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 0);
TextDrawShowForPlayer(playerid, Text:arrowleft[playerid]);
TextDrawShowForPlayer(playerid, Text:arrowright[playerid]);
TextDrawShowForPlayer(playerid, Text:prev[playerid]);
TextDrawShowForPlayer(playerid, Text:nextt[playerid]);
TextDrawShowForPlayer(playerid, Text:select[playerid]);
SelectTextDraw(playerid, 0xFFFFFFFF);
SetPlayerAttachedObject(playerid,3,1210,5,0.299999,0.099999,0.000000,0.000000,-83.000000,0.000000,1.000000,1.000000,1.000000);
switch(player_info[playerid][pSex])
{
case 1: // Мужской скин
{
switch(player_info[playerid][pColorSkin])
{
case 1: // черный цвет кожи
{
SetPlayerSkin(playerid, 4);
SetPVarInt(playerid, "selectskin", 4);
}
case 2: // белый цвет кожи
{
SetPlayerSkin(playerid, 48);
SetPVarInt(playerid, "selectskin", 48);
}
}
}
case 2: // Женский скин
{
switch(player_info[playerid][pColorSkin])
{
case 1: // черный цвет кожи
{
SetPlayerSkin(playerid, 13);
SetPVarInt(playerid, "selectskin", 13);
}
case 2: // белый цвет кожи
{
SetPlayerSkin(playerid, 90);
SetPVarInt(playerid, "selectskin", 90);
}
}
}
}
if(GetPVarInt(playerid,"logged") == 1)
{
SetPlayerSkin(playerid,player_info[playerid][pSkin]);
SetPlayerPos(playerid, 1760.1757,-1902.5409,13.5646); // Спавн после окончания регистрации.
SetPlayerFacingAngle(playerid, 293.3417);
SetPlayerScore(playerid, player_info[playerid][pLevel]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
RemovePlayerAttachedObject(playerid, 1);
}
}
saveakk(playerid);
return 1;
}
PHP:
forward UploadPlayerAccount(playerid,upa_pass[]);
public UploadPlayerAccount(playerid,upa_pass[])
{
new rows,fields;
cache_get_data(rows,fields);
if(!rows)
{
if(GetPVarInt(playerid,"WrongPassword") == 3)
{
SCM(playerid,COLOR_LIGHTRED, "Вы были кикнуты за ввод не правильного пароля. Введите /q(uit) чтобы выйти.");
Kick(playerid);
}
SetPVarInt(playerid,"WrongPassword",GetPVarInt(playerid,"WrongPassword") +1);
return show_login(playerid);
}
player_info[playerid][pPass][0] = EOS;
strcat(player_info[playerid][pPass],upa_pass);
player_info[playerid][pID] = cache_get_field_content_int(0,"id",dbHandle);
player_info[playerid][pSex] = cache_get_field_content_int(0,"sex",dbHandle);
player_info[playerid][pColorSkin] = cache_get_field_content_int(0,"colorskin",dbHandle);
player_info[playerid][pSkin] = cache_get_field_content_int(0,"skin",dbHandle);
player_info[playerid][pLevel] = cache_get_field_content_int(0,"level",dbHandle);
SetPVarInt(playerid,"logged",1);
//login[playerid] = 1;
if(player_info[playerid][pSkin] != 0)
{
SpawnPlayer(playerid);
}
if(GetPVarInt(playerid,"logged") == 1)
{
KillTimer(Authoriz[playerid]);
}
return true;
}
Ума не приложу, что не так?
Я думал сначала, что проблема в переменной login[MAX_PLAYERS] (проверка на авторизованность)
так как ранее уже сталкивался с такой проблемой, что работала только проверка на авторизованность на Пварах, может я что - то не так сделал, но не суть. По сути все правильно должно быть и должно работать, а на деле не так =\
