- 0
Problema /emails
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
Rayan
Salut, am o problema la /emails, faza este ca atunci cand un jucator primeste un email il are ca necitit, insa, daca gen primeste 11 email-uri noi (si sunt 11 necitite) in /emails arata doar primele 10 sortate dupa ID, faza e ca le face pe toate cele 10 citite, insa mai ramane 1 de citit insa nu il poate selecta deoarece in lista de /emails apar doar primele 10.
Cum as putea face ca atunci cand dai /emails sa iti arate mai intai mesajele necitite si mai jos de ele cele citite sortate dupa ID?
CMD:email(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(IsPlayerConnected(playerid)) { new result[300],message[300],string[5000],read,message2[100],finalmessage[100],query[500],emailid,idd=0; format(query, sizeof(query), "SELECT * FROM `emails` WHERE `playerid` = '%d' ORDER BY `ID` DESC LIMIT 10", PlayerInfo[playerid][pSQLID]); new Cache: emailresult = mysql_query(SQL, query); if(cache_get_row_count() > 0) { for(new i, j = cache_get_row_count (); i != j; ++i) { cache_get_field_content(i, "Message", result); format(message, sizeof(message), result); read = cache_get_field_content_int(i, "EmailRead"); emailid = cache_get_field_content_int(i, "ID"); EmailId[playerid][idd] = emailid; idd++; if(strlen(message) > 49) { strmid(message2, message, 0, 50, sizeof(message2)); format(finalmessage,sizeof(finalmessage), "%s...",message2); } if(read > 0) { if(PlayerInfo[playerid][pLanguage] == 2) { format(string, sizeof(string), "%s[NECITIT]%s\n", string, finalmessage); } else { format(string, sizeof(string), "%s[UNREAD]%s\n", string, finalmessage); } } else { format(string, sizeof(string), "%s%s\n", string, finalmessage); } } } else return SendClientMessage(playerid, COLOR_WHITE, "You don't have a email!"); cache_delete(emailresult); ShowPlayerDialog(playerid,DIALOG_EMAILS,DIALOG_STYLE_LIST,"Emails",string,"Read","Exit"); } return 1; }Edited by Rayan10 answers to this question
Recommended Posts