#1

Quote:

if(dialogid == DIALOG_LOGIN)
{
if(response)
{
new Vardas[MAX_PLAYER_NAME], query[256], slaptazodis[32];
GetPlayerName(playerid, Vardas, sizeof(Vardas));
if(strlen(inputtext) >= 0)
{
mysql_escape_string(inputtext, slaptazodis, manomysql);
format(query, sizeof(query), "SELECT * FROM `user` WHERE vardas='%s' AND slaptazodis='%s'", Vardas, slaptazodis);
mysql_function_query(manomysql, query, true, "OnPasswordResponse", "i", playerid);
SetSpawnInfo(playerid, 0, sInfo[playerid][skinas], sInfo[playerid][p_x], sInfo[playerid][p_y], sInfo[playerid][p_z], 0, 0, 0, 0, 0, 0, 0);//////////////BŪTINA KEISTI!!!!!!!!!!!
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, RAUDONA, "Jūs nieko neįvedėte!");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Prisijungimas", "Praљome įvesti slaptaћodį!", "Prisijungti", "Iљeiti");
}
}
else
{
Kick(playerid);
}

Why skin and pos not loaded? Then i spawn coordinates is 50.0, 50.0,50.0
Reply
#2

So? Anyone know?
Reply
#3

try using
pawn Код:
SetSpawnInfo(playerid, 0, sInfo[playerid][skinas], sInfo[playerid][p_x], sInfo[playerid][p_y], sInfo[playerid][p_z], 0, 0, 0, 0, 0, 0, 0);//////////////BŪTINA KEISTI!!!!!!!!!!!
SpawnPlayer(playerid);
after assigning player with his data, which is probably somewhere inside OnPasswordResponse.
and are you sure you are saving the player coordinates and skin ? check through player table if its saving or not
Reply
#4

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
try using
pawn Код:
SetSpawnInfo(playerid, 0, sInfo[playerid][skinas], sInfo[playerid][p_x], sInfo[playerid][p_y], sInfo[playerid][p_z], 0, 0, 0, 0, 0, 0, 0);//////////////BŪTINA KEISTI!!!!!!!!!!!
SpawnPlayer(playerid);
after assigning player with his data, which is probably somewhere inside OnPasswordResponse.
and are you sure you are saving the player coordinates and skin ? check through player table if its saving or not
yeah i'm using it (check code in my first post)

So you think were problem can be here?
EDIT: https://pastebin.com/5KZm9WpP (Updated code)
Reply
#5

there is a more code:
https://pastebin.com/SQpzsJdT

So?
Reply
#6

cache_get_field_content_int should be cache_get_field_content_float for floats (x, y, z)
Reply
#7

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
cache_get_field_content_int should be cache_get_field_content_float for floats (x, y, z)
oh, i dont think about it
Reply
#8

but where is still something wrong, because register works perfectly, but login absolutly no
Reply
#9

There is my login system: https://pastebin.com/AFsTsfC7

Problem is what Vip, admin, job, money, xp... is loading, but just pos and skin not. I using SetSpawnInfo and SpawnPlayer but info in theese functions not loading.
Reply
#10

Quote:

public OnPasswordResponse(playerid)
{
new num_rows, num_fields;
cache_get_data(num_rows, num_fields, manomysql);
if(num_rows == 1)
{
//Slaptažodis teisingas
sInfo[playerid][kazkas] = 1;
TogglePlayerSpectating(playerid, 0);
ClearChat(playerid);
SendClientMessage(playerid, MELYNA, "pasveikinimas");
sInfo[playerid][XP] = cache_get_field_content_int(0, "XP", manomysql);
SetPlayerScore(playerid, sInfo[playerid][XP]);
sInfo[playerid][id] = cache_get_field_content_int(0, "id", manomysql);
sInfo[playerid][lytis] = cache_get_field_content_int(0, "lytis", manomysql);
sInfo[playerid][pinigai] = cache_get_field_content_int(0, "pinigai", manomysql);
GivePlayerMoney(playerid, sInfo[playerid][pinigai]);
sInfo[playerid][adminlevel] = cache_get_field_content_int(0, "adminlevel", manomysql);
sInfo[playerid][skinas] = cache_get_field_content_int(0, "skinas", manomysql);
SetPlayerSkin(playerid, sInfo[playerid][skinas]);
sInfo[playerid][zskinas] = cache_get_field_content_int(0, "zskinas", manomysql);
sInfo[playerid][dskinas] = cache_get_field_content_int(0, "dskinas", manomysql);
sInfo[playerid][VIP] = cache_get_field_content_int(0, "VIP", manomysql);
sInfo[playerid][p_x] = cache_get_field_content_float(0, "x", manomysql);
sInfo[playerid][p_y] = cache_get_field_content_float(0, "y", manomysql);
sInfo[playerid][p_z] = cache_get_field_content_float(0, "z", manomysql);
SetPlayerPos(playerid, sInfo[playerid][p_x], sInfo[playerid][p_y], sInfo[playerid][p_z]);
sInfo[playerid][MedikuDarbas] = cache_get_field_content_int(0, "MedikuDarbas", manomysql);
sInfo[playerid][MedDirektorius] = cache_get_field_content_int(0, "MedDirektorius", manomysql);
sInfo[playerid][MedPavaduotojas] = cache_get_field_content_int(0, "MedPavaduotojas", manomysql);
sInfo[playerid][MedRangas] = cache_get_field_content_int(0, "MedRangas", manomysql);
sInfo[playerid][TaxiDarbas] = cache_get_field_content_int(0, "TaxiDarbas", manomysql);
sInfo[playerid][TaxDirektorius] = cache_get_field_content_int(0, "TaxDirektorius", manomysql);
sInfo[playerid][TaxPavaduotojas] = cache_get_field_content_int(0, "TaxPavaduotojas", manomysql);
sInfo[playerid][TaxDirektorius] = cache_get_field_content_int(0, "TaxDirektorius", manomysql);
}
else
{
//Slaptažodis neteisingas
SendClientMessage(playerid, RAUDONA, "Neteisingas slaptažodis!");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Prisijungimas", "Prašome įvesti slaptažodį!", "Prisijungti", "Išeiti");
}
return 1;
}

Error is in OnPasswordResponse, because then i connect i I dont get message (red line) ant chat dont be cleared.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)