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); } |
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);
try using
pawn Код:
and are you sure you are saving the player coordinates and skin ? check through player table if its saving or not |
cache_get_field_content_int should be cache_get_field_content_float for floats (x, y, z)
|
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; } |