Jump to content

Problema comanda


Jamal Alin

Recommended Posts

Salutare, am o problema la comanda /emails.

CMD:emails(playerid,params[])
{
	new string[128],query[512],query2[512],text[32],idemail,id = ,status,sender,sendername[32],message[1024];
	mysql_format(handle, query, sizeof(query), "SELECT * FROM emails WHERE playerID = %d ORDER BY Data DESC LIMIT 20",PlayerInfo[playerid][pID]);
 	new Cache: result = mysql_query(handle, query);
	for(new i = ; i < cache_get_row_count(); i++)
	{
	    idemail = cache_get_field_content_int(i, "ID");
		SelectEmail[playerid][id] = idemail; id++;
		cache_get_field_content(i, "Text", text);
		status = cache_get_field_content_int(i, "Status");
		sender = cache_get_field_content_int(i, "Sender");
		if(sender > )
		{
		    mysql_format(handle, query2, sizeof(query2), "SELECT * FROM accounts WHERE accounts.ID = %d",sender);
		    mysql_query(handle, query2);
		    cache_get_field_content(, "Username", sendername);
		    if(status == 1) format(string, sizeof(string), "[NEW] %s: %s ...\n",sendername,text);
	  		else format(string, sizeof(string), "%s: %s ...\n",sendername,text);
	  		strcat(message,string);
		}
		else if(sender == )
		{
			if(status == 1) format(string, sizeof(string), "[NEW] %s ...\n",text);
	  		else format(string, sizeof(string), "%s ...\n",text);
	  		strcat(message,string);
		}
	}
	cache_delete(result);
	if(id == ) SendClientMessage(playerid, COLOR_WHITE, "Eroare: Nu ai niciun email.");
	else ShowPlayerDialog(playerid, 18, DIALOG_STYLE_LIST, "New Email", message, "Read", "Close");
	return 1;
}

Acolo unde trimit query-ul din interiorului loop-ului e problema cred. Deoarece mysql_query returneaza 1 si opreste loop-ul automat. Ce altceva pot face in privinta asta, inafara de faptul sa modific tabelul din baza de date in loc ID sa pun numele jucatorului deoarece folosesc asta in multe locuri mai ales pe panel si sunt multe de modificat. Daca ati vazut voi o alta optiune in care sa nu-mi mai opreasca loop-ul.

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.