public OnLogin(playerid)
{
new rows, fields,temporar[200], string1[1000], targetid;
cache_get_data(rows, fields);
if(rows)
{
cache_get_field_content(0, "Parola", temporar), format( P_Data[playerid][pParola], 25, temporar);
P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "AdminLevel");
P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
P_Data[playerid][pHelper] = cache_get_field_content_int(0, "HelperLevel");
P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
GivePlayerMoney(playerid, P_Data[playerid][pCash]);
SetPlayerScore(playerid, P_Data[playerid][pLevel]);
SpawnPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Bine ai revenit.");
format(string1, sizeof(string1), "%s s-a logat pe server cu ID-ul (%d)", GetName(targetid), playerid);
submitToHelpersAndAdmins(string1, COLOR_STAFF);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
}
return 1;
}